L_GetDecryptOptions (original) (raw)
Summary
Gets the file options used by LEADTOOLS when loading encrypted files.
Syntax
#include "l_bitmap.h"
L_LTFIL_API L_INT EXT_FUNCTION L_GetDecryptOptions(pOptions, uStructSize)
Parameters
pFILEDECRYPTOPTIONS pOptions
Pointer to a structure to be updated with the options used when loading encrypted files.
L_UINT uStructSize
Size of the structure pointed to by pOptions
. Use sizeof(FILEDECRYPTOPTIONS) to calculate this value.
Returns
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes . |
Comments
The options obtained by this function are valid for the current thread.
These settings are used for loading all encrypted files (DOC, DOCX, PDF, PPT, PPTX, XLS, XLSX, XLSB, etc). L_GetPDFOptions can also be used to check an additional password used only for PDF files.
To change the current options, change the values in the FILEDECRYPTOPTIONS structure and call L_SetDecryptOptions. Again, this will change the values only for the current thread.
FILEDECRYPTOPTIONS.pszPassword points to the internal buffer used by LEADTOOLS for decrypting files. You should not attempt to free this pointer and assume this pointer is valid. It is only valid until the next call to L_SetDecryptOptions. If you need to use this pointer for extended amount of time, you should make a copy of it.
For example, if you wish to get a copy of this structure and use it to initialize any worker threads, then try the following:
- Call 'L_GetDecryptOptions'
- If
FILEDECRYPTOPTIONS.pszPassword
is not NULL, then setFILEDECRYPTOPTIONS.pszPassword = _tcsdup(FILEDECRYPTOPTIONS.pszPassword)
. - Save FILEDECRYPTOPTIONS to a global variable.
- At the start of each worker thread, call L_SetDecryptOptions with this global FILEDECRYPTOPTIONS.
- Before the application exists, free FILEDECRYPTOPTIONS.pszPassword.
Required DLLs and Libraries
- LTFIL
- File format DLLs
- For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.
Platforms
Win32, x64.
See Also
Functions
Topics
Example
For an example, refer to FILEDECRYPTCALLBACK.
LEADTOOLS Raster Imaging C API Help