Python pythoncom 模块,IID_NULL 实例源码

我们从Python开源项目中,提取了以下24个代码示例,用于说明如何使用pythoncom.IID_NULL

项目:Email_My_PC    作者:Jackeriss    | 项目源码 | 文件源码
def GetCategoryForSCID(self, scid):
        if scid==PKEY_ItemNameDisplay:
            guid = CAT_GUID_NAME
        elif scid == PKEY_Sample_AreaSize:
            guid = CAT_GUID_SIZE
        elif scid == PKEY_Sample_NumberOfSides:
            guid = CAT_GUID_SIDES
        elif scid == PKEY_Sample_DirectoryLevel:
            guid = CAT_GUID_LEVEL
        elif scid == pythoncom.IID_NULL:
            # This can be called with a NULL
            # format ID. This will happen if you have a category,
            # not based on a column, that gets stored in the
            # property bag. When a return is made to this item,
            # it will call this function with a NULL format id. 
            guid = CAT_GUID_VALUE
        else:
            raise COMException(hresult=winerror.E_INVALIDARG)
        return guid

    #  Retrieves the name of the specified category. This is where
    #  additional categories that appear under the column
    #  related categories in the UI, get their display names.
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetObjectInformation(self):
        """Identifies object whose security will be modified, and determines options available
           to the end user"""
        flags=SI_ADVANCED|SI_EDIT_ALL|SI_PAGE_TITLE|SI_RESET
        if os.path.isdir(self.FileName):
            flags|=SI_CONTAINER
        hinstance=0  ## handle to module containing string resources
        servername=''  ## name of authenticating server if not local machine
        objectname=os.path.split(self.FileName)[1]
        pagetitle='Python ACL Editor'
        if os.path.isdir(self.FileName):
            pagetitle+=' (dir)'
        else:
            pagetitle+=' (file)'
        objecttype=IID_NULL
        return flags, hinstance, servername, objectname, pagetitle, objecttype
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetCategoryForSCID(self, scid):
        if scid==PKEY_ItemNameDisplay:
            guid = CAT_GUID_NAME
        elif scid == PKEY_Sample_AreaSize:
            guid = CAT_GUID_SIZE
        elif scid == PKEY_Sample_NumberOfSides:
            guid = CAT_GUID_SIDES
        elif scid == PKEY_Sample_DirectoryLevel:
            guid = CAT_GUID_LEVEL
        elif scid == pythoncom.IID_NULL:
            # This can be called with a NULL
            # format ID. This will happen if you have a category,
            # not based on a column, that gets stored in the
            # property bag. When a return is made to this item,
            # it will call this function with a NULL format id. 
            guid = CAT_GUID_VALUE
        else:
            raise COMException(hresult=winerror.E_INVALIDARG)
        return guid

    #  Retrieves the name of the specified category. This is where
    #  additional categories that appear under the column
    #  related categories in the UI, get their display names.
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetObjectInformation(self):
        """Identifies object whose security will be modified, and determines options available
           to the end user"""
        flags=SI_ADVANCED|SI_EDIT_ALL|SI_PAGE_TITLE|SI_RESET
        if os.path.isdir(self.FileName):
            flags|=SI_CONTAINER
        hinstance=0  ## handle to module containing string resources
        servername=''  ## name of authenticating server if not local machine
        objectname=os.path.split(self.FileName)[1]
        pagetitle='Python ACL Editor'
        if os.path.isdir(self.FileName):
            pagetitle+=' (dir)'
        else:
            pagetitle+=' (file)'
        objecttype=IID_NULL
        return flags, hinstance, servername, objectname, pagetitle, objecttype
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetCategoryForSCID(self, scid):
        if scid==PKEY_ItemNameDisplay:
            guid = CAT_GUID_NAME
        elif scid == PKEY_Sample_AreaSize:
            guid = CAT_GUID_SIZE
        elif scid == PKEY_Sample_NumberOfSides:
            guid = CAT_GUID_SIDES
        elif scid == PKEY_Sample_DirectoryLevel:
            guid = CAT_GUID_LEVEL
        elif scid == pythoncom.IID_NULL:
            # This can be called with a NULL
            # format ID. This will happen if you have a category,
            # not based on a column, that gets stored in the
            # property bag. When a return is made to this item,
            # it will call this function with a NULL format id. 
            guid = CAT_GUID_VALUE
        else:
            raise COMException(hresult=winerror.E_INVALIDARG)
        return guid

    #  Retrieves the name of the specified category. This is where
    #  additional categories that appear under the column
    #  related categories in the UI, get their display names.
