| 1 | #pragma once |
| 2 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. |
| 3 | |
| 4 | |
| 5 | #include <sys\stat.h> |
| 6 | #include <fdi.h> |
| 7 | |
| 8 | #ifdef __cplusplus |
| 9 | extern "C" { |
| 10 | #endif |
| 11 | |
| 12 | // defines |
| 13 | #define FILETABLESIZE 40 |
| 14 | |
| 15 | // structs |
| 16 | struct MEM_FILE |
| 17 | { |
| 18 | LPCBYTE vpStart; |
| 19 | UINT uiCurrent; |
| 20 | UINT uiLength; |
| 21 | }; |
| 22 | |
| 23 | typedef enum FAKE_FILE_TYPE { NORMAL_FILE, MEMORY_FILE } FAKE_FILE_TYPE; |
| 24 | |
| 25 | typedef HRESULT (*REX_CALLBACK_PROGRESS)(BOOL fBeginFile, LPCWSTR wzFileId, LPVOID pvContext); |
| 26 | typedef VOID (*REX_CALLBACK_WRITE)(UINT cb); |
| 27 | |
| 28 | |
| 29 | struct FAKE_FILE // used __in internal file table |
| 30 | { |
| 31 | BOOL fUsed; |
| 32 | FAKE_FILE_TYPE fftType; |
| 33 | MEM_FILE mfFile; // State for memory file |
| 34 | HANDLE hFile; // Handle for disk file |
| 35 | }; |
| 36 | |
| 37 | // functions |
| 38 | HRESULT RexInitialize(); |
| 39 | void RexUninitialize(); |
| 40 | |
| 41 | HRESULT RexExtract( |
| 42 | __in_z LPCSTR szResource, |
| 43 | __in_z LPCWSTR wzExtractId, |
| 44 | __in_z LPCWSTR wzExtractDir, |
| 45 | __in_z LPCWSTR wzExtractName, |
| 46 | __in REX_CALLBACK_PROGRESS pfnProgress, |
| 47 | __in REX_CALLBACK_WRITE pfnWrite, |
| 48 | __in LPVOID pvContext |
| 49 | ); |
| 50 | |
| 51 | #ifdef __cplusplus |
| 52 | } |
| 53 | #endif |
| 54 |