3.2.4.2.45.19 CreateModuleDefinition (Opnum 25)

The CreateModuleDefinition method is used to create a new Non-Persisted Module Definition Instance (section 3.2.1.6.2.2) of a specified module type and returns S_OK upon successful completion.

 [id(FSRM_DISPID_CLASSIFICATION_MANAGER | 0x08)] HRESULT CreateModuleDefinition(
   [in] FsrmPipelineModuleType moduleType,
   [out, retval] IFsrmPipelineModuleDefinition** moduleDefinition
 );

moduleType: Contains the type of module to create (for example, a classifier or storage module). For possible types, see the FsrmPipelineModuleType (section 2.2.1.2.12) enumeration.

moduleDefinition: An IFsrmPipelineModuleDefinition interface pointer (section 3.2.4.2.43) to the new module definition. Query the IFsrmPipelineModuleDefinition interface to get the interface for the specified module. To add the module definition to the server's List of Persisted Module Definitions (section 3.2.1.6), the client MUST call Commit (section 3.2.4.2.10.5).

Return Values: The method MUST return zero on success, or an error code on failure.

Return value/code

Description

0x80070057

E_INVALIDARG

The moduleType parameter is not a valid FsrmPipelineModuleType (section 2.2.1.2.12) value.

Upon receiving this message, the server MUST validate parameters:

  • Verify that moduleType contains a valid FsrmPipelineModuleType value. If moduleType is FsrmPipelineModuleType_Unknown, the parameter MUST be considered an invalid value.

If any validation fails, the server MUST terminate processing and return a nonzero error code.

Upon successful validation of parameters, the server MUST perform the following actions.

  • Create a new Non-Persisted Module Definition Instance (section 3.2.1.6.2.2) of the specified module type.

    • Set FSRM Base Object.Id to a GUID.

    • Set FSRM Base Object.Description to an empty string.

    • Set FSRM Base Object.Deleted to false.

    • Set ModuleClsid to an empty string.

    • Set Module Definition.Name to an empty string.

    • Set Company to an empty string.

    • Set Version to an empty string.

    • Set Enabled/disabled to enabled.

    • Set Needs file content to false.

    • Set Module Definition.Account to FsrmAccountType_LocalService.

    • Set Supported extensions to an empty list.

    • Set Module Definition.Parameters to an empty list.

    • Set Module type to moduleType.

    • If Module type is FsrmPipelineModuleType_Classifier, the following elements MUST be set:

      • Set Properties affected to an empty list.

      • Set Properties used to an empty list.

      • Set Needs explicit value to true.

    • If Module type is FsrmPipelineModuleType_Storage, the following elements MUST be set:

      • Set Capabilities to FsrmStorageModuleCaps_Unknown.

      • Set Storage type to FsrmStorageModuleType_Unknown.

      • Set Updates file contents to false.

  • Set moduleDefinition to the IFsrmPipelineModuleDefinition interface pointer for the newly created Non-Persisted Module Definition Instance.