3.3.4.3 Export (Opnum 36)

The Export method exports a section of the metabase to a file.

 HRESULT Export(
   [unique, in, string] LPCWSTR pszPasswd,
   [unique, in, string] LPCWSTR pszFileName,
   [unique, in, string] LPCWSTR pszSourcePath,
   [in] DWORD dwMDFlags
 );

pszPasswd: A pointer to a Unicode string containing the password that will be used to encrypt any secure properties being exported.

pszFileName: A pointer to a Unicode string containing the name of the file, including the directory path, to which the data will be exported. The path MUST exist and be local to the server.

pszSourcePath: A pointer to a Unicode string containing the path to the metabase node to be exported.

dwMDFlags: A set of bit flags specifying the export operation to be performed. It can be zero or one or more of the following values.

Value

Meaning

MD_EXPORT_INHERITED

0x00000001

Settings inherited from the parent nodes will be included in the export.

MD_EXPORT_NODE_ONLY

0x00000002

Child nodes will not be exported.

Return Values: A signed 32-bit value that indicates return status. If the method returns a negative value, it failed. If the 12-bit facility code (bits 16–27) is set to 0x007, the value contains a Win32 error code in the lower 16 bits. Zero or positive values indicate success, with the lower 16 bits in positive nonzero values containing warnings or flags defined in the method implementation. For more information about Win32 error codes and HRESULT values, see [MS-ERREF].

Return value/code

Description

0x00000000

S_OK

The call was successful.

0x80070003

ERROR_PATH_NOT_FOUND

The system cannot find the path specified.

0x80070032

ERROR_NOT_SUPPORTED

The request is not supported.

Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying RPC protocol [MS-RPCE].

The opnum field value for this method is 36.

When processing this call, the server MUST do the following:

  • If the path passed in the pszFileName parameter does not exist or is not a path local to the server, return ERROR_PATH_NOT_FOUND.

  • The server SHOULD validate that the source path provided maps to a node in the data hierarchy. If it does not, return ERROR_PATH_NOT_FOUND.<23>

  • If the MD_EXPORT_INHERITED flag is passed, the server MUST include inherited property values in the exported data.

  • If the MD_EXPORT_NODE_ONLY flag is passed, the server MUST include only the specified node and its settings. Child nodes MUST NOT be included.

  • Any encrypted data MUST be stored as encrypted with the password that was provided by the client.