Пример #1
0
 def dict_from_object(cls, win_event_obj):
     """Parse and return a dictionary for a Win Event Object object"""
     win_event_dict = {}
     if win_event_obj.get_Name() is not None: win_mutex_dict['name'] = Base_Object_Attribute.dict_from_object(win_event_obj.get_Name())
     if win_event_obj.get_Handle() is not None: win_mutex_dict['handle'] = Win_Handle.dict_from_object(win_mutex_obj.get_Handle())
     if win_event_obj.get_Type() is not None: win_mutex_dict['type'] = Base_Object_Attribute.dict_from_object(win_event_obj.get_Type())    
     return win_event_dict
Пример #2
0
 def object_from_dict(cls, win_thread_dict):
     """Create the Windows Thread Object object representation from an input dictionary"""
     win_thread_obj = win_thread_binding.WindowsThreadObjectType()
     win_thread_obj.set_anyAttributes_({'xsi:type' : 'WinThreadObj:WindowsThreadObjectType'})
     
     for key, value in win_thread_dict.items():
         if key == 'thread_id' and utils.test_value(value):
             win_thread_obj.set_Thread_ID(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'),value))
         elif key == 'handle':
             win_thread_obj.set_Handle(Win_Handle.object_from_dict(value)) 
         elif key == 'running_status':
             win_thread_obj.set_Running_Status(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'),value))
         elif key == 'context':
             win_thread_obj.set_Context(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'),value))
         elif key == 'priority':
             win_thread_obj.set_Priority(Base_Object_Attribute.object_from_dict(common_types_binding.UnsignedIntegerObjectAttributeType(datatype='UnsignedInteger'),value))
         elif key == 'creation_flags':
             win_thread_obj.set_Creation_Flags(Base_Object_Attribute.object_from_dict(common_types_binding.HexBinaryObjectAttributeType(datatype='hexBinary'),value))
         elif key == 'creation_time':
             win_thread_obj.set_Creation_Time(Base_Object_Attribute.object_from_dict(common_types_binding.DateTimeObjectAttributeType(datatype='DateTime'),value))
         elif key == 'start_address':
             win_thread_obj.set_Start_Address(Base_Object_Attribute.object_from_dict(common_types_binding.HexBinaryObjectAttributeType(datatype='hexBinary'),value))
         elif key == 'parameter_address':
             win_thread_obj.set_Parameter_Address(Base_Object_Attribute.object_from_dict(common_types_binding.HexBinaryObjectAttributeType(datatype='hexBinary'),value))
         elif key == 'security_attributes':
             win_thread_obj.set_Security_Attributes(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'),value))
         elif key == 'stack_size':
             win_thread_obj.set_Stack_Size(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'),value))
     return win_thread_obj
Пример #3
0
 def dict_from_object(cls, win_mutex_obj):
     """Parse and return a dictionary for a Win Mutex Object object"""
     win_mutex_dict = Mutex.dict_from_object(defined_object)
     if win_mutex_obj.get_Handle() is not None: win_mutex_dict['handle'] = Win_Handle.dict_from_object(win_mutex_obj.get_Handle())
     if win_mutex_obj.get_Security_Attributes() is not None: win_mutex_dict['security_attributes'] = Base_Object_Attribute.dict_from_object(win_mutex_obj.get_Security_Attributes())
         
     return win_mutex_dict
Пример #4
0
    def object_from_dict(cls, win_event_dict):
        """Create the Win Event Object object representation from an input dictionary"""
        win_event_obj = win_event_binding.WindowsEventObjectType()
        win_event_obj.set_anyAttributes_({'xsi:type' : 'WinEventObj:WindowsEventObjectType'})
        
        for key, value in win_event_dict.items():
            if key == 'name' and utils.test_value(value): win_event_obj.set_Name(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value))
            elif key == 'handle' : win_event_obj.set_Handle(Win_Handle.object_from_dict(value))
            elif key == 'type' and utils.test_value(value) : win_event_obj.set_Name(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value))
 
        return win_event_obj    
Пример #5
0
 def object_from_dict(cls, win_mutex_dict):
     """Create the Win Mutex Object object representation from an input dictionary"""
     win_mutex_obj = Mutex.object_from_dict(win_mutex_attributes,win_mutex_binding.WindowsMutexObjectType())
     win_mutex_obj.set_anyAttributes_({'xsi:type' : 'WinMutexObj:WindowsMutexObjectType'})
     
     for key, value in win_mutex_dict.items():
         if key == 'handle' : win_mutex_obj.set_Handle(Win_Handle.object_from_dict(value))
         elif key == 'security_attributes' and utils.test_value(value):
             win_mutex_obj.set_Security_Attributes(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'), value))
     
     return win_mutex_obj    
Пример #6
0
 def dict_from_object(cls, win_pipe_obj):
     """Parse and return a dictionary for a Win Pipe Object object"""
     win_pipe_dict = Pipe.dict_from_object(win_pipe_obj)
     if win_pipe_obj.get_Default_Time_Out() is not None: win_pipe_dict['default_time_out'] = Base_Object_Attribute.dict_from_object(win_pipe_obj.get_Default_Time_Out())
     if win_pipe_obj.get_Handle() is not None: win_pipe_dict['handle'] = Win_Handle.dict_from_object(win_pipe_obj.get_Handle())
     if win_pipe_obj.get_In_Buffer_Size() is not None: win_pipe_dict['in_buffer_size'] = Base_Object_Attribute.dict_from_object(win_pipe_obj.get_In_Buffer_Size())
     if win_pipe_obj.get_Max_Instances() is not None: win_pipe_dict['max_instances'] = Base_Object_Attribute.dict_from_object(win_pipe_obj.get_Max_Instances())
     if win_pipe_obj.get_Open_Mode() is not None: win_pipe_dict['open_mode'] = Base_Object_Attribute.dict_from_object(win_pipe_obj.get_Open_Mode())
     if win_pipe_obj.get_Out_Buffer_Size() is not None: win_pipe_dict['out_buffer_size'] = Base_Object_Attribute.dict_from_object(win_pipe_obj.get_Out_Buffer_Size())
     if win_pipe_obj.get_Pipe_Mode() is not None: win_pipe_dict['pipe_mode'] = Base_Object_Attribute.dict_from_object(win_pipe_obj.get_Pipe_Mode())
     if win_pipe_obj.get_Security_Attributes() is not None: win_pipe_dict['security_attributes'] = Base_Object_Attribute.dict_from_object(win_pipe_obj.get_Security_Attributes())
     return win_pipe_dict
Пример #7
0
 def dict_from_object(cls, win_thread_obj):
     """Parse and return a dictionary for a Windows Thread Object object"""
     win_thread_dict = {}
     if win_thread_obj.get_Thread_ID() is not None: win_thread_dict['thread_id'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Thread_ID())
     if win_thread_obj.get_Handle() is not None: win_thread_dict['handle'] = Win_Handle.dict_from_object(win_thread_obj.get_Handle())
     if win_thread_obj.get_Running_Status() is not None: win_thread_dict['running_status'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Running_Status())
     if win_thread_obj.get_Context() is not None: win_thread_dict['context'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Context())
     if win_thread_obj.get_Priority() is not None: win_thread_dict['priority'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Priority())
     if win_thread_obj.get_Creation_Flags() is not None: win_thread_dict['creation_flags'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Creation_Flags())
     if win_thread_obj.get_Creation_Time() is not None: win_thread_dict['creation_time'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Creation_Time())
     if win_thread_obj.get_Start_Address() is not None: win_thread_dict['start_address'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Start_Address())
     if win_thread_obj.get_Parameter_Address() is not None: win_thread_dict['parameter_address'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Parameter_Address())
     if win_thread_obj.get_Security_Attributes() is not None: win_thread_dict['security_attributes'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Security_Attributes())
     if win_thread_obj.get_Stack_Size() is not None: win_thread_dict['stack_size'] = Base_Object_Attribute.dict_from_object(win_thread_obj.get_Stack_Size())
     return win_thread_dict
Пример #8
0
    def object_from_dict(cls, win_pipe_dict):
        """Create the Win Pipe Object object representation from an input dictionary"""
        win_pipe_obj = Pipe.object_from_dict(win_pipe_attributes, win_pipe_binding.WindowsPipeObjectType())
        win_pipe_obj.set_anyAttributes_({'xsi:type' : 'WinPipeObj:WindowsPipeObjectType'})
        
        for key, value in win_pipe_dict.items():
            if key == 'default_time_out' and utils.test_value(value):
                win_pipe_obj.set_Default_Time_Out(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'),value))
            elif key == 'handle':
                win_pipe_obj.set_Handle(Win_Handle.object_from_dict(value))
            elif key == 'in_buffer_size' and utils.test_value(value):
                win_pipe_obj.set_In_Buffer_Size(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'),value))
            elif key == 'max_instances' and utils.test_value(value):
                win_pipe_obj.set_Max_Instances(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'),value))
            elif key == 'open_mode' and utils.test_value(value):
                win_pipe_obj.set_Open_Mode(Base_Object_Attribute.object_from_dict(common_types_binding.HexBinaryObjectAttributeType(datatype='hexBinary'),value))
            elif key == 'out_buffer_size' and utils.test_value(value):
                win_pipe_obj.set_Out_Buffer_Size(Base_Object_Attribute.object_from_dict(common_types_binding.NonNegativeIntegerObjectAttributeType(datatype='NonNegativeInteger'),value))
            elif key == 'pipe_mode' and utils.test_value(value):
                win_pipe_obj.set_Pipe_Mode(Base_Object_Attribute.object_from_dict(common_types_binding.HexBinaryObjectAttributeType(datatype='hexBinary'),value))
            elif key == 'security_attributes' and utils.test_value(value):
                win_pipe_obj.set_Security_Attributes(Base_Object_Attribute.object_from_dict(common_types_binding.StringObjectAttributeType(datatype='String'),value))

        return win_pipe_obj