xref: /reactos/sdk/include/psdk/delayimp.h (revision 3468e27c)
1c2c66affSColin Finck #ifndef _delayimp_h
2c2c66affSColin Finck #define _delayimp_h
3c2c66affSColin Finck 
4c2c66affSColin Finck #ifdef __GNUC__
5c2c66affSColin Finck /* Hack, for bug in ld.  Will be removed soon.  */
6*3468e27cSHervé Poussineau #define __ImageBase __MINGW_LSYMBOL(_image_base__)
7c2c66affSColin Finck #endif
8c2c66affSColin Finck 
9c2c66affSColin Finck #if defined(__cplusplus)
10c2c66affSColin Finck #define ExternC extern "C"
11c2c66affSColin Finck #else
12c2c66affSColin Finck #define ExternC extern
13c2c66affSColin Finck #endif
14c2c66affSColin Finck 
15c2c66affSColin Finck #ifndef FACILITY_VISUALCPP
16c2c66affSColin Finck #define FACILITY_VISUALCPP  ((LONG)0x6d)
17c2c66affSColin Finck #endif
18c2c66affSColin Finck #define VcppException(sev,err)  ((sev) | (FACILITY_VISUALCPP<<16) | err)
19c2c66affSColin Finck 
20c2c66affSColin Finck #define DELAYLOAD_VERSION 0x200
21c2c66affSColin Finck 
22c2c66affSColin Finck typedef DWORD RVA;
23c2c66affSColin Finck typedef IMAGE_THUNK_DATA *PImgThunkData;
24c2c66affSColin Finck typedef const IMAGE_THUNK_DATA *PCImgThunkData;
25c2c66affSColin Finck 
26c2c66affSColin Finck enum DLAttr
27c2c66affSColin Finck {
28c2c66affSColin Finck     dlattrRva = 0x1,
29c2c66affSColin Finck };
30c2c66affSColin Finck 
31c2c66affSColin Finck /* Notification codes */
32c2c66affSColin Finck enum
33c2c66affSColin Finck {
34c2c66affSColin Finck     dliStartProcessing,
35c2c66affSColin Finck     dliNotePreLoadLibrary,
36c2c66affSColin Finck     dliNotePreGetProcAddress,
37c2c66affSColin Finck     dliFailLoadLib,
38c2c66affSColin Finck     dliFailGetProc,
39c2c66affSColin Finck     dliNoteEndProcessing,
40c2c66affSColin Finck };
41c2c66affSColin Finck 
42c2c66affSColin Finck typedef struct ImgDelayDescr
43c2c66affSColin Finck {
44c2c66affSColin Finck     DWORD grAttrs;
45c2c66affSColin Finck     RVA rvaDLLName;
46c2c66affSColin Finck     RVA rvaHmod;
47c2c66affSColin Finck     RVA rvaIAT;
48c2c66affSColin Finck     RVA rvaINT;
49c2c66affSColin Finck     RVA rvaBoundIAT;
50c2c66affSColin Finck     RVA rvaUnloadIAT;
51c2c66affSColin Finck     DWORD dwTimeStamp;
52c2c66affSColin Finck } ImgDelayDescr, *PImgDelayDescr;
53c2c66affSColin Finck typedef const ImgDelayDescr *PCImgDelayDescr;
54c2c66affSColin Finck 
55c2c66affSColin Finck typedef struct DelayLoadProc
56c2c66affSColin Finck {
57c2c66affSColin Finck     BOOL fImportByName;
58c2c66affSColin Finck     union
59c2c66affSColin Finck     {
60c2c66affSColin Finck         LPCSTR szProcName;
61c2c66affSColin Finck         DWORD dwOrdinal;
62c2c66affSColin Finck     };
63c2c66affSColin Finck } DelayLoadProc;
64c2c66affSColin Finck 
65c2c66affSColin Finck typedef struct DelayLoadInfo
66c2c66affSColin Finck {
67c2c66affSColin Finck     DWORD cb;
68c2c66affSColin Finck     PCImgDelayDescr pidd;
69c2c66affSColin Finck     FARPROC *ppfn;
70c2c66affSColin Finck     LPCSTR szDll;
71c2c66affSColin Finck     DelayLoadProc dlp;
72c2c66affSColin Finck     HMODULE hmodCur;
73c2c66affSColin Finck     FARPROC pfnCur;
74c2c66affSColin Finck     DWORD dwLastError;
75c2c66affSColin Finck } DelayLoadInfo, *PDelayLoadInfo;
76c2c66affSColin Finck 
77c2c66affSColin Finck typedef FARPROC (WINAPI *PfnDliHook)(unsigned, PDelayLoadInfo);
78c2c66affSColin Finck 
79c2c66affSColin Finck 
80c2c66affSColin Finck ExternC PfnDliHook __pfnDliNotifyHook2;
81c2c66affSColin Finck ExternC PfnDliHook __pfnDliFailureHook2;
82c2c66affSColin Finck 
83c2c66affSColin Finck #endif /* not _delayimp_h */
84