项目:Email_My_PC    作者:Jackeriss    | 项目源码 | 文件源码
def GetDefaultCategory(self):
        return CAT_GUID_LEVEL, (pythoncom.IID_NULL, 0)
# end of sample's Category.cpp port

# start of sample's ContextMenu.cpp port
项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def __init__(self, desc_or_id, names=None, doc=None, resultCLSID=pythoncom.IID_NULL, resultDoc = None, hidden=0):
        if type(desc_or_id)==type(0):
            self.dispid = desc_or_id
            self.desc = None
        else:
            self.dispid = desc_or_id[0]
            self.desc = desc_or_id

        self.names = names
        self.doc = doc
        self.resultCLSID = resultCLSID
        self.resultDocumentation = resultDoc
        self.wasProperty = 0 # Have I been transformed into a function so I can pass args?
        self.hidden = hidden
项目:OSPTF    作者:xSploited    | 项目源码 | 文件源码
def GetResultCLSID(self):
        rc = self.resultCLSID
        if rc == pythoncom.IID_NULL: return None
        return rc
    # Return a string, suitable for output - either "'{...}'" or "None"
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def __init__(self, desc_or_id, names=None, doc=None, resultCLSID=pythoncom.IID_NULL, resultDoc = None, hidden=0):
        if type(desc_or_id)==type(0):
            self.dispid = desc_or_id
            self.desc = None
        else:
            self.dispid = desc_or_id[0]
            self.desc = desc_or_id

        self.names = names
        self.doc = doc
        self.resultCLSID = resultCLSID
        self.resultDocumentation = resultDoc
        self.wasProperty = 0 # Have I been transformed into a function so I can pass args?
        self.hidden = hidden
