1 | #ifndef __CUSTOMBUILD_H__
|
---|
2 | #define __CUSTOMBUILD_H__
|
---|
3 |
|
---|
4 | #include <win/peexe.h>
|
---|
5 | #include <initdll.h>
|
---|
6 |
|
---|
7 | //HKEY_LOCAL_MACHINE
|
---|
8 | #define CUSTOM_BUILD_OPTIONS_KEY "System\\CustomBuild"
|
---|
9 | #define DISABLE_AUDIO_KEY "DisableAudio"
|
---|
10 | #define DISABLE_ASPI_KEY "DisableASPI"
|
---|
11 | #define ENABLE_POSTSCRIPT_PASSTHROUGH "EnablePostscriptPassthrough"
|
---|
12 |
|
---|
13 | #define ODIN_WIN32_CDCLASS "Win32CDWindowClass"
|
---|
14 | #define ODIN_WIN32_STDCLASS "Win32WindowClass"
|
---|
15 |
|
---|
16 | #define DUMMY_PREFIX "DUMMY_"
|
---|
17 |
|
---|
18 | #define MAX_FONT_MAPPINGS 8
|
---|
19 | #define MAX_REGISTER_DLLS 64
|
---|
20 |
|
---|
21 | #define INNOWIN_DLLNAME "INNOWIN.DLL"
|
---|
22 | #define INNOWIN_REGISTRY_BASE "Software\\InnoTek\\INNOWIN\\"
|
---|
23 | #define INNOWIN_REG_CURRENTUSER "REGROOT_HKEY_CurrentUser"
|
---|
24 | #define INNOWIN_REG_LOCAL_MACHINE "REGROOT_HKEY_LocalMachine"
|
---|
25 | #define INNOWIN_REG_USERS "REGROOT_HKEY_Users"
|
---|
26 |
|
---|
27 | #define MAKE_BUILDNR(major, minor) ((major << 16) | minor)
|
---|
28 | #define MAJOR_BUILDNR(buildnr) (buildnr >> 16)
|
---|
29 | #define MINOR_BUILDNR(buildnr) (buildnr & 0xffff)
|
---|
30 |
|
---|
31 |
|
---|
32 | typedef BOOL (WIN32API *PFN_PRECUSTOMIZE)();
|
---|
33 | typedef BOOL (WIN32API *PFN_POSTCUSTOMIZE)();
|
---|
34 | typedef BOOL (WIN32API *PFN_ENDCUSTOMIZE)();
|
---|
35 | typedef BOOL (WIN32API *PFN_ISPESTUBLOADER)(char *pszProgram);
|
---|
36 |
|
---|
37 | typedef ULONG (APIENTRY *PFN_INITDLL)(ULONG hModule, ULONG ulFlag);
|
---|
38 | typedef void (APIENTRY *PFN_CLEANUPDLL)(ULONG ulReason);
|
---|
39 |
|
---|
40 | typedef struct {
|
---|
41 | char *szWindowsFont;
|
---|
42 | char *szPMFont;
|
---|
43 | } CUSTOMBUILD_FONTMAP;
|
---|
44 |
|
---|
45 | typedef struct {
|
---|
46 | char *szName; //caps, including extension (e.g. "KERNEL32.DLL")
|
---|
47 | PIMAGE_FILE_HEADER pfh; //PE file header
|
---|
48 | PFN_INITDLL pfnInitterm;
|
---|
49 | } CUSTOMBUILD_DLL;
|
---|
50 |
|
---|
51 | typedef struct {
|
---|
52 | char *szName;
|
---|
53 | PFN_INITDLL pfnInitterm;
|
---|
54 | } CUSTOMBUILD_PRIVATE_INITTERM;
|
---|
55 |
|
---|
56 | typedef struct {
|
---|
57 | PFN_PRECUSTOMIZE pfnPreCustomize; //called after kernel32 is initialized
|
---|
58 | PFN_POSTCUSTOMIZE pfnPostCustomize; //called at the end of dll load
|
---|
59 | PFN_ENDCUSTOMIZE pfnEndCustomize; //called when dll is unloaded
|
---|
60 |
|
---|
61 | char *szCustomBuildDllName;
|
---|
62 |
|
---|
63 | char *szRegistryBase;
|
---|
64 | char *szMemMapName;
|
---|
65 | char *szEnvExceptLogDisable;
|
---|
66 | char *szEnvExceptLogPath;
|
---|
67 | char *szPMWindowClassName;
|
---|
68 | char *szWindowHandleSemName;
|
---|
69 |
|
---|
70 | //standard kernel32 settings
|
---|
71 | DWORD dwWindowsVersion;
|
---|
72 | BOOL fOdinIni;
|
---|
73 | BOOL fSMP;
|
---|
74 |
|
---|
75 | //standard user32 settings
|
---|
76 | BOOL fDragDrop;
|
---|
77 | BOOL fOdinSysMenuItems;
|
---|
78 | DWORD dwWindowAppearance;
|
---|
79 | BOOL fMonoCursor;
|
---|
80 |
|
---|
81 | //standard gdi32 settings
|
---|
82 | //font mappings (null terminated)
|
---|
83 | CUSTOMBUILD_FONTMAP fontMapping[MAX_FONT_MAPPINGS];
|
---|
84 | BOOL fFreeType;
|
---|
85 |
|
---|
86 | //winmm
|
---|
87 | BOOL fDirectAudio;
|
---|
88 | BOOL fWaveAudio;
|
---|
89 |
|
---|
90 | //first three important dlls (initialized in this order
|
---|
91 | CUSTOMBUILD_DLL dllNtdll;
|
---|
92 | CUSTOMBUILD_DLL dllKernel32;
|
---|
93 | CUSTOMBUILD_DLL dllUser32;
|
---|
94 | CUSTOMBUILD_DLL dllGdi32;
|
---|
95 |
|
---|
96 | //list of remainder of registered dlls (order is important due to dependencies!!)
|
---|
97 | //(null terminated)
|
---|
98 | CUSTOMBUILD_DLL registeredDll[MAX_REGISTER_DLLS];
|
---|
99 |
|
---|
100 | //list of dummy dlls (to prevent accidental load)
|
---|
101 | //(null terminated)
|
---|
102 | CUSTOMBUILD_DLL dummyDll[MAX_REGISTER_DLLS];
|
---|
103 |
|
---|
104 | } CUSTOMBUILD;
|
---|
105 |
|
---|
106 | typedef struct {
|
---|
107 | PFN_PRECUSTOMIZE pfnPreCustomize; //called after kernel32, user32 and gdi32 are initialized
|
---|
108 | PFN_POSTCUSTOMIZE pfnPostCustomize; //called at the end of dll load
|
---|
109 | PFN_ENDCUSTOMIZE pfnEndCustomize; //called when dll is unloaded
|
---|
110 | PFN_ISPESTUBLOADER pfnIsPeStubLoader;
|
---|
111 |
|
---|
112 | char *szCustomBuildDllName;
|
---|
113 |
|
---|
114 | char *szRegistryBase;
|
---|
115 | char *szEnvExceptLogDisable;
|
---|
116 | char *szEnvExceptLogPath;
|
---|
117 |
|
---|
118 | //standard kernel32 settings
|
---|
119 | DWORD dwWindowsVersion;
|
---|
120 | BOOL fOdinIni;
|
---|
121 | BOOL fSMP;
|
---|
122 |
|
---|
123 | //standard user32 settings
|
---|
124 | BOOL fDragDrop;
|
---|
125 | BOOL fOdinSysMenuItems;
|
---|
126 | DWORD dwWindowAppearance;
|
---|
127 | BOOL fMonoCursor;
|
---|
128 |
|
---|
129 | //standard gdi32 settings
|
---|
130 | //font mappings (null terminated)
|
---|
131 | CUSTOMBUILD_FONTMAP fontMapping[MAX_FONT_MAPPINGS];
|
---|
132 | BOOL fFreeType;
|
---|
133 |
|
---|
134 | //winmm
|
---|
135 | BOOL fDirectAudio;
|
---|
136 | BOOL fWaveAudio;
|
---|
137 |
|
---|
138 | //list of remainder of registered dlls (order is important due to dependencies!!)
|
---|
139 | //(null terminated)
|
---|
140 | //(NTDLL, KERNEL32, USER32 and GDI32 are always registered)
|
---|
141 | CUSTOMBUILD_DLL registeredDll[MAX_REGISTER_DLLS];
|
---|
142 |
|
---|
143 | } CUSTOMBUILD_COMMON;
|
---|
144 |
|
---|
145 | #ifdef __cplusplus
|
---|
146 | extern "C" {
|
---|
147 | #endif
|
---|
148 |
|
---|
149 | BOOL WIN32API LoadCustomEnvironment(CUSTOMBUILD_COMMON *CustomBuild);
|
---|
150 | BOOL WIN32API UnloadCustomEnvironment(BOOL fExitList);
|
---|
151 |
|
---|
152 | BOOL WIN32API InitExecutableEnvironment();
|
---|
153 | BOOL WIN32API CheckCustomDllVersion(ULONG ulVersionMajor, ULONG ulVersionMinor);
|
---|
154 |
|
---|
155 | typedef BOOL (* WIN32API PFN_CHECKDLLVERSION)();
|
---|
156 | BOOL WIN32API CheckDllVersion();
|
---|
157 |
|
---|
158 | extern BOOL fCustomBuild;
|
---|
159 |
|
---|
160 | void WIN32API SetRegistryRootKey(HKEY hRootkey, HKEY hKey);
|
---|
161 | #ifdef __cplusplus
|
---|
162 | void WIN32API SetCustomBuildName(char *lpszName, PIMAGE_FILE_HEADER pfh = NULL);
|
---|
163 | #else
|
---|
164 | void WIN32API SetCustomBuildName(char *lpszName, PIMAGE_FILE_HEADER pfh);
|
---|
165 | #endif
|
---|
166 |
|
---|
167 | void WIN32API InitDirectoriesCustom(char *szSystemDir, char *szWindowsDir);
|
---|
168 |
|
---|
169 | void WIN32API DisableOdinIni();
|
---|
170 |
|
---|
171 | void WIN32API DisableOdinSysMenuItems();
|
---|
172 |
|
---|
173 |
|
---|
174 | typedef HANDLE (* WIN32API PFNDRVOPEN)(LPVOID lpDriverData, DWORD dwAccess, DWORD dwShare, DWORD dwFlags, PVOID *ppHandleData);
|
---|
175 | typedef void (* WIN32API PFNDRVCLOSE)(LPVOID lpDriverData, HANDLE hDevice, DWORD dwFlags, PVOID lpHandleData);
|
---|
176 | typedef BOOL (* WIN32API PFNDRVIOCTL)(LPVOID lpDriverData, HANDLE hDevice, DWORD dwFlags, DWORD dwIoControlCode,
|
---|
177 | LPVOID lpInBuffer, DWORD nInBufferSize,
|
---|
178 | LPVOID lpOutBuffer, DWORD nOutBufferSize,
|
---|
179 | LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped,
|
---|
180 | LPVOID lpHandleData);
|
---|
181 |
|
---|
182 | typedef BOOL (* WIN32API PFNDRVREAD)(LPVOID lpDriverData,
|
---|
183 | HANDLE hDevice,
|
---|
184 | DWORD dwFlags,
|
---|
185 | LPCVOID lpBuffer,
|
---|
186 | DWORD nNumberOfBytesToRead,
|
---|
187 | LPDWORD lpNumberOfBytesRead,
|
---|
188 | LPOVERLAPPED lpOverlapped,
|
---|
189 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
|
---|
190 | LPVOID lpHandleData);
|
---|
191 |
|
---|
192 | typedef BOOL (* WIN32API PFNDRVWRITE)(LPVOID lpDriverData,
|
---|
193 | HANDLE hDevice,
|
---|
194 | DWORD dwFlags,
|
---|
195 | LPCVOID lpBuffer,
|
---|
196 | DWORD nNumberOfBytesToWrite,
|
---|
197 | LPDWORD lpNumberOfBytesWrite,
|
---|
198 | LPOVERLAPPED lpOverlapped,
|
---|
199 | LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
|
---|
200 | LPVOID lpHandleData);
|
---|
201 |
|
---|
202 | typedef BOOL (* WIN32API PFNDRVCANCELIO)(LPVOID lpDriverData, HANDLE hDevice, DWORD dwFlags, PVOID lpHandleData);
|
---|
203 | typedef DWORD (* WIN32API PFNDRVGETOVERLAPPEDRESULT)(LPVOID lpDriverData,
|
---|
204 | HANDLE hDevice,
|
---|
205 | DWORD dwFlags,
|
---|
206 | LPOVERLAPPED lpOverlapped,
|
---|
207 | LPDWORD lpcbTransfer,
|
---|
208 | BOOL fWait,
|
---|
209 | LPVOID lpHandleData);
|
---|
210 |
|
---|
211 | BOOL WIN32API RegisterCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose,
|
---|
212 | PFNDRVIOCTL pfnDriverIOCtl, PFNDRVREAD pfnDriverRead,
|
---|
213 | PFNDRVWRITE pfnDriverWrite, PFNDRVCANCELIO pfnDriverCancelIo,
|
---|
214 | PFNDRVGETOVERLAPPEDRESULT pfnDriverGetOverlappedResult,
|
---|
215 | LPCSTR lpDriverName, LPVOID lpDriverData);
|
---|
216 |
|
---|
217 | BOOL WIN32API UnRegisterCustomDriver(LPCSTR lpDriverName);
|
---|
218 |
|
---|
219 |
|
---|
220 | //SetDialogHook can be used by a custom Odin build to register a hook procedure
|
---|
221 | //that gets called before or after dialog creation
|
---|
222 |
|
---|
223 | #define HODIN_PREDIALOGCREATION 0
|
---|
224 | #define HODIN_POSTDIALOGCREATION 1
|
---|
225 | #define HODIN_WINDOWCREATED 2
|
---|
226 | #define HODIN_PREWINDOWCREATEDA 3
|
---|
227 |
|
---|
228 | HHOOK WIN32API SetOdinHookA(HOOKPROC proc );
|
---|
229 | BOOL WIN32API UnhookOdinHook(HHOOK hhook);
|
---|
230 | LRESULT HOOK_CallOdinHookA(INT code, WPARAM wParam, LPARAM lParam );
|
---|
231 |
|
---|
232 | //Override LoadImage function
|
---|
233 | typedef void (* WIN32API PFNLOADIMAGEW)(HINSTANCE *phinst, LPWSTR *lplpszName, UINT *lpuType);
|
---|
234 |
|
---|
235 | BOOL WIN32API SetCustomLoadImage(PFNLOADIMAGEW pfnLoadImageW);
|
---|
236 |
|
---|
237 | //Set the default language in kernel32
|
---|
238 | void WIN32API SetDefaultLanguage(DWORD deflang);
|
---|
239 |
|
---|
240 | //Override pm keyboard hook dll name
|
---|
241 | void WIN32API SetCustomPMHookDll(LPSTR pszKbdDllName);
|
---|
242 |
|
---|
243 | void WIN32API DisableDragDrop(BOOL fDisabled);
|
---|
244 |
|
---|
245 | //Turn off wave audio in winmm
|
---|
246 | void WIN32API DisableWaveAudio();
|
---|
247 | //Turn off usage of the Uniaud DirectAudio interface
|
---|
248 | void WIN32API DisableDirectAudio();
|
---|
249 |
|
---|
250 | //Override shared semaphore name used to synchronize global window handle
|
---|
251 | //array access (to avoid name clash with Odin)
|
---|
252 | void WIN32API SetCustomWndHandleSemName(LPSTR pszSemName);
|
---|
253 |
|
---|
254 | //Override shared semaphore name used to synchronize global memory map
|
---|
255 | //list access (to avoid name clash with Odin)
|
---|
256 | void WIN32API SetCustomMMapSemName(LPSTR pszSemName);
|
---|
257 |
|
---|
258 | //Override std class names used in Odin
|
---|
259 | void WIN32API SetCustomStdClassName(LPSTR pszStdClassName);
|
---|
260 | const char *WIN32API QueryCustomStdClassName();
|
---|
261 |
|
---|
262 | //Turn off ASPI
|
---|
263 | void WIN32API DisableASPI();
|
---|
264 |
|
---|
265 | //force color to mono cursor conversion
|
---|
266 | void WIN32API CustForceMonoCursor();
|
---|
267 |
|
---|
268 | //force GetVolumeInformation to tell the app all partitions are FAT
|
---|
269 | void WIN32API CustForce2GBFileSize();
|
---|
270 |
|
---|
271 | //Logging of exceptions:
|
---|
272 | //Override filename of exception log (expects full path)
|
---|
273 | void WIN32API SetCustomExceptionLog(LPSTR lpszLogName);
|
---|
274 | //Enable/disable exception logging
|
---|
275 | void WIN32API SetExceptionLogging(BOOL fEnable);
|
---|
276 |
|
---|
277 | //Disable OS2CDROM.DMD aspi support
|
---|
278 | void WIN32API DisableCDIo();
|
---|
279 |
|
---|
280 | //Force DirectDraw to report only one fullscreen mode
|
---|
281 | void WIN32API SetCustomFullScreenMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP);
|
---|
282 |
|
---|
283 | //Force DirectSurface Lock & Unlock methods to hide & show the mouse cursor
|
---|
284 | BOOL WIN32API SetCustomHideCursorOnLock(BOOL state);
|
---|
285 |
|
---|
286 | //Call to enable access to physical disks or volumes (default is disabled)
|
---|
287 | void WIN32API EnablePhysicalDiskAccess(BOOL fEnable);
|
---|
288 |
|
---|
289 | //Override a system color without forcing a desktop repaint (which
|
---|
290 | //SetSysColors does)
|
---|
291 | BOOL WIN32API ODIN_SetSysColors(INT nChanges, const INT *lpSysColor,
|
---|
292 | const COLORREF *lpColorValues);
|
---|
293 |
|
---|
294 | //Override loader names (PEC, PE, W16ODIN)
|
---|
295 | BOOL WIN32API ODIN_SetLoaders(LPCSTR pszPECmdLoader, LPCSTR pszPEGUILoader,
|
---|
296 | LPCSTR pszNELoader);
|
---|
297 |
|
---|
298 | //Returns path of loaders
|
---|
299 | BOOL WIN32API ODIN_QueryLoaders(LPSTR pszPECmdLoader, INT cchPECmdLoader,
|
---|
300 | LPSTR pszPEGUILoader, INT cchPEGUILoader,
|
---|
301 | LPSTR pszNELoader, INT cchNELoader);
|
---|
302 |
|
---|
303 | //Checks whether program is LX or PE
|
---|
304 | BOOL WIN32API ODIN_IsWin32App(LPSTR lpszProgramPath);
|
---|
305 |
|
---|
306 | //Custom build function to disable loading of LX dlls
|
---|
307 | void WIN32API ODIN_DisableLXDllLoading();
|
---|
308 |
|
---|
309 | /**
|
---|
310 | * LoadLibrary*() callback function registered using ODIN_SetLxDllLoadCallback().
|
---|
311 | * This is called for all LX modules which are loaded by LoadLibrary.
|
---|
312 | *
|
---|
313 | * @returns TRUE loading should succeed. The DLL is now registered.
|
---|
314 | * @returns FALSE loading should fail.
|
---|
315 | * @param hmodOS2 The OS/2 module handle.
|
---|
316 | * @param hInstance The Odin instance handle.
|
---|
317 | * If not NULL this means that the DLL is registered.
|
---|
318 | */
|
---|
319 | typedef BOOL (* WIN32API PFNLXDLLLOAD)(HMODULE hmodOS2, HINSTANCE hInstance);
|
---|
320 |
|
---|
321 | /** Custombuild API for registering a callback for LX Dll loading thru LoadLibrary*(). */
|
---|
322 | BOOL WIN32API ODIN_SetLxDllLoadCallback(PFNLXDLLLOAD pfn);
|
---|
323 |
|
---|
324 | /**
|
---|
325 | * FreeLibrary*() callback function registered using ODIN_SetLxDllUnLoadCallback().
|
---|
326 | * This is called when an LX which was previously loaded using LoadLibrary*() is
|
---|
327 | * finally freed from Odin. The callback servers mainly the purpose of cleaning
|
---|
328 | * up any data associated with the DLL.
|
---|
329 | *
|
---|
330 | * It is called *AFTER* the module is freed from Odin but before it's actually
|
---|
331 | * unloaded from the OS/2 process. This means that the OS/2 handle is valid while
|
---|
332 | * the Odin handle is invalid.
|
---|
333 | *
|
---|
334 | * @param hmodOS2 The OS/2 module handle.
|
---|
335 | * @param hInstance The Odin instance handle (invalid!).
|
---|
336 | * @remark It likely that this callback will be called for more DLLs than the
|
---|
337 | * load callback. Do check handles properly.
|
---|
338 | */
|
---|
339 | typedef void (* WIN32API PFNLXDLLUNLOAD)(HMODULE hmodOS2, HINSTANCE hInstance);
|
---|
340 |
|
---|
341 | BOOL WIN32API ODIN_SetLxDllUnLoadCallback(PFNLXDLLUNLOAD pfn);
|
---|
342 |
|
---|
343 |
|
---|
344 | //******************************************************************************
|
---|
345 | //Install a handler that is called before the entrypoint of a dll (DLL_PROCESS_ATTACH)
|
---|
346 | //******************************************************************************
|
---|
347 | typedef void (* WIN32API ODINPROC_DLLLOAD)(HMODULE hModule);
|
---|
348 |
|
---|
349 | BOOL WIN32API ODIN_SetDllLoadCallback(ODINPROC_DLLLOAD pfnMyDllLoad);
|
---|
350 |
|
---|
351 |
|
---|
352 | //******************************************************************************
|
---|
353 | // ODIN_SetProcAddress: Override a dll export
|
---|
354 | //
|
---|
355 | // Parameters:
|
---|
356 | // HMODULE hModule Module handle
|
---|
357 | // LPCSTR lpszProc Export name or ordinal
|
---|
358 | // FARPROC pfnNewProc New export function address
|
---|
359 | //
|
---|
360 | // Returns: Success -> old address of export
|
---|
361 | // Failure -> -1
|
---|
362 | //
|
---|
363 | //******************************************************************************
|
---|
364 | FARPROC WIN32API ODIN_SetProcAddress(HMODULE hModule, LPCSTR lpszProc, FARPROC pfnNewProc);
|
---|
365 |
|
---|
366 | //******************************************************************************
|
---|
367 | // ODIN_SetTIBSwitch: override TIB switching
|
---|
368 | //
|
---|
369 | // Parameters:
|
---|
370 | // BOOL fSwitchTIB
|
---|
371 | // FALSE -> no TIB selector switching
|
---|
372 | // TRUE -> force TIB selector switching
|
---|
373 | //
|
---|
374 | //******************************************************************************
|
---|
375 | void WIN32API ODIN_SetTIBSwitch(BOOL fSwitchTIB);
|
---|
376 |
|
---|
377 | //******************************************************************************
|
---|
378 | // ODIN_DisableFolderShellLink
|
---|
379 | //
|
---|
380 | // Disable object creation in Odin folder. Desktop shortcuts will still be
|
---|
381 | // created as WPS objects on the desktop.
|
---|
382 | //
|
---|
383 | //******************************************************************************
|
---|
384 | void WIN32API ODIN_DisableFolderShellLink();
|
---|
385 |
|
---|
386 | //******************************************************************************
|
---|
387 | // ODIN_waveOutSetFixedBuffers
|
---|
388 | //
|
---|
389 | // Tell WINMM to use DART buffers of the same size as the first buffer delivered
|
---|
390 | // by waveOutWrite
|
---|
391 | //
|
---|
392 | // NOTE: This will only work in very specific cases; it is not a good general
|
---|
393 | // purpose solution.
|
---|
394 | //
|
---|
395 | //******************************************************************************
|
---|
396 | void WIN32API ODIN_waveOutSetFixedBuffers();
|
---|
397 |
|
---|
398 | #define SetFixedWaveBufferSize ODIN_waveOutSetFixedBuffers
|
---|
399 |
|
---|
400 | //******************************************************************************
|
---|
401 | // ODIN_waveInSetFixedBuffers
|
---|
402 | //
|
---|
403 | // Tell WINMM to use DART buffers of the same size as the first buffer delivered
|
---|
404 | // by waveInAddBuffer
|
---|
405 | //
|
---|
406 | // NOTE: This will only work in very specific cases; it is not a good general
|
---|
407 | // purpose solution.
|
---|
408 | //
|
---|
409 | //******************************************************************************
|
---|
410 | void WIN32API ODIN_waveInSetFixedBuffers();
|
---|
411 |
|
---|
412 |
|
---|
413 | /** @defgroup odin32_threadctx Odin32 Thread Context
|
---|
414 | * @{ */
|
---|
415 | #pragma pack(1)
|
---|
416 | /** Saved odin/os2 thread context.
|
---|
417 | * (This structure is 32 bytes, there is assembly workers which depends on this size.)
|
---|
418 | */
|
---|
419 | typedef struct _ODINTHREADCTX
|
---|
420 | {
|
---|
421 | /** Flags. */
|
---|
422 | unsigned fFlags;
|
---|
423 | /** Saved fs selector. */
|
---|
424 | unsigned short fs;
|
---|
425 | /** FPU control word. */
|
---|
426 | unsigned short cw;
|
---|
427 | /** Exception registration record. */
|
---|
428 | unsigned XctpRegRec[2];
|
---|
429 | /** Reserved for future use. */
|
---|
430 | unsigned aReserved[4];
|
---|
431 | } ODINTHREADCTX, *PODINTHREADCTX;
|
---|
432 | #pragma pack()
|
---|
433 |
|
---|
434 | /** @defgroup odin32_threadctx_flags Odin32 Thread Context Flags
|
---|
435 | * These flags are used to direct what is done and saved on a switch. The flags
|
---|
436 | * passed to the save function will be stored in fFlags of ODINTHREADCTX.
|
---|
437 | * @{ */
|
---|
438 | /** Default switch from OS/2 to Odin32 context. */
|
---|
439 | #define OTCTXF_DEF_TO_OS2 (OTCTXF_ENTER_OS2 | OTCTXF_LOAD_OS2 | OTCTXF_MAYBE_NESTED | OTCTXF_SAVE_FPU)
|
---|
440 | /** Default switch from OS/2 to Odin32 context. */
|
---|
441 | #define OTCTXF_DEF_TO_ODIN32 (OTCTXF_ENTER_ODIN32 | OTCTXF_LOAD_ODIN32 | OTCTXF_MAYBE_NESTED | OTCTXF_SAVE_FPU)
|
---|
442 |
|
---|
443 | /** Perhaps this is a nested enter and/or leave. (advisory only) */
|
---|
444 | #define OTCTXF_MAYBE_NESTED 0x0001
|
---|
445 | /** Enter OS/2 context from Odin32 context. */
|
---|
446 | #define OTCTXF_ENTER_OS2 (0x0002 | OTCTXF_SAVE_FS | OTCTXF_SAVE_FPU)
|
---|
447 | /** Enter Odin32 context from OS/2 context. */
|
---|
448 | #define OTCTXF_ENTER_ODIN32 (0x0004 | OTCTXF_SAVE_FS | OTCTXF_SAVE_FPU)
|
---|
449 | /** Load Default OS/2 context. */
|
---|
450 | #define OTCTXF_LOAD_OS2 (0x0008 | OTCTXF_LOAD_FS_OS2 | OTCTXF_LOAD_FPU_OS2 | OTCTXF_LOAD_XCPT_OS2)
|
---|
451 | /** Load Default Odin32 context. */
|
---|
452 | #define OTCTXF_LOAD_ODIN32 (0x0010 | OTCTXF_LOAD_FS_ODIN32 | OTCTXF_LOAD_FPU_ODIN32 | OTCTXF_LOAD_XCPT_ODIN32)
|
---|
453 |
|
---|
454 | /** Save FS. */
|
---|
455 | #define OTCTXF_SAVE_FS 0x0100
|
---|
456 | /** Load OS/2 FS. */
|
---|
457 | #define OTCTXF_LOAD_FS_OS2 0x0200
|
---|
458 | /** Load Odin32 FS. */
|
---|
459 | #define OTCTXF_LOAD_FS_ODIN32 0x0400
|
---|
460 | /** Save FPU control word. */
|
---|
461 | #define OTCTXF_SAVE_FPU 0x0800
|
---|
462 | /** Load OS/2 FPU control word. */
|
---|
463 | #define OTCTXF_LOAD_FPU_OS2 0x1000
|
---|
464 | /** Load Odin32 FPU control word. */
|
---|
465 | #define OTCTXF_LOAD_FPU_ODIN32 0x2000
|
---|
466 | /** Install OS/2 exception handler. (not implemented) */
|
---|
467 | #define OTCTXF_LOAD_XCPT_OS2 0x4000
|
---|
468 | /** Install Odin32 exception handler. */
|
---|
469 | #define OTCTXF_LOAD_XCPT_ODIN32 0x8000
|
---|
470 | /** @} */
|
---|
471 |
|
---|
472 | /** Save thread context and/or load other thread context.
|
---|
473 | * @param pCtx Where to save the current thread context.
|
---|
474 | * @param fFlags Flags telling what to do.
|
---|
475 | */
|
---|
476 | void WIN32API ODIN_ThreadContextSave(PODINTHREADCTX pCtx, unsigned fFlags);
|
---|
477 |
|
---|
478 | /** Restore saved thread context and/or do additional loads.
|
---|
479 | * @param pCtx Where to save the current thread context.
|
---|
480 | * (This will be zero'ed.)
|
---|
481 | * @param fFlags Flags telling extra stuff to load.
|
---|
482 | * Only CTCTXF_LOAD_* flags will be evaluated.
|
---|
483 | */
|
---|
484 | void WIN32API ODIN_ThreadContextRestore(PODINTHREADCTX pCtx, unsigned fFlags);
|
---|
485 |
|
---|
486 |
|
---|
487 | /** Enter odin context with this thread.
|
---|
488 | * @deprecated */
|
---|
489 | USHORT WIN32API ODIN_ThreadEnterOdinContext(void *pExceptionRegRec, BOOL fForceFSSwitch);
|
---|
490 | /** Leave odin context with this thread.
|
---|
491 | * @deprecated */
|
---|
492 | void WIN32API ODIN_ThreadLeaveOdinContext(void *pExceptionRegRec, USHORT selFSOld);
|
---|
493 |
|
---|
494 | /** Leave odin context to call back into OS/2 code.
|
---|
495 | * @deprecated */
|
---|
496 | USHORT WIN32API ODIN_ThreadLeaveOdinContextNested(void *pExceptionRegRec, BOOL fRemoveOdinExcpt);
|
---|
497 | /** Re-enter Odin context after being back in OS/2 code.
|
---|
498 | * @deprecated */
|
---|
499 | void WIN32API ODIN_ThreadEnterOdinContextNested(void *pExceptionRegRec, BOOL fRestoreOdinExcpt, USHORT selFSOld);
|
---|
500 |
|
---|
501 | /** @} */
|
---|
502 |
|
---|
503 | void WIN32API ODIN_SetExceptionHandler(void *pExceptionRegRec);
|
---|
504 | void WIN32API ODIN_UnsetExceptionHandler(void *pExceptionRegRec);
|
---|
505 |
|
---|
506 | /* Turn on CD Polling (window with 2 second timer to check CD disk presence) */
|
---|
507 | void WIN32API CustEnableCDPolling();
|
---|
508 |
|
---|
509 | void WIN32API SetFreeTypeIntegration(BOOL fEnabled);
|
---|
510 |
|
---|
511 | // Special function to change dwords in the startup structure of a process
|
---|
512 | void WINAPI ODIN_SetProcessDword( DWORD dwProcessID, INT offset, DWORD value );
|
---|
513 |
|
---|
514 | void WIN32API ODIN_SetPostscriptPassthrough(BOOL fEnable);
|
---|
515 | BOOL WIN32API ODIN_QueryPostscriptPassthrough();
|
---|
516 |
|
---|
517 | //PE headers of system dlls
|
---|
518 | extern IMAGE_FILE_HEADER nt_ntdll_header;
|
---|
519 | extern IMAGE_FILE_HEADER nt_gdi32_header;
|
---|
520 | extern IMAGE_FILE_HEADER nt_kernel32_header;
|
---|
521 | extern IMAGE_FILE_HEADER nt_user32_header;
|
---|
522 | extern IMAGE_FILE_HEADER nt_advapi32_header;
|
---|
523 | extern IMAGE_FILE_HEADER nt_version_header;
|
---|
524 | extern IMAGE_FILE_HEADER nt_wsock32_header;
|
---|
525 | extern IMAGE_FILE_HEADER nt_ws2_32_header;
|
---|
526 | extern IMAGE_FILE_HEADER nt_winmm_header;
|
---|
527 | extern IMAGE_FILE_HEADER nt_ole32_header;
|
---|
528 | extern IMAGE_FILE_HEADER nt_comctl32_header;
|
---|
529 | extern IMAGE_FILE_HEADER nt_shell32_header;
|
---|
530 | extern IMAGE_FILE_HEADER nt_comdlg32_header;
|
---|
531 | extern IMAGE_FILE_HEADER nt_winspool_header;
|
---|
532 | extern IMAGE_FILE_HEADER nt_ddraw_header;
|
---|
533 | extern IMAGE_FILE_HEADER nt_oleaut32_header;
|
---|
534 | extern IMAGE_FILE_HEADER nt_msvfw32_header;
|
---|
535 | extern IMAGE_FILE_HEADER nt_imm32os2_header;
|
---|
536 | extern IMAGE_FILE_HEADER nt_mpr_header;
|
---|
537 | extern IMAGE_FILE_HEADER nt_iphlpapi_header;
|
---|
538 | extern IMAGE_FILE_HEADER nt_olepro32_header;
|
---|
539 | extern IMAGE_FILE_HEADER nt_msvcrt_header;
|
---|
540 | extern IMAGE_FILE_HEADER nt_lz32_header;
|
---|
541 | extern IMAGE_FILE_HEADER nt_oledlg_header;
|
---|
542 | extern IMAGE_FILE_HEADER nt_riched32_header;
|
---|
543 | extern IMAGE_FILE_HEADER nt_psapi_header;
|
---|
544 | extern IMAGE_FILE_HEADER nt_rpcrt4_header;
|
---|
545 | extern IMAGE_FILE_HEADER nt_shlwapi_header;
|
---|
546 | extern IMAGE_FILE_HEADER nt_shfolder_header;
|
---|
547 | extern IMAGE_FILE_HEADER nt_wininet_header;
|
---|
548 | extern IMAGE_FILE_HEADER nt_olepro32_header;
|
---|
549 | extern IMAGE_FILE_HEADER nt_avifil32_header;
|
---|
550 | extern IMAGE_FILE_HEADER nt_dinput_header;
|
---|
551 | extern IMAGE_FILE_HEADER nt_dsound_header;
|
---|
552 | extern IMAGE_FILE_HEADER nt_uxtheme_header;
|
---|
553 | extern IMAGE_FILE_HEADER nt_mciwave_header;
|
---|
554 | extern IMAGE_FILE_HEADER nt_urlmon_header;
|
---|
555 | extern IMAGE_FILE_HEADER nt_netapi32_header;
|
---|
556 | extern IMAGE_FILE_HEADER nt_winscard_header;
|
---|
557 | extern IMAGE_FILE_HEADER nt_shdocvw_header;
|
---|
558 |
|
---|
559 | #ifdef __cplusplus
|
---|
560 | } // extern "C"
|
---|
561 | #endif
|
---|
562 |
|
---|
563 | #endif /*__CUSTOMBUILD_H__*/
|
---|
564 |
|
---|