6 Data Access Common Functions
This chapter includes the following sections:
6.1 DAInitEx
This function tells the Data Access module to perform any necessary initialization it needs to prepare for document access. This function must be called before the first time the application uses the module to retrieve data from any document. This function supersedes the old DAInit and DAThreadInit functions.
Note:
DAInitEx should only be called once per application, at application startup time. Any number of documents can be opened for access between calls to DAInitEx and DADeInit. If DAInitEx succeeds, DADeInit must be called regardless of any other API calls.
If the ThreadOption parameter is set to something other than DATHREAD_INIT_NOTHREADS, then this function's preparation includes setting up mutex function pointers to prevent threads from clashing in critical sections of the technology's code. The developer must actually code the threads after this function has been called. DAInitEx should be called only once per process and should be called before the developer's application begins the thread.
Note:
Multiple threads are supported for all Windows platforms and the 32-bit versions of Linux x86 and Solaris SPARC. Failed initialization of the threading function will not impair other API calls. If threading isn't initialized or fails, stub functions are called instead of mutex functions.
Prototype
DAERR DAInitEx(VTSHORT ThreadOption, VTDWORD dwFlags);
Parameters
-
ThreadOption: can be one of the following values:
-
DATHREAD_INIT_NOTHREADS: No thread support requested.
-
DATHREAD_INIT_PTHREADS: Support for PTHREADS requested.
-
DATHREAD_INIT_NATIVETHREADS: Support for native threading requested. Supported only on Microsoft Windows platforms and Oracle Solaris.
-
-
dwFlags: can be one or more of the following flags OR-ed together
-
OI_INIT_DEFAULT: Options Load and Save are performed normally
-
OI_INIT_NOSAVEOPTIONS: The options file will not be saved on exit
-
OI_INIT_NOLOADOPTIONS: The options file will not be read during initialization.
-
Return Values
-
DAERR_OK: If the initialization was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.2 DADeInit
This function tells the Data Access module that it will not be asked to read additional documents, so it should perform any cleanup tasks that may be necessary. This function should be called at application shutdown time, and only if the module was successfully initialized with a call to DAInitEx.
Prototype
DAERR DADeInit();
Return Values
-
DAERR_OK: If the de-initialization was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.3 DAOpenDocument
Opens a source file to make it accessible by one or more of the data access technologies. If DAOpenDocument succeeds, DACloseDocument must be called regardless of any other API calls.
For IO types other than IOTYPE_REDIRECT, the subdocument specification may be specified as part of the file's path. This is accomplished by appending a question mark delimiter to the path, followed by the subdocument specification. For example, to specify the third item within the file c:\docs\file.zip, specify the path c:\docs\file.zip?item.3 in the call to DAOpenDocument. DAOpenDocument always attempts to open the specification as a file first. In the unlikely event there is a file with the same name (including the question mark) as a file plus the subdocument specification, that file is opened instead of the archive item.
To take advantage of this feature when providing access to the input file using redirected IO, a subdocument specification must be provided via a response to an IOGetInfo message, IOGETINFO_SUBDOC_SPEC. To specify an item in an archive, first follow the standard redirected IO methods to provide a BASEIO pointer to the archive file itself. To specify an item within the archive, a redirected IO object must respond to the IOGETINFO_SUBDOC_SPEC message by copying to the supplied buffer the subdocument specification of the archive item to be opened. This message is received during the processing of DAOpenDocument.
Prototype
DAERR DAOpenDocument( VTLPHDOC lphDoc, VTDWORD dwSpecType, VTLPVOID pSpec, VTDWORD dwFlags);
Parameters
-
lphDoc: Pointer to a handle that will be filled with a value uniquely identifying the document to data access. The developer uses this handle in subsequent calls to data access to identify this particular source file. This is not an operating system file handle.
-
dwSpecType: Describes the contents of pSpec. Together, dwSpecType and pSpec describe the location of the source file. Must be one of the following values:
-
IOTYPE_ANSIPATH: Windows only. pSpec points to a NULL-terminated full path name using the ANSI character set and FAT 8.3 (Win16) or NTFS (Win32 and Win64) file name conventions.
-
IOTYPE_UNICODEPATH: Windows only. pSpec points to a NULL-terminated full path name using the Unicode character set and NTFS (Win32 and Win64) file name conventions.
-
IOTYPE_UNIXPATH: UNIX platforms only. pSpec points to a NULL-terminated full path name using the system default character set and UNIX path conventions. Unicode paths can be accessed on UNIX platforms by using a UTF-8 encoded path with IOTYPE_UNIXPATH.
-
IOTYPE_REDIRECT: All platforms. pSpec points to a developer-defined struct that allows the developer to redirect the IO routines used to read the file. For more information, see Redirected IO.
-
IOTYPE_ARCHIVEOBJECT: All platforms. Opens an embedded archive object for data access. pSpec points to a structure IOSPECARCHIVEOBJECT (see IOSPECARCHIVEOBJECT Structure for details) that has been filled with values returned in a SCCCA_OBJECT content entry from Content Access.
-
IOTYPE_LINKEDOBJECT: All platforms. Opens an object specified by a linked object for data access. pSpec points to a structure IOSPECLINKEDOBJECT (see IOSPECLINKEDOBJECT Structure) that has been filled with values returned in an SCCCA_BEGINTAG or SCCCA_ENDTAG with a subtype of SCCCA_LINKEDOBJECT content entry from Content Access.
-
-
pSpec: File location specification.
-
dwFlags: The low WORD is the file ID for the document (0 by default). If you set the file ID incorrectly, the technology fails. If set to 0, the file identification technology determines the input file type automatically. The high WORD should be set to 0.
Return Values
-
DAERR_OK: Returned if the open was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.3.1 IOSPECLINKEDOBJECT Structure
Structure used by DAOpenDocument.
Prototype
typedef struct IOSPECLINKEDOBJECTtag { VTDWORD dwStructSize; VTSYSPARAM hDoc; VTDWORD dwObjectId; /* Object identifier. */ VTDWORD dwType; /* Linked Object type */ /* (SO_LOCATORTYPE_*) */ VTDWORD dwParam1; /* parameter for DoSpecial call */ VTDWORD dwParam2; /* parameter for DoSpecial call */ VTDWORD dwReserved1; /* Reserved. */ VTDWORD dwReserved2; /* Reserved. */ } IOSPECLINKEDOBJECT, * PIOSPECLINKEDOBJECT;
6.3.2 IOSPECARCHIVEOBJECT Structure
Structure used by DAOpenDocument.
Prototype
typedef struct IOSPECARCHIVEOBJECTtag { VTDWORD dwStructSize; VTDWORD hDoc; /* Parent Doc hDoc */ VTDWORD dwNodeId; /* Node ID */ VTDWORD dwStreamId; VTDWORD dwReserved1; /* Must always be 0 */ VTDWORD dwReserved2; /* Must always be 0 */ } IOSPECARCHIVEOBJECT, * PIOSPECARCHIVEOBJECT;
6.4 DACloseDocument
This function is called to close a file opened by the reader that has not encountered a fatal error.
Prototype
DAERR DACloseDocument( VTHDOC hDoc);
Parameters
-
hDoc: Identifier of open document. Must be a handle returned by the DAOpenDocument function.
Return Value
-
DAERR_OK: Returned if close succeeded. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.5 DARetrieveDocHandle
This function returns the document handle associated with any type of Data Access handle. This allows the developer to only keep the value of hItem, instead of both hItem and hDoc.
Prototype
DAERR DARetrieveDocHandle( VTHDOC hItem, VTLPHDOC phDoc);
Parameters
-
hItem: Identifier of open document. May be the subhandle returned by the DAOpenDocument or DAOpenTreeRecord functions in the data access submodule. Passing in an hDoc created by DAOpenDocument for this parameter results in an error.
-
phDoc: Pointer to a handle to be filled with the document handle associated with the passed subhandle.
Return Value
-
DAERR_OK: Returned if the handle in phDoc is valid. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.6 DASetOption
This function is called to set the value of a data access option.
Prototype
DAERR DASetOption( VTHDOC hDoc, VTDWORD dwOptionId, VTLPVOID pValue, VTDWORD dwValueSize);
Parameters
-
hDoc: Identifier of open document. May be a VTHDOC returned by the DAOpenDocument function, or the subhandle returned by the DAOpenDocument or DAOpenTreeRecord functions (VTHCONTENT, VTHTEXT, etc.). Setting an option for a VTHDOC affects all subhandles opened under it, while setting an option for a subhandle affects only that handle.
If this parameter is NULL, then setting the option affects all documents opened thereafter. Once an option is set using the NULL handle, this option becomes the default option thereafter. This parameter should only be set to NULL if the option being set can take that value.
-
dwOptionId: The identifier of the option to be set.
-
pValue: Pointer to a buffer containing the value of the option.
-
dwValueSize: The size in bytes of the data pointed to by pValue. For a string value, the NULL terminator should be included when calculating dwValueSize.
Return Value
-
DAERR_OK: Returned if DASetOption succeeded. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.7 DAGetOption
This function is called to retrieve the value of a data access option. The results of a call to this option are only valid if DASetOption has already been called on the option.
Prototype
DAERR DAGetOption( VTHDOC hItem, VTDWORD dwOptionId, VTLPVOID pValue, VTLPDWORD pSize);
Parameters
-
hItem: Identifier of open document. May be a VTHDOC returned by the DAOpenDocument function, or the subhandle returned by the DAOpenDocument or DAOpenTreeRecord functions (VTHCONTENT, VTHTEXT, etc.). Getting an option for a VTHDOC gets the value of that option for that handle, which may be different than the subhandle's value.
-
dwOptionId: The identifier of the option to be returned.
-
pValue: Pointer to a buffer containing the value of the option.
-
pSize: This VTDWORD should be initialized by the caller to the size of the buffer pointed to by pValue. If this size is sufficient, the option value is copied into pValue and pSize is set to the actual size of the option value. If the size is not sufficient, pSize is set to the size of the buffer needed for the option and an error is returned.
Return Value
-
DAERR_OK: Returned if DAGetOption was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.8 DAGetFileId
This function allows the developer to retrieve the format of the file based on the technology's content-based file identification process. This can be used to make intelligent decisions about how to process the file and to give the user feedback about the format of the file they are working with.
Note: In cases where File ID returns a value of FI_UNKNOWN, this function will apply the Fallback Format before returning a result.
Prototype
DAERR DAGetFileId( VTHDOC hDoc, VTLPDWORD pdwFileId);
Parameters
-
hDoc: Identifier of open document. May be a VTHDOC returned by the DAOpenDocument function, a VTHEXPORT returned by the EXOpenExport function, or the subhandle returned by the DAOpenDocument or DAOpenTreeRecord functions (VTHEXPORT, VTHCONTENT, VTHTEXT, etc.).
-
pdwFileId: Pointer to a DWORD that receives a file identification number for the file. These numbers are defined in sccfi.h.
Return Value
-
DAERR_OK: Returned if DAGetFileId was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.9 DAGetFileIdEx
This function allows the developer to retrieve the format of the file based on the technology's content-based file identification process. This can be used to make intelligent decisions about how to process the file and to give the user feedback about the format of the file they are working with. This function has all the functionality of DAGetFileID and adds the ability to return the raw FI value; in other words, the value returned by normal FI, without applying the FallbackFI setting.
Prototype
DAERR DAGetFileIdEx( VTHDOC hDoc, VTLPDWORD pdwFileId, VTDWORD dwFlags);
Parameters
-
hDoc: Identifier of open document. May be a VTHDOC returned by the DAOpenDocument function, or the subhandle returned by the DAOpenDocument or DAOpenTreeRecord functions (VTHEXPORT, VTHCONTENT, VTHTEXT, etc.).
-
pdwFileId: Pointer to a DWORD that receives a file identification number for the file. These numbers are defined in sccfi.h.
-
dwFlags: DWORD that allows user to request specific behavior.
-
DA_FILEINFO_RAWFI: This flag tells DAGetFileIdEx() to return the result of the File Identification operation before Extended File Ident. is performed and without applying the FallbackFI value.
-
Return Value
-
DAERR_OK: Returned if DAGetFileIdEx was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned. See the following tables for examples of expected output depending on the value of various options.
Values with RAWFI turned off
Input file type | ExtendedFI | FallbackID | DAGetFileId | DAGetFileIdEx |
---|---|---|---|---|
true binary |
off |
fallback value |
fallback value |
fallback value |
true binary |
on |
fallback value |
fallback value |
fallback value |
true text |
off |
fallback value |
fallback value |
fallback value |
true text |
on |
fallback value |
40XX |
40XX |
Values with RAWFI turned on
Input file type | ExtendedFI | FallbackID | DAGetFileId | DAGetFileIdEx |
---|---|---|---|---|
true binary |
off |
fallback value |
fallback value |
1999 |
true binary |
on |
fallback value |
fallback value |
1999 |
true text |
off |
fallback value |
fallback value |
1999 |
true text |
on |
fallback value |
40XX |
1999 |
6.10 DAGetErrorString
This function returns to the developer a string describing the input error code. If the error string returned does not fit the buffer provided, it is truncated.
VTVOID DAGetErrorString( DAERR deError, VTLPVOID pBuffer, VTDWORD dwBufSize);
Parameters
-
Error: Error code passed in by the developer for which an error message is to be returned.
-
pBuffer: This buffer is allocated by the caller and is filled in with the error message by this routine. The error message will be a NULL-terminated string.
-
dwBufSize: Size of what pBuffer points to in bytes.
Return Value
-
none
6.11 DAGetTreeCount
This function is called to retrieve the number of records in an archive file.
DAERR DAGetTreeCount( VTHDOC hDoc, VTLPDWORD lpRecordCount);
Parameters
-
hDoc: Identifier of open document. May be a VTHDOC returned by the DAOpenDocument function, or the subhandle returned by any of the DAOpenDocument or DAOpenTreeRecord functions (VTHCONTENT, VTHTEXT, etc.).
-
lpRecordCount: A pointer to a VTLPDWORD that is filled with the number of stored archive records.
Return Value
-
DAERR_OK: DAGetTreeCount was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
-
DAERR_BADPARAM: The selected file does not contain an archive section, or the requested record does not exist.
6.12 DAGetTreeRecord
This function is called to retrieve information about a record in an archive file.
DAERR DAGetTreeRecord( VTHDOC hDoc, PSCCDATREENODE pTreeNode);
Parameters
-
hDoc: Identifier of open document. May be a VTHDOC returned by the DAOpenDocument function, or the subhandle by any of the DAOpenDocument or DAOpenTreeRecord functions (VTHCONTENT, VTHTEXT, etc.).
-
pTreeNode: A pointer to a PSCCDATREENODE structure that is filled with information about the selected record.
Return Values
-
DAERR_OK: DAGetTreeRecord was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
-
DAERR_BADPARAM: The selected file does not contain an archive section, or the requested record does not exist.
-
DAERR_EMPTYFILE: Empty file.
-
DAERR_PROTECTEDFILE: Password protected or encrypted file.
-
DAERR_SUPFILEOPENFAILS: Supplementary file open failed.
-
DAERR_FILTERNOTAVAIL: The file's type is known, but the appropriate filter is not available.
-
DAERR_FILTERLOADFAILED: An error occurred during the initialization of the appropriate filter.
6.12.1 SCCDATREENODE Structure
This structure is passed by the OEM through the DAGetTreeRecord function. The structure is defined in sccda as follows:
typedef struct SCCDATREENODEtag{ VTDWORD dwSize; VTDWORD dwNode; VTBYTE szName[1024]; VTDWORD dwFileSize; VTDWORD dwTime; VTDWORD dwFlags; VTDWORD dwCharSet; } SCCDATREENODE, *PSCCDATREENODE;
Parameters
-
dwSize: Must be set by the OEM to sizeof(SCCDATREENODE).
-
dwNode: The number of the record for which information is being retrieved. The first node is node 0.
-
szName: A buffer to hold the name of the record.
-
dwFileSize: Returns the file size, in bytes, of the requested record.
-
dwTime: Returns the timestamp of the requested record, in MS‐DOS time.
-
dwFlags: Returns additional information about the node. It can be a combination of the following:
-
SCCDA_TREENODEFLAG_FOLDER: Indicating that the selected node is a folder and not a file.
-
SCCDA_TREENODEFLAG_SELECTED: Indicating that the node is selected.
-
SCCDA_TREENODEFLAG_FOCUS: Indicating that the node has focus.
-
SCCDA_TREENODEFLAG_ENCRYPT: Indicating that the node is encrypted and can not be decrypted.
-
SCCDA_TREENODEFLAG_ARCKNOWNENCRYPT: indicating that the node is encrypted with an unknown encryption and can not be decrypted.
-
SCCDA_TREENODEFLAG_BUFFEROVERFLOW: the name of the node was too long for the szName field.
-
-
dwCharSet: Returns the SO_* (charsets.h) character set of the characters in szName. The output character set is either the default native environment character set or Unicode if the SCCOPT_SYSTEMFLAGS option is set to SCCVW_SYSTEM_UNICODE.
6.13 DAOpenTreeRecord
This function is called to open a record within an archive file and make it accessible by one or more of the data access technologies.
Search Export Only: Search Export's default behavior is to automatically open and process the contents of an archive. Use DAOpenTreeRecord and SCCOPT_XML_SEARCHML_FLAGS to change the default behavior if discrete processing of each document in an archive is desired.
DAERR DAOpenTreeRecord( VTHDOC hDoc, VTLPHDOC lphDoc, VTDWORD dwRecord);
lphDoc is not a file handle.
Parameters
-
hDoc: Identifier of open document. May be a VTHDOC returned by the DAOpenDocument function, or the subhandle returned by the DAOpenDocument or DAOpenTreeRecord functions (VTHCONTENT, VTHTEXT, etc.).
-
lphDoc: Pointer to a handle that is filled with a value uniquely identifying the document to data access. The developer uses this handle in subsequent calls to data access to identify this particular document.
-
dwRecord: The record in the archive file to be opened.
Return Value
-
DAERR_OK: Returned if DAOpenTreeRecord was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.14 DASaveTreeRecord
This function is called to extract a record in an archive file to disk.
DAERR DASaveTreeRecord( VTHDOC hDoc, VTDWORD dwRecord, VTDWORD dwSpecType, VTLPVOID pSpec, VTDWORD dwFlags);
Parameters
-
hDoc: Handle that uniquely identifies the document to data access. This is not an operating system file handle.
-
dwRecord: The record in the archive file to be extracted.
-
dwSpecType: Describes the contents of pSpec. Together, dwSpecType and pSpec describe the location of the source file to which the file will be extracted. Must be one of the following values:
-
IOTYPE_ANSIPATH: Windows only. pSpec points to a NULL-terminated full path name using the ANSI character set and FAT 8.3 (Win16) or NTFS (Win32 and Win64) filename conventions.
-
IOTYPE_REDIRECT: Specifies that redirected I/O will be used to save the file.
-
IOTYPE_UNICODEPATH: Windows only. pSpec points to a NULL-terminated full path name using the Unicode character set and NTFS (Win32 and Win64) file name conventions.
-
IOTYPE_UNIXPATH: X Windows on UNIX platforms only. pSpec points to a NULL-terminated full path name using the system default character set and UNIX path conventions. Unicode paths can be accessed on UNIX platforms by using a UTF-8 encoded path with IOTYPE_UNIXPATH.
-
-
pSpec: File location specification. See the descriptions for individual dwSpecType values.
-
dwFlags: Currently not used. Should be set to 0.
Return Values
-
DAERR_OK: Returned if the save was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
-
DAERR_UNSUPPORTEDCOMP: Unsupported Compression Encountered.
-
DAERR_PROTECTEDFILE: The file is encrypted.
-
DAERR_BADPARAM: The request option is invalid. The record is possibly a directory.
Currently, only extracting a single file is supported. There is a known limitation where files in a Microsoft Binder file cannot be extracted.
6.15 DACloseTreeRecord
This function is called to close an open record file handle.
Search Export Only: Search Export's default behavior is to automatically open and process the contents of an archive. Use DACloseTreeRecord and SCCOPT_XML_SEARCHML_FLAGS to change the default behavior if discrete processing of each document in an archive is desired.
DAERR DACloseTreeRecord( VTHDOC hDoc);
Parameters
-
hDoc: Identifier of open record document.
Return Value
-
DAERR_OK: Returned if DACloseTreeRecord was successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.16 DASetStatCallback
This function sets up a callback that the technology periodically calls to verify the file is still being processed. The customer can use this with a monitoring process to help identify files that may be hung. Because this function is called more frequently than other callbacks, it is implemented as a separate function.
Use of the Status Callback Function
An application's status callback function will be called periodically by Oracle Outside In to provide a status message. Currently, the only status message defined is OIT_STATUS_WORKING, which provides a "sign of life" that can be used during unusually long processing operations to verify that Oracle Outside In has not stopped working. If the application decides that it would not like to continue processing the current document, it may use the return value from this function to tell Oracle Outside In to abort.
The status callback function has two return values defined:
-
OIT_STATUS_CONTINUE: Tells Oracle Outside In to continue processing the current document.
-
OIT_STATUS_ABORT: Tells Oracle Outside In to stop processing the current document.
The following is an example of a minimal status callback function.
VTDWORD MyStatusCallback( VTHANDLE hUnique, VTDWORD dwID, VTSYSVAL pCallbackData, VTSYSVAL pAppData) { if(dwID == OIT_STATUS_WORKING) { if( checkNeedToAbort( pAppData ) ) return (OIT_STATUS_ABORT); } return (OIT_STATUS_CONTINUE); }
Prototype
DAERR DASetStatCallback(DASTATCALLBACKFN pCallback, VTHANDLE hUnique, VTLPVOID pAppData)
Parameters
-
pCallback: Pointer to the callback function.
-
hUnique: Handle that may either be an hDoc or an hExport.
-
pAppData: User-defined data. Oracle Outside In never uses this value other than to provide it to the callback function.
The callback function should be of type DASTATCALLBACKFN. This function has the following signature:
(VTHANDLE hUnique, VTDWORD dwID, VTSYSVAL pCallbackData, VTSYSVAL pAppData)
-
hUnique: Handle that may either be an hDoc or an hExport
-
dwID: Handle that indicates the callback status.
-
OIT_STATUS_WORKING
-
OIT_STATUS_CONTINUE
-
OIT_STATUS_CANCEL
-
OIT_STATUS_ABORT
-
-
pCallbackData: Currently always NULL
-
pAppData: User-defined data provided to DASetStatCallback
Return Values
-
DAERR_OK: If successful. Otherwise, one of the other DAERR_ values in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
6.17 DASetFileAccessCallback
This function sets up a callback that the technology will call into to request information required to open an input file. This information may be the password of the file or a support file location.
Use of the File Access Callback
When the technology encounters a file that requires additional information to access its contents, the application's callback function will be called for this information. Currently, only two different forms of information will be requested: the password of a document, or the file used by Lotus Notes to authenticate the user information.
The status callback function has two return values defined:
-
SCCERR_OK: Tells Oracle Outside In that the requested information is provided.
-
SCCERR_CANCEL: Tells Oracle Outside In that the requested information is not available.
This function will be repeatedly called if the information provided is not valid (such as the wrong password). It is the responsibility of the application to provide the correct information or return SCCERR_CANCEL.
Prototype
DAERR DASetFileAccessCallback (DAFILEACCESSCALLBACKFN pCallback);
Parameters
-
pCallback: Pointer to the callback function.
Return Values
-
DAERR_OK: If successful. Otherwise, one of the other DAERR_ values defined in sccda.h or one of the SCCERR_ values in sccerr.h is returned.
The callback function should be of type DAFILEACCESSCALLBACKFN. This function has the following signature:
typedef VTDWORD (* DAFILEACCESSCALLBACKFN)(VTDWORD dwID, VTSYSVAL pRequestData, VTSYSVAL pReturnData, VTDWORD dwReturnDataSize);
-
dwID: ID of information requested:
-
OIT_FILEACCESS_PASSWORD: Requesting the password of the file
-
OIT_FILEACCESS_NOTESID: Requesting the Notes ID file location
-
-
pRequestData: Information about the file.
typedef struct { VTDWORD dwSize; /* size of this structure */ VTWORD wFIId; /* FI id of reference file */ VTDWORD dwSpecType; /* file spec type */ VTVOID *pSpec; /* pointer to a file spec */ VTDWORD dwRootSpecType; /* root file spec type */ VTVOID *pRootSpec; /* pointer to the root file spec */ VTDWORD dwAttemptNumber; /* The number of times the callback has */ /* already been called for the currently */ /* requested item of information */ } IOREQUESTDATA, * PIOREQUESTDATA;
-
pReturnData: Pointer to the buffer to hold the requested information – for OIT_FILEACCESS_PASSWORD and OIT_FILEACCESS_NOTESID, the buffer is an array of WORD characters.
-
dwReturnDataSize: Size of the return buffer.
Note:
Not all formats that use passwords are supported. DASetFileAccessCallback applies to filters that support password protected files. Check filter for any or all calls to UTGetFileAccess in filters and core modules.
Only Microsoft Office binary (97-2003), Microsoft Office 2010-2013, Microsoft Outlook PST 97-2016, Lotus NSF, PDF (with RC4 encryption), and 7zip (with AES 128 & 256 bit, ZipCrypto) are currently supported.
Passwords for PST/OST files must be in the Windows single-byte character set. For example, Cyrillic characters should use the 1252 character set. For PST/OST files, Unicode password characters are not supported.
6.18 DAOpenSubdocumentById
This function allows the caller to open subdocuments (for example, attachments within an email message file) for exporting as separate files.
DAERR DAOpenSubdocumentById( VTHDOC hDoc, VTLPHDOC phDoc, VTDWORD dwSubdocId, VTDWORD dwIdType )
-
hDoc: Handle to a currently open document, obtained via DAOpenDocument .
-
phDoc: Points to a VTHDOC value to be set by this function upon success.
-
dwSubdocId: An identifier of the subdocument to be opened.
-
dwIdType: A value that describes which type of identifier is specified by dwSubdocId Must be one of the following:
-
DASUBDOCID_ATTACHMENTINDEX: dwSubdocId is the zero-based index of the an attachment from an email message file. The first attachment presented by Outside has the index value 0, the second has the index value 1, etc.
-
DASUBDOCID_XX: dwSubdocId is a value provided by the output of XML Export. It is the value of the object_id attribute of a locator element.
-
Return Values
Returns DAERR_OK on success, or an appropriate error value if an error occurred.
6.19 DAAddOptionItem
This function adds a new item to the end of the list of items associated with a mult-value option. The value of the item id is determined internally by the Outside In code, and will not change for the lifetime of the option item.If the caller is not interested in the value of the itemId, calling DASetOption multiple times is equivalent to calling DAAddOptionItem with the pItemId set to NULL. (This only applies to options whose values may be set through DAAddOptionItem).
SCCERR DAAddOptionItem (VTHDOC hDoc, DWORD dwOptionId, VTLPVOID pValue, VTDWORD dwSize, VTLPDWORD pItemId )
-
hDoc: Handle to current document, as described in documentation of DASetOption.
-
dwOptionId: The option id of an option that requires a list of values.
-
pValue: Pointer to the value of the option item being added.
-
dwSize: Size of the data pointed to by pValue.
-
pItemId: Points to a DWORD that will receive the value of an internal identifier of the item. This identifer may be used in subsequent calls to DARemoveOptionItem. This parameter may be NULL if the caller is not interested in the id.
6.20 DAGetOptionItem
The item id value provided by this function is the same one provided by DAAddOptionItem when the item was first added. This function should not be called simultaneously for the same hDoc from two different threads.
SCCERR DAGetOptionItem( VTHDOC hDoc, DWORD dwOptionId, DWORD dwWhichItem, VTLPVOID pValue, VTLPDWORD pSize, VTLPDWORD pItemId )
-
hDoc: Handle to current document, as described in documentation of DAGetOption.
-
dwOptionId: The option id of an option whose item values are being requested.
-
dwWhichItem: Must be one of the following:
-
SCCOPT_FIRSTITEM - which retrieves the first item in the specified list.
-
SCCOPT_NEXTITEM - which retrieves the next item in the specified list.
-
SCCOPT_ITEMSIZE - which does not retrieve an item, but sets *pSize to the necessary buffer size for an item of the specified list. (If the list items vary in size, it will indicate the size of the largest item.)
-
.SCCOPT_LISTSIZE - which does not retrieve an item, but sets *pSize to the count of all items in the specified list
-
-
pValue: Pointer to a buffer that will receive the requested item's value.
-
pSize: Size of the buffer pointed to by pValue. If this size isn't sufficient to receive the requested data, the function will set the value pointed to by pSize to the size required to hold the item's data, return SCCERR_INSUFFICIENTBUFFER.
-
pItemId: Points to a DWORD that will receive the value of an internal identifier of the item. This identifer may be used in subsequent calls to DARemoveOptionItem. This parameter may be NULL if the caller is not interested in the id.
6.21 DARemoveOptionItem
This function should not be called simultaneously for the same hDoc from two different threads.
SCCERR DARemoveOptionItem( VTHDOC hDoc, DWORD dwOptionsId, DWORD dwItemId )
-
hDoc: Handle to current document, as described in documentation of DASetOption.
-
dwOptionsId: The option id of an option that requires a list of values.
-
dwItemId: An identifier to an option id, provided by either DAAddOptionItem or DAGetOptionItem, or SCCOPT_ALLITEMS. If SCCOPT_ALLITEMS is specified, all of the items associated with the specified option id will be removed.
Note:
This function should not be called simultaneously for the same hDoc from two different threads.