项目:pupy    作者:ru-faraon    | 项目源码 | 文件源码
def GetResultCLSID(self):
        rc = self.resultCLSID
        if rc == pythoncom.IID_NULL: return None
        return rc
    # Return a string, suitable for output - either "'{...}'" or "None"
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetAccessRights(self, objecttype, flags):
        """Returns a tuple of (AccessRights, DefaultAccess), where AccessRights is a sequence of tuples representing
            SI_ACCESS structs, containing (guid, access mask, Name, flags). DefaultAccess indicates which of the
            AccessRights will be used initially when a new ACE is added (zero based).
            Flags can contain SI_ACCESS_SPECIFIC,SI_ACCESS_GENERAL,SI_ACCESS_CONTAINER,SI_ACCESS_PROPERTY,
                  CONTAINER_INHERIT_ACE,INHERIT_ONLY_ACE,OBJECT_INHERIT_ACE
        """
        ## input flags: SI_ADVANCED,SI_EDIT_AUDITS,SI_EDIT_PROPERTIES indicating which property sheet is requesting the rights
        if (objecttype is not None) and (objecttype!=IID_NULL):
            ## Should not be true for file objects.  Usually only used with DS objects that support security for
            ## their properties
            raise NotImplementedError("Object type is not supported")

        if os.path.isdir(self.FileName):
            file_append_data_desc='Create subfolders'
            file_write_data_desc='Create Files'
        else:
            file_append_data_desc='Append data'
            file_write_data_desc='Write data'

        accessrights=[(IID_NULL, FILE_GENERIC_READ, 'Generic read', SI_ACCESS_GENERAL|SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, FILE_GENERIC_WRITE, 'Generic write', SI_ACCESS_GENERAL|SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, win32con.DELETE, 'Delete', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, WRITE_OWNER, 'Change owner', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, READ_CONTROL,'Read Permissions', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, WRITE_DAC, 'Change permissions', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, FILE_APPEND_DATA, file_append_data_desc, SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, FILE_WRITE_DATA, file_write_data_desc, SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE)
                      ]
        return (accessrights, 0)
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetInheritTypes(self):
        """Specifies which types of ACE inheritance are supported.
        Returns a sequence of tuples representing SI_INHERIT_TYPE structs, containing
        (object type guid, inheritance flags, display name).  Guid is usually only used with
        Directory Service objects.
        """
        return ((IID_NULL, 0, 'Only current object'),
                 (IID_NULL, OBJECT_INHERIT_ACE, 'Files inherit permissions'),
                 (IID_NULL, CONTAINER_INHERIT_ACE, 'Sub Folders inherit permissions'),
                 (IID_NULL, CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE, 'Files and subfolders'),
                )
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetObjectInformation(self):
        """Identifies object whose security will be modified, and determines options available
           to the end user"""
        flags=SI_ADVANCED|SI_EDIT_ALL|SI_PAGE_TITLE|SI_RESET
        hinstance=0  ## handle to module containing string resources
        servername=''  ## name of authenticating server if not local machine

        ## service name can contain remote machine name of the form \\Server\ServiceName
        objectname=os.path.split(self.ServiceName)[1]
        pagetitle='Service Permissions for '+self.ServiceName
        objecttype=IID_NULL
        return flags, hinstance, servername, objectname, pagetitle, objecttype
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetAccessRights(self, objecttype, flags):
        """Returns a tuple of (AccessRights, DefaultAccess), where AccessRights is a sequence of tuples representing
            SI_ACCESS structs, containing (guid, access mask, Name, flags). DefaultAccess indicates which of the
            AccessRights will be used initially when a new ACE is added (zero based).
            Flags can contain SI_ACCESS_SPECIFIC,SI_ACCESS_GENERAL,SI_ACCESS_CONTAINER,SI_ACCESS_PROPERTY,
                  CONTAINER_INHERIT_ACE,INHERIT_ONLY_ACE,OBJECT_INHERIT_ACE
        """
        ## input flags: SI_ADVANCED,SI_EDIT_AUDITS,SI_EDIT_PROPERTIES indicating which property sheet is requesting the rights
        if (objecttype is not None) and (objecttype!=IID_NULL):
            ## Not relevent for services
            raise NotImplementedError("Object type is not supported")

        ## ???? for some reason, the DACL for a service will not retain ACCESS_SYSTEM_SECURITY in an ACE ????
        ## (IID_NULL, win32con.ACCESS_SYSTEM_SECURITY, 'View/change audit settings', SI_ACCESS_SPECIFIC),

        accessrights=[
            (IID_NULL, win32service.SERVICE_ALL_ACCESS, 'Full control', SI_ACCESS_GENERAL),
            (IID_NULL, SERVICE_GENERIC_READ, 'Generic read', SI_ACCESS_GENERAL),
            (IID_NULL, SERVICE_GENERIC_WRITE, 'Generic write', SI_ACCESS_GENERAL),
            (IID_NULL, SERVICE_GENERIC_EXECUTE, 'Start/Stop/Pause service', SI_ACCESS_GENERAL),
            (IID_NULL, READ_CONTROL, 'Read Permissions', SI_ACCESS_GENERAL),
            (IID_NULL, WRITE_DAC, 'Change permissions', SI_ACCESS_GENERAL),
            (IID_NULL, WRITE_OWNER, 'Change owner', SI_ACCESS_GENERAL),
            (IID_NULL, win32con.DELETE, 'Delete service', SI_ACCESS_GENERAL),
            (IID_NULL, win32service.SERVICE_START, 'Start service', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_STOP, 'Stop service', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_PAUSE_CONTINUE, 'Pause/unpause service', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_USER_DEFINED_CONTROL, 'Execute user defined operations', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_QUERY_CONFIG, 'Read configuration', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_CHANGE_CONFIG, 'Change configuration', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_ENUMERATE_DEPENDENTS, 'List dependent services', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_QUERY_STATUS, 'Query status', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_INTERROGATE, 'Query status (immediate)', SI_ACCESS_SPECIFIC),
            ]
        return (accessrights, 0)
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetDefaultCategory(self):
        return CAT_GUID_LEVEL, (pythoncom.IID_NULL, 0)
