00001 #ifndef __RAPIWRAP_H_
00002 #define __RAPIWRAP_H_
00003
00017 #ifdef _WIN32
00018 # include <shlobj.h>
00019 #endif
00020
00021 #ifdef RAPI_SDK
00022 # include <rapi.h>
00023 #else
00024 # ifdef _WIN32
00025 # include <windows.h>
00026 # else
00027 # include <synce.h>
00028 # endif
00029
00030 #ifndef FILE_ATTRIBUTE_READONLY
00031 #define FILE_ATTRIBUTE_READONLY 0x00000001
00032 #endif
00033 #ifndef FILE_ATTRIBUTE_HIDDEN
00034 #define FILE_ATTRIBUTE_HIDDEN 0x00000002
00035 #endif
00036 #ifndef FILE_ATTRIBUTE_SYSTEM
00037 #define FILE_ATTRIBUTE_SYSTEM 0x00000004
00038 #endif
00039 #ifndef FILE_ATTRIBUTE_DIRECTORY
00040 #define FILE_ATTRIBUTE_DIRECTORY 0x00000010
00041 #endif
00042 #ifndef FILE_ATTRIBUTE_ARCHIVE
00043 #define FILE_ATTRIBUTE_ARCHIVE 0x00000020
00044 #endif
00045 #ifndef FILE_ATTRIBUTE_INROM
00046 #define FILE_ATTRIBUTE_INROM 0x00000040
00047 #endif
00048 #ifndef FILE_ATTRIBUTE_NORMAL
00049 #define FILE_ATTRIBUTE_NORMAL 0x00000080
00050 #endif
00051 #ifndef FILE_ATTRIBUTE_TEMPORARY
00052 #define FILE_ATTRIBUTE_TEMPORARY 0x00000100
00053 #endif
00054 #ifndef FILE_ATTRIBUTE_COMPRESSED
00055 #define FILE_ATTRIBUTE_COMPRESSED 0x00000800
00056 #endif
00057 #ifndef FILE_ATTRIBUTE_HAS_CHILDREN
00058 #define FILE_ATTRIBUTE_HAS_CHILDREN 0x00010000
00059 #endif
00060
00061 #ifndef CREATE_ALWAYS
00062 #define CREATE_ALWAYS 2
00063 #endif
00064 #ifndef OPEN_EXISTING
00065 #define OPEN_EXISTING 3
00066 #endif
00067 #ifndef GENERIC_WRITE
00068 #define GENERIC_WRITE 0x40000000
00069 #endif
00070 #ifndef GENERIC_READ
00071 #define GENERIC_READ 0x80000000
00072 #endif
00073
00074 #ifndef CSIDL_PROGRAMS
00075 #define CSIDL_PROGRAMS 0x0002
00076 #endif
00077 #ifndef CSIDL_PERSONAL
00078 #define CSIDL_PERSONAL 0x0005
00079 #endif
00080 #ifndef CSIDL_STARTUP
00081 #define CSIDL_STARTUP 0x0007
00082 #endif
00083 #ifndef CSIDL_RECENT
00084 #define CSIDL_RECENT 0x0008
00085 #endif
00086 #ifndef CSIDL_STARTMENU
00087 #define CSIDL_STARTMENU 0x000b
00088 #endif
00089 #ifndef CSIDL_DESKTOPDIRECTORY
00090 #define CSIDL_DESKTOPDIRECTORY 0x0010
00091 #endif
00092 #ifndef CSIDL_FONTS
00093 #define CSIDL_FONTS 0x0014
00094 #endif
00095 #ifndef CSIDL_FAVORITES
00096 #define CSIDL_FAVORITES 0x0016
00097 #endif
00098 #ifndef HKEY_CLASSES_ROOT
00099 #define HKEY_CLASSES_ROOT ((HKEY) 0x80000000)
00100 #endif
00101 #ifndef HKEY_CURRENT_USER
00102 #define HKEY_CURRENT_USER ((HKEY) 0x80000001)
00103 #endif
00104 #ifndef HKEY_LOCAL_MACHINE
00105 #define HKEY_LOCAL_MACHINE ((HKEY) 0x80000002)
00106 #endif
00107
00108 #ifndef REG_NONE
00109 #define REG_NONE 0
00110 #endif
00111 #ifndef REG_SZ
00112 #define REG_SZ 1
00113 #endif
00114 #ifndef REG_EXPAND_SZ
00115 #define REG_EXPAND_SZ 2
00116 #endif
00117 #ifndef REG_BINARY
00118 #define REG_BINARY 3
00119 #endif
00120 #ifndef REG_DWORD
00121 #define REG_DWORD 4
00122 #endif
00123 #ifndef REG_DWORD_LITTLE_ENDIAN
00124 #define REG_DWORD_LITTLE_ENDIAN REG_DWORD
00125 #endif
00126 #ifndef REG_DWORD_BIG_ENDIAN
00127 #define REG_DWORD_BIG_ENDIAN 5
00128 #endif
00129 #ifndef REG_LINK
00130 #define REG_LINK 6
00131 #endif
00132 #ifndef REG_MULTI_SZ
00133 #define REG_MULTI_SZ 7
00134 #endif
00135
00136 #ifndef _WIN32
00137 typedef struct _PROCESS_INFORMATION {
00138 HANDLE hProcess;
00139 HANDLE hThread;
00140 DWORD dwProcessId;
00141 DWORD dwThreadId;
00142 } PROCESS_INFORMATION, *LPPROCESS_INFORMATION;
00143
00144 typedef void* LPSECURITY_ATTRIBUTES;
00145
00146 typedef void* LPOVERLAPPED;
00147 #endif
00148
00149 typedef struct _CE_FIND_DATA {
00150 DWORD dwFileAttributes;
00151 FILETIME ftCreationTime;
00152 FILETIME ftLastAccessTime;
00153 FILETIME ftLastWriteTime;
00154 DWORD nFileSizeHigh;
00155 DWORD nFileSizeLow;
00156 DWORD dwOID;
00157 WCHAR cFileName[MAX_PATH];
00158 } CE_FIND_DATA, *LPCE_FIND_DATA, **LPLPCE_FIND_DATA;
00159
00160 typedef struct _CEOSVERSIONINFO {
00161 DWORD dwOSVersionInfoSize;
00162 DWORD dwMajorVersion;
00163 DWORD dwMinorVersion;
00164 DWORD dwBuildNumber;
00165 DWORD dwPlatformId;
00166 WCHAR szCSDVersion[128];
00167 } CEOSVERSIONINFO;
00168
00171 struct _IRAPIStream;
00172
00175 typedef struct _IRAPIStream IRAPIStream;
00176
00177 #endif
00178
00179 #ifdef __cplusplus
00180 extern "C" {
00181 #endif
00182
00183 #ifdef _WIN32
00184 # define _STDFKTARGS __stdcall
00185 # define VOIDPARAM
00186 #else
00187 # define _STDFKTARGS
00188 # define VOIDPARAM void
00189 #endif
00190
00193 typedef HRESULT (_STDFKTARGS *t_cerapiinit)(VOIDPARAM);
00194
00197 typedef HRESULT (_STDFKTARGS *t_cerapiuninit)(VOIDPARAM);
00198
00201 typedef HRESULT (_STDFKTARGS *t_cerapigeterror)(void);
00202
00205 typedef DWORD (_STDFKTARGS *t_cegetlasterror)(void);
00206
00209 typedef BOOL (_STDFKTARGS *t_cecreateprocess)(
00210 LPCWSTR lpApplicationName,
00211 LPCWSTR lpCommandLine,
00212 void* lpProcessAttributes,
00213 void* lpThreadAttributes,
00214 BOOL bInheritHandles,
00215 DWORD dwCreationFlags,
00216 LPVOID lpEnvironment,
00217 LPWSTR lpCurrentDirectory,
00218 void* lpStartupInfo,
00219 LPPROCESS_INFORMATION lpProcessInformation);
00220
00223 typedef BOOL (_STDFKTARGS *t_ceclosehandle)(HANDLE hObject);
00224
00227 typedef DWORD (_STDFKTARGS *t_cegetfileattributes)(LPCWSTR lpFileName);
00228
00231 typedef HANDLE (_STDFKTARGS *t_cefindfirstfile)(LPCWSTR lpFileName,
00232 LPCE_FIND_DATA lpFindFileData);
00233
00236 typedef BOOL (_STDFKTARGS *t_cefindnextfile)(HANDLE hFindFile,
00237 LPCE_FIND_DATA lpFindFileData);
00238
00241 typedef BOOL (_STDFKTARGS *t_cefindclose)(HANDLE hFindFile);
00242
00245 typedef HRESULT (_STDFKTARGS *t_cerapifreebuffer)(LPVOID Buffer);
00246
00249 typedef HANDLE (_STDFKTARGS *t_cecreatefile)(
00250 LPCWSTR lpFileName,
00251 DWORD dwDesiredAccess,
00252 DWORD dwShareMode,
00253 LPSECURITY_ATTRIBUTES lpSecurityAttributes,
00254 DWORD dwCreationDisposition,
00255 DWORD dwFlagsAndAttributes,
00256 HANDLE hTemplateFile);
00257
00260 typedef BOOL (_STDFKTARGS *t_cewritefile)(
00261 HANDLE hFile,
00262 LPCVOID lpBuffer,
00263 DWORD nNumberOfBytesToWrite,
00264 LPDWORD lpNumberOfBytesWritten,
00265 LPOVERLAPPED lpOverlapped);
00266
00269 typedef BOOL (_STDFKTARGS *t_cereadfile)(
00270 HANDLE hFile,
00271 LPVOID lpBuffer,
00272 DWORD nNumberOfBytesToRead,
00273 LPDWORD lpNumberOfBytesRead,
00274 LPOVERLAPPED lpOverlapped);
00275
00278 typedef BOOL (_STDFKTARGS *t_cedeletefile)(LPCWSTR lpFileName);
00279
00282 typedef DWORD (_STDFKTARGS *t_cegetspecialfolderpath)(
00283 int nFolder,
00284 DWORD nBufferLength,
00285 LPWSTR lpBuffer);
00286
00289 typedef LONG (_STDFKTARGS *t_ceregopenkeyex)(
00290 HKEY hKey,
00291 LPCWSTR lpszSubKey,
00292 DWORD ulOptions,
00293 REGSAM samDesired,
00294 PHKEY phkResult);
00295
00298 typedef LONG (_STDFKTARGS *t_ceregqueryinfokey)(
00299 HKEY key,
00300 LPWSTR lpClass,
00301 LPDWORD lpcbClass,
00302 LPDWORD lpReserved,
00303 LPDWORD lpcSubKeys,
00304 LPDWORD lpcbMaxSubKeyLen,
00305 LPDWORD lpcbMaxClassLen,
00306 LPDWORD lpcValues,
00307 LPDWORD lpcbMaxValueNameLen,
00308 LPDWORD lpcbMaxValueLen,
00309 LPDWORD lpcbSecurityDescriptor,
00310 PFILETIME lpftLastWriteTime);
00311
00314 typedef LONG (_STDFKTARGS *t_ceregenumvalue)(
00315 HKEY hKey,
00316 DWORD dwIndex,
00317 LPWSTR lpszValueName,
00318 LPDWORD lpcbValueName,
00319 LPDWORD lpReserved,
00320 LPDWORD lpType,
00321 LPBYTE lpData,
00322 LPDWORD lpcbData);
00323
00326 typedef LONG (_STDFKTARGS *t_ceregenumkeyex)(
00327 HKEY hKey,
00328 DWORD dwIndex,
00329 LPWSTR lpName,
00330 LPDWORD lpcbName,
00331 LPDWORD lpReserved,
00332 LPWSTR lpClass,
00333 LPDWORD lpcbClass,
00334 PFILETIME lpftLastWriteTime);
00335
00338 typedef LONG (_STDFKTARGS *t_ceregqueryvalueex)(HKEY hKey,
00339 LPCWSTR lpValueName,
00340 LPDWORD lpReserved,
00341 LPDWORD lpType,
00342 LPBYTE lpData,
00343 LPDWORD lpcbData);
00344
00347 typedef LONG (_STDFKTARGS *t_ceregclosekey)(HKEY hKey);
00348
00351 typedef BOOL (_STDFKTARGS *t_cecreatedirectory)(LPCWSTR lpPathName,
00352 LPSECURITY_ATTRIBUTES lpSa);
00353
00356 typedef BOOL (_STDFKTARGS *t_ceremovedirectory)(LPCWSTR lpPathName);
00357
00360 typedef BOOL (_STDFKTARGS *t_cemovefile)(LPCWSTR lpOld, LPCWSTR lpNew);
00361
00364 #ifdef _WIN32
00365 typedef BOOL (_STDFKTARGS *t_ceshcreateshortcut)(LPWSTR target,
00366 LPWSTR source);
00367 #else
00368 typedef BOOL (_STDFKTARGS *t_ceshcreateshortcut)(LPCWSTR target,
00369 LPCWSTR source);
00370 #endif
00371
00374 typedef BOOL (_STDFKTARGS *t_cegetversionex)(CEOSVERSIONINFO *lpVersionInfo);
00375
00378 typedef BOOL (_STDFKTARGS *t_cesetfileattributes)(LPCWSTR lpFileName,
00379 DWORD dwFileAttributes);
00380
00383 typedef HRESULT (_STDFKTARGS *t_cerapiinvoke)(LPCWSTR pDllPath,
00384 LPCWSTR pFunctionName,
00385 DWORD cbInput,
00386 #ifdef _WIN32
00387 BYTE *pInput,
00388 #else
00389 const BYTE *pInput,
00390 #endif
00391 DWORD *pcbOutput,
00392 BYTE **ppOutput,
00393 IRAPIStream **ppIRAPIStream,
00394 DWORD dwReserved);
00395
00396
00399 t_cerapiinit pCeRapiInit;
00400
00403 t_cerapiuninit pCeRapiUninit;
00404
00407 t_cerapigeterror pCeRapiGetError;
00408
00411 t_cegetlasterror pCeGetLastError;
00412
00415 t_cecreateprocess pCeCreateProcess;
00416
00419 t_ceclosehandle pCeCloseHandle;
00420
00423 t_cegetfileattributes pCeGetFileAttributes;
00424
00427 t_cefindfirstfile pCeFindFirstFile;
00428
00431 t_cefindnextfile pCeFindNextFile;
00432
00435 t_cefindclose pCeFindClose;
00436
00439 t_cerapifreebuffer pCeRapiFreeBuffer;
00440
00443 t_cecreatefile pCeCreateFile;
00444
00447 t_cewritefile pCeWriteFile;
00448
00451 t_cereadfile pCeReadFile;
00452
00455 t_cedeletefile pCeDeleteFile;
00456
00459 t_cegetspecialfolderpath pCeGetSpecialFolderPath;
00460
00463 t_ceregopenkeyex pCeRegOpenKeyEx;
00464
00467 t_ceregqueryinfokey pCeRegQueryInfoKey;
00468
00471 t_ceregenumvalue pCeRegEnumValue;
00472
00475 t_ceregenumkeyex pCeRegEnumKeyEx;
00476
00479 t_ceregqueryvalueex pCeRegQueryValueEx;
00480
00483 t_ceregclosekey pCeRegCloseKey;
00484
00487 t_cecreatedirectory pCeCreateDirectory;
00488
00491 t_ceremovedirectory pCeRemoveDirectory;
00492
00495 t_cemovefile pCeMoveFile;
00496
00499 t_ceshcreateshortcut pCeSHCreateShortcut;
00500
00503 t_cegetversionex pCeGetVersionEx;
00504
00507 t_cesetfileattributes pCeSetFileAttributes;
00508
00511 t_cerapiinvoke pCeRapiInvoke;
00512
00513 #ifdef __cplusplus
00514 }
00515 #endif
00516
00517 #endif
00518