source: trunk/include/custombuild.h@ 10237

Last change on this file since 10237 was 10237, checked in by sandervl, 22 years ago

Do not create CD polling window by default. It can cause PM hangs. (IOCtl blocks indefinitely)

File size: 11.5 KB
Line 
1#ifndef __CUSTOMBUILD_H__
2#define __CUSTOMBUILD_H__
3
4//HKEY_LOCAL_MACHINE
5#define CUSTOM_BUILD_OPTIONS_KEY "System\\CustomBuild"
6#define DISABLE_AUDIO_KEY "DisableAudio"
7#define DISABLE_ASPI_KEY "DisableASPI"
8
9extern BOOL fCustomBuild;
10
11void WIN32API InitDirectoriesCustom(char *szSystemDir, char *szWindowsDir);
12
13void WIN32API DisableOdinIni();
14
15void WIN32API DisableOdinSysMenuItems();
16
17
18typedef HANDLE (* WIN32API PFNDRVOPEN)(LPVOID lpDriverData, DWORD dwAccess, DWORD dwShare, DWORD dwFlags, PVOID *ppHandleData);
19typedef void (* WIN32API PFNDRVCLOSE)(LPVOID lpDriverData, HANDLE hDevice, DWORD dwFlags, PVOID lpHandleData);
20typedef BOOL (* WIN32API PFNDRVIOCTL)(LPVOID lpDriverData, HANDLE hDevice, DWORD dwFlags, DWORD dwIoControlCode,
21 LPVOID lpInBuffer, DWORD nInBufferSize,
22 LPVOID lpOutBuffer, DWORD nOutBufferSize,
23 LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped,
24 LPVOID lpHandleData);
25
26typedef BOOL (* WIN32API PFNDRVREAD)(LPVOID lpDriverData,
27 HANDLE hDevice,
28 DWORD dwFlags,
29 LPCVOID lpBuffer,
30 DWORD nNumberOfBytesToRead,
31 LPDWORD lpNumberOfBytesRead,
32 LPOVERLAPPED lpOverlapped,
33 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
34 LPVOID lpHandleData);
35
36typedef BOOL (* WIN32API PFNDRVWRITE)(LPVOID lpDriverData,
37 HANDLE hDevice,
38 DWORD dwFlags,
39 LPCVOID lpBuffer,
40 DWORD nNumberOfBytesToWrite,
41 LPDWORD lpNumberOfBytesWrite,
42 LPOVERLAPPED lpOverlapped,
43 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
44 LPVOID lpHandleData);
45
46typedef BOOL (* WIN32API PFNDRVCANCELIO)(LPVOID lpDriverData, HANDLE hDevice, DWORD dwFlags, PVOID lpHandleData);
47typedef DWORD (* WIN32API PFNDRVGETOVERLAPPEDRESULT)(LPVOID lpDriverData,
48 HANDLE hDevice,
49 DWORD dwFlags,
50 LPOVERLAPPED lpOverlapped,
51 LPDWORD lpcbTransfer,
52 BOOL fWait,
53 LPVOID lpHandleData);
54
55BOOL WIN32API RegisterCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose,
56 PFNDRVIOCTL pfnDriverIOCtl, PFNDRVREAD pfnDriverRead,
57 PFNDRVWRITE pfnDriverWrite, PFNDRVCANCELIO pfnDriverCancelIo,
58 PFNDRVGETOVERLAPPEDRESULT pfnDriverGetOverlappedResult,
59 LPCSTR lpDriverName, LPVOID lpDriverData);
60
61BOOL WIN32API UnRegisterCustomDriver(LPCSTR lpDriverName);
62
63
64//SetDialogHook can be used by a custom Odin build to register a hook procedure
65//that gets called before or after dialog creation
66
67#define HODIN_PREDIALOGCREATION 0
68#define HODIN_POSTDIALOGCREATION 1
69#define HODIN_WINDOWCREATED 2
70
71HHOOK WIN32API SetOdinHookA(HOOKPROC proc );
72BOOL WIN32API UnhookOdinHook(HHOOK hhook);
73LRESULT HOOK_CallOdinHookA(INT code, WPARAM wParam, LPARAM lParam );
74
75//Override LoadImage function
76typedef void (* WIN32API PFNLOADIMAGEW)(HINSTANCE *phinst, LPWSTR *lplpszName, UINT *lpuType);
77
78BOOL WIN32API SetCustomLoadImage(PFNLOADIMAGEW pfnLoadImageW);
79
80//Set the default language in kernel32
81void WIN32API SetDefaultLanguage(DWORD deflang);
82
83//Override pm keyboard hook dll name
84void WIN32API SetCustomPMHookDll(LPSTR pszKbdDllName);
85
86void WIN32API DisableDragDrop(BOOL fDisabled);
87
88//Turn off wave audio in winmm
89void WIN32API DisableWaveAudio();
90//Turn off usage of the Uniaud DirectAudio interface
91void WIN32API DisableDirectAudio();
92
93//Override shared semaphore name used to synchronize global window handle
94//array access (to avoid name clash with Odin)
95void WIN32API SetCustomWndHandleSemName(LPSTR pszSemName);
96
97//Override shared semaphore name used to synchronize global memory map
98//list access (to avoid name clash with Odin)
99void WIN32API SetCustomMMapSemName(LPSTR pszSemName);
100
101//Override std class names used in Odin
102void WIN32API SetCustomCDClassName(LPSTR pszCDClassName);
103void WIN32API SetCustomStdClassName(LPSTR pszStdClassName);
104void WIN32API SetCustomStdFrameClassName(LPSTR pszStdFrameClassName);
105
106//Turn off ASPI
107void WIN32API DisableASPI();
108
109//force color to mono cursor conversion
110void WIN32API CustForceMonoCursor();
111
112//force GetVolumeInformation to tell the app all partitions are FAT
113void WIN32API CustForce2GBFileSize();
114
115//Logging of exceptions:
116//Override filename of exception log (expects full path)
117void WIN32API SetCustomExceptionLog(LPSTR lpszLogName);
118//Enable/disable exception logging
119void WIN32API SetExceptionLogging(BOOL fEnable);
120
121//Disable OS2CDROM.DMD aspi support
122void WIN32API DisableCDIo();
123
124//Force DirectDraw to report only one fullscreen mode
125void WIN32API SetCustomFullScreenMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP);
126
127//Force DirectSurface Lock & Unlock methods to hide & show the mouse cursor
128BOOL WIN32API SetCustomHideCursorOnLock(BOOL state);
129
130//Call to enable access to physical disks or volumes (default is disabled)
131void WIN32API EnablePhysicalDiskAccess(BOOL fEnable);
132
133//Override a system color without forcing a desktop repaint (which
134//SetSysColors does)
135BOOL WIN32API ODIN_SetSysColors(INT nChanges, const INT *lpSysColor,
136 const COLORREF *lpColorValues);
137
138//Override loader names (PEC, PE, W16ODIN)
139BOOL WIN32API ODIN_SetLoaders(LPCSTR pszPECmdLoader, LPCSTR pszPEGUILoader,
140 LPCSTR pszNELoader);
141
142//Returns path of loaders
143BOOL WIN32API ODIN_QueryLoaders(LPSTR pszPECmdLoader, INT cchPECmdLoader,
144 LPSTR pszPEGUILoader, INT cchPEGUILoader,
145 LPSTR pszNELoader, INT cchNELoader);
146
147//Checks whether program is LX or PE
148BOOL WIN32API ODIN_IsWin32App(LPSTR lpszProgramPath);
149
150//Custom build function to disable loading of LX dlls
151void WIN32API ODIN_DisableLXDllLoading();
152
153/**
154 * LoadLibrary*() callback function registered using ODIN_SetLxDllLoadCallback().
155 * This is called for all LX modules which are loaded by LoadLibrary.
156 *
157 * @returns TRUE loading should succeed. The DLL is now registered.
158 * @returns FALSE loading should fail.
159 * @param hmodOS2 The OS/2 module handle.
160 * @param hInstance The Odin instance handle.
161 * If not NULL this means that the DLL is registered.
162 */
163typedef BOOL (* WIN32API PFNLXDLLLOAD)(HMODULE hmodOS2, HINSTANCE hInstance);
164
165/** Custombuild API for registering a callback for LX Dll loading thru LoadLibrary*(). */
166BOOL WIN32API ODIN_SetLxDllLoadCallback(PFNLXDLLLOAD pfn);
167
168/**
169 * FreeLibrary*() callback function registered using ODIN_SetLxDllUnLoadCallback().
170 * This is called when an LX which was previously loaded using LoadLibrary*() is
171 * finally freed from Odin. The callback servers mainly the purpose of cleaning
172 * up any data associated with the DLL.
173 *
174 * It is called *AFTER* the module is freed from Odin but before it's actually
175 * unloaded from the OS/2 process. This means that the OS/2 handle is valid while
176 * the Odin handle is invalid.
177 *
178 * @param hmodOS2 The OS/2 module handle.
179 * @param hInstance The Odin instance handle (invalid!).
180 * @remark It likely that this callback will be called for more DLLs than the
181 * load callback. Do check handles properly.
182 */
183typedef void (* WIN32API PFNLXDLLUNLOAD)(HMODULE hmodOS2, HINSTANCE hInstance);
184
185BOOL WIN32API ODIN_SetLxDllUnLoadCallback(PFNLXDLLUNLOAD pfn);
186
187
188//******************************************************************************
189//Install a handler that is called before the entrypoint of a dll (DLL_PROCESS_ATTACH)
190//******************************************************************************
191typedef void (* WIN32API ODINPROC_DLLLOAD)(HMODULE hModule);
192
193BOOL WIN32API ODIN_SetDllLoadCallback(ODINPROC_DLLLOAD pfnMyDllLoad);
194
195
196//******************************************************************************
197// ODIN_SetProcAddress: Override a dll export
198//
199// Parameters:
200// HMODULE hModule Module handle
201// LPCSTR lpszProc Export name or ordinal
202// FARPROC pfnNewProc New export function address
203//
204// Returns: Success -> old address of export
205// Failure -> -1
206//
207//******************************************************************************
208FARPROC WIN32API ODIN_SetProcAddress(HMODULE hModule, LPCSTR lpszProc, FARPROC pfnNewProc);
209
210//******************************************************************************
211// ODIN_SetTIBSwitch: override TIB switching
212//
213// Parameters:
214// BOOL fSwitchTIB
215// FALSE -> no TIB selector switching
216// TRUE -> force TIB selector switching
217//
218//******************************************************************************
219void WIN32API ODIN_SetTIBSwitch(BOOL fSwitchTIB);
220
221//******************************************************************************
222// ODIN_DisableFolderShellLink
223//
224// Disable object creation in Odin folder. Desktop shortcuts will still be
225// created as WPS objects on the desktop.
226//
227//******************************************************************************
228void WIN32API ODIN_DisableFolderShellLink();
229
230//******************************************************************************
231// ODIN_waveOutSetFixedBuffers
232//
233// Tell WINMM to use DART buffers of the same size as the first buffer delivered
234// by waveOutWrite
235//
236// NOTE: This will only work in very specific cases; it is not a good general
237// purpose solution.
238//
239//******************************************************************************
240void WIN32API ODIN_waveOutSetFixedBuffers();
241
242#define SetFixedWaveBufferSize ODIN_waveOutSetFixedBuffers
243
244//******************************************************************************
245// ODIN_waveInSetFixedBuffers
246//
247// Tell WINMM to use DART buffers of the same size as the first buffer delivered
248// by waveInAddBuffer
249//
250// NOTE: This will only work in very specific cases; it is not a good general
251// purpose solution.
252//
253//******************************************************************************
254void WIN32API ODIN_waveInSetFixedBuffers();
255
256
257/** Enter odin context with this thread. */
258USHORT WIN32API ODIN_ThreadEnterOdinContext(void *pExceptionRegRec, BOOL fForceFSSwitch);
259/** Leave odin context with this thread. */
260void WIN32API ODIN_ThreadLeaveOdinContext(void *pExceptionRegRec, USHORT selFSOld);
261
262/** Leave odin context to call back into OS/2 code. */
263USHORT WIN32API ODIN_ThreadLeaveOdinContextNested(void *pExceptionRegRec, BOOL fRemoveOdinExcpt);
264/** Re-enter Odin context after being back in OS/2 code. */
265void WIN32API ODIN_ThreadEnterOdinContextNested(void *pExceptionRegRec, BOOL fRestoreOdinExcpt, USHORT selFSOld);
266
267/* Turn on CD Polling (window with 2 second timer to check CD disk presence) */
268void WIN32API CustEnableCDPolling();
269
270#endif /*__CUSTOMBUILD_H__*/
271
Note: See TracBrowser for help on using the repository browser.