# end of sample's Category.cpp port

# start of sample's ContextMenu.cpp port
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def __init__(self, desc_or_id, names=None, doc=None, resultCLSID=pythoncom.IID_NULL, resultDoc = None, hidden=0):
        if type(desc_or_id)==type(0):
            self.dispid = desc_or_id
            self.desc = None
        else:
            self.dispid = desc_or_id[0]
            self.desc = desc_or_id

        self.names = names
        self.doc = doc
        self.resultCLSID = resultCLSID
        self.resultDocumentation = resultDoc
        self.wasProperty = 0 # Have I been transformed into a function so I can pass args?
        self.hidden = hidden
项目:remoteControlPPT    作者:htwenning    | 项目源码 | 文件源码
def GetResultCLSID(self):
        rc = self.resultCLSID
        if rc == pythoncom.IID_NULL: return None
        return rc
    # Return a string, suitable for output - either "'{...}'" or "None"
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetAccessRights(self, objecttype, flags):
        """Returns a tuple of (AccessRights, DefaultAccess), where AccessRights is a sequence of tuples representing
            SI_ACCESS structs, containing (guid, access mask, Name, flags). DefaultAccess indicates which of the
            AccessRights will be used initially when a new ACE is added (zero based).
            Flags can contain SI_ACCESS_SPECIFIC,SI_ACCESS_GENERAL,SI_ACCESS_CONTAINER,SI_ACCESS_PROPERTY,
                  CONTAINER_INHERIT_ACE,INHERIT_ONLY_ACE,OBJECT_INHERIT_ACE
        """
        ## input flags: SI_ADVANCED,SI_EDIT_AUDITS,SI_EDIT_PROPERTIES indicating which property sheet is requesting the rights
        if (objecttype is not None) and (objecttype!=IID_NULL):
            ## Should not be true for file objects.  Usually only used with DS objects that support security for
            ## their properties
            raise NotImplementedError("Object type is not supported")

        if os.path.isdir(self.FileName):
            file_append_data_desc='Create subfolders'
            file_write_data_desc='Create Files'
        else:
            file_append_data_desc='Append data'
            file_write_data_desc='Write data'

        accessrights=[(IID_NULL, FILE_GENERIC_READ, 'Generic read', SI_ACCESS_GENERAL|SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, FILE_GENERIC_WRITE, 'Generic write', SI_ACCESS_GENERAL|SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, win32con.DELETE, 'Delete', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, WRITE_OWNER, 'Change owner', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, READ_CONTROL,'Read Permissions', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, WRITE_DAC, 'Change permissions', SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, FILE_APPEND_DATA, file_append_data_desc, SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE),
                      (IID_NULL, FILE_WRITE_DATA, file_write_data_desc, SI_ACCESS_SPECIFIC|OBJECT_INHERIT_ACE|CONTAINER_INHERIT_ACE)
                      ]
        return (accessrights, 0)
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetInheritTypes(self):
        """Specifies which types of ACE inheritance are supported.
        Returns a sequence of tuples representing SI_INHERIT_TYPE structs, containing
        (object type guid, inheritance flags, display name).  Guid is usually only used with
        Directory Service objects.
        """
        return ((IID_NULL, 0, 'Only current object'),
                 (IID_NULL, OBJECT_INHERIT_ACE, 'Files inherit permissions'),
                 (IID_NULL, CONTAINER_INHERIT_ACE, 'Sub Folders inherit permissions'),
                 (IID_NULL, CONTAINER_INHERIT_ACE|OBJECT_INHERIT_ACE, 'Files and subfolders'),
                )
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetObjectInformation(self):
        """Identifies object whose security will be modified, and determines options available
           to the end user"""
        flags=SI_ADVANCED|SI_EDIT_ALL|SI_PAGE_TITLE|SI_RESET
        hinstance=0  ## handle to module containing string resources
        servername=''  ## name of authenticating server if not local machine

        ## service name can contain remote machine name of the form \\Server\ServiceName
        objectname=os.path.split(self.ServiceName)[1]
        pagetitle='Service Permissions for '+self.ServiceName
        objecttype=IID_NULL
        return flags, hinstance, servername, objectname, pagetitle, objecttype
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetAccessRights(self, objecttype, flags):
        """Returns a tuple of (AccessRights, DefaultAccess), where AccessRights is a sequence of tuples representing
            SI_ACCESS structs, containing (guid, access mask, Name, flags). DefaultAccess indicates which of the
            AccessRights will be used initially when a new ACE is added (zero based).
            Flags can contain SI_ACCESS_SPECIFIC,SI_ACCESS_GENERAL,SI_ACCESS_CONTAINER,SI_ACCESS_PROPERTY,
                  CONTAINER_INHERIT_ACE,INHERIT_ONLY_ACE,OBJECT_INHERIT_ACE
        """
        ## input flags: SI_ADVANCED,SI_EDIT_AUDITS,SI_EDIT_PROPERTIES indicating which property sheet is requesting the rights
        if (objecttype is not None) and (objecttype!=IID_NULL):
            ## Not relevent for services
            raise NotImplementedError("Object type is not supported")

        ## ???? for some reason, the DACL for a service will not retain ACCESS_SYSTEM_SECURITY in an ACE ????
        ## (IID_NULL, win32con.ACCESS_SYSTEM_SECURITY, 'View/change audit settings', SI_ACCESS_SPECIFIC),

        accessrights=[
            (IID_NULL, win32service.SERVICE_ALL_ACCESS, 'Full control', SI_ACCESS_GENERAL),
            (IID_NULL, SERVICE_GENERIC_READ, 'Generic read', SI_ACCESS_GENERAL),
            (IID_NULL, SERVICE_GENERIC_WRITE, 'Generic write', SI_ACCESS_GENERAL),
            (IID_NULL, SERVICE_GENERIC_EXECUTE, 'Start/Stop/Pause service', SI_ACCESS_GENERAL),
            (IID_NULL, READ_CONTROL, 'Read Permissions', SI_ACCESS_GENERAL),
            (IID_NULL, WRITE_DAC, 'Change permissions', SI_ACCESS_GENERAL),
            (IID_NULL, WRITE_OWNER, 'Change owner', SI_ACCESS_GENERAL),
            (IID_NULL, win32con.DELETE, 'Delete service', SI_ACCESS_GENERAL),
            (IID_NULL, win32service.SERVICE_START, 'Start service', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_STOP, 'Stop service', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_PAUSE_CONTINUE, 'Pause/unpause service', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_USER_DEFINED_CONTROL, 'Execute user defined operations', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_QUERY_CONFIG, 'Read configuration', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_CHANGE_CONFIG, 'Change configuration', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_ENUMERATE_DEPENDENTS, 'List dependent services', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_QUERY_STATUS, 'Query status', SI_ACCESS_SPECIFIC),
            (IID_NULL, win32service.SERVICE_INTERROGATE, 'Query status (immediate)', SI_ACCESS_SPECIFIC),
            ]
        return (accessrights, 0)
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetDefaultCategory(self):
        return CAT_GUID_LEVEL, (pythoncom.IID_NULL, 0)
# end of sample's Category.cpp port

# start of sample's ContextMenu.cpp port
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def __init__(self, desc_or_id, names=None, doc=None, resultCLSID=pythoncom.IID_NULL, resultDoc = None, hidden=0):
        if type(desc_or_id)==type(0):
            self.dispid = desc_or_id
            self.desc = None
        else:
            self.dispid = desc_or_id[0]
            self.desc = desc_or_id

        self.names = names
        self.doc = doc
        self.resultCLSID = resultCLSID
        self.resultDocumentation = resultDoc
        self.wasProperty = 0 # Have I been transformed into a function so I can pass args?
        self.hidden = hidden
项目:CodeReader    作者:jasonrbr    | 项目源码 | 文件源码
def GetResultCLSID(self):
        rc = self.resultCLSID
        if rc == pythoncom.IID_NULL: return None
        return rc
    # Return a string, suitable for output - either "'{...}'" or "None"