source: trunk/include/custombuild.h@ 9969

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

PF: Functions for setting custom frame/cd/window class names

File size: 11.3 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
91//Override shared semaphore name used to synchronize global window handle
92//array access (to avoid name clash with Odin)
93void WIN32API SetCustomWndHandleSemName(LPSTR pszSemName);
94
95//Override shared semaphore name used to synchronize global memory map
96//list access (to avoid name clash with Odin)
97void WIN32API SetCustomMMapSemName(LPSTR pszSemName);
98
99//Override std class names used in Odin
100void WIN32API SetCustomCDClassName(LPSTR pszCDClassName);
101void WIN32API SetCustomStdClassName(LPSTR pszStdClassName);
102void WIN32API SetCustomStdFrameClassName(LPSTR pszStdFrameClassName);
103
104//Turn off ASPI
105void WIN32API DisableASPI();
106
107//force color to mono cursor conversion
108void WIN32API CustForceMonoCursor();
109
110//force GetVolumeInformation to tell the app all partitions are FAT
111void WIN32API CustForce2GBFileSize();
112
113//Logging of exceptions:
114//Override filename of exception log (expects full path)
115void WIN32API SetCustomExceptionLog(LPSTR lpszLogName);
116//Enable/disable exception logging
117void WIN32API SetExceptionLogging(BOOL fEnable);
118
119//Disable OS2CDROM.DMD aspi support
120void WIN32API DisableCDIo();
121
122//Force DirectDraw to report only one fullscreen mode
123void WIN32API SetCustomFullScreenMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP);
124
125//Force DirectSurface Lock & Unlock methods to hide & show the mouse cursor
126BOOL WIN32API SetCustomHideCursorOnLock(BOOL state);
127
128//Call to enable access to physical disks or volumes (default is disabled)
129void WIN32API EnablePhysicalDiskAccess(BOOL fEnable);
130
131//Override a system color without forcing a desktop repaint (which
132//SetSysColors does)
133BOOL WIN32API ODIN_SetSysColors(INT nChanges, const INT *lpSysColor,
134 const COLORREF *lpColorValues);
135
136//Override loader names (PEC, PE, W16ODIN)
137BOOL WIN32API ODIN_SetLoaders(LPCSTR pszPECmdLoader, LPCSTR pszPEGUILoader,
138 LPCSTR pszNELoader);
139
140//Returns path of loaders
141BOOL WIN32API ODIN_QueryLoaders(LPSTR pszPECmdLoader, INT cchPECmdLoader,
142 LPSTR pszPEGUILoader, INT cchPEGUILoader,
143 LPSTR pszNELoader, INT cchNELoader);
144
145//Checks whether program is LX or PE
146BOOL WIN32API ODIN_IsWin32App(LPSTR lpszProgramPath);
147
148//Custom build function to disable loading of LX dlls
149void WIN32API ODIN_DisableLXDllLoading();
150
151/**
152 * LoadLibrary*() callback function registered using ODIN_SetLxDllLoadCallback().
153 * This is called for all LX modules which are loaded by LoadLibrary.
154 *
155 * @returns TRUE loading should succeed. The DLL is now registered.
156 * @returns FALSE loading should fail.
157 * @param hmodOS2 The OS/2 module handle.
158 * @param hInstance The Odin instance handle.
159 * If not NULL this means that the DLL is registered.
160 */
161typedef BOOL (* WIN32API PFNLXDLLLOAD)(HMODULE hmodOS2, HINSTANCE hInstance);
162
163/** Custombuild API for registering a callback for LX Dll loading thru LoadLibrary*(). */
164BOOL WIN32API ODIN_SetLxDllLoadCallback(PFNLXDLLLOAD pfn);
165
166/**
167 * FreeLibrary*() callback function registered using ODIN_SetLxDllUnLoadCallback().
168 * This is called when an LX which was previously loaded using LoadLibrary*() is
169 * finally freed from Odin. The callback servers mainly the purpose of cleaning
170 * up any data associated with the DLL.
171 *
172 * It is called *AFTER* the module is freed from Odin but before it's actually
173 * unloaded from the OS/2 process. This means that the OS/2 handle is valid while
174 * the Odin handle is invalid.
175 *
176 * @param hmodOS2 The OS/2 module handle.
177 * @param hInstance The Odin instance handle (invalid!).
178 * @remark It likely that this callback will be called for more DLLs than the
179 * load callback. Do check handles properly.
180 */
181typedef void (* WIN32API PFNLXDLLUNLOAD)(HMODULE hmodOS2, HINSTANCE hInstance);
182
183BOOL WIN32API ODIN_SetLxDllUnLoadCallback(PFNLXDLLUNLOAD pfn);
184
185
186//******************************************************************************
187//Install a handler that is called before the entrypoint of a dll (DLL_PROCESS_ATTACH)
188//******************************************************************************
189typedef void (* WIN32API ODINPROC_DLLLOAD)(HMODULE hModule);
190
191BOOL WIN32API ODIN_SetDllLoadCallback(ODINPROC_DLLLOAD pfnMyDllLoad);
192
193
194//******************************************************************************
195// ODIN_SetProcAddress: Override a dll export
196//
197// Parameters:
198// HMODULE hModule Module handle
199// LPCSTR lpszProc Export name or ordinal
200// FARPROC pfnNewProc New export function address
201//
202// Returns: Success -> old address of export
203// Failure -> -1
204//
205//******************************************************************************
206FARPROC WIN32API ODIN_SetProcAddress(HMODULE hModule, LPCSTR lpszProc, FARPROC pfnNewProc);
207
208//******************************************************************************
209// ODIN_SetTIBSwitch: override TIB switching
210//
211// Parameters:
212// BOOL fSwitchTIB
213// FALSE -> no TIB selector switching
214// TRUE -> force TIB selector switching
215//
216//******************************************************************************
217void WIN32API ODIN_SetTIBSwitch(BOOL fSwitchTIB);
218
219//******************************************************************************
220// ODIN_DisableFolderShellLink
221//
222// Disable object creation in Odin folder. Desktop shortcuts will still be
223// created as WPS objects on the desktop.
224//
225//******************************************************************************
226void WIN32API ODIN_DisableFolderShellLink();
227
228//******************************************************************************
229// ODIN_waveOutSetFixedBuffers
230//
231// Tell WINMM to use DART buffers of the same size as the first buffer delivered
232// by waveOutWrite
233//
234// NOTE: This will only work in very specific cases; it is not a good general
235// purpose solution.
236//
237//******************************************************************************
238void WIN32API ODIN_waveOutSetFixedBuffers();
239
240#define SetFixedWaveBufferSize ODIN_waveOutSetFixedBuffers
241
242//******************************************************************************
243// ODIN_waveInSetFixedBuffers
244//
245// Tell WINMM to use DART buffers of the same size as the first buffer delivered
246// by waveInAddBuffer
247//
248// NOTE: This will only work in very specific cases; it is not a good general
249// purpose solution.
250//
251//******************************************************************************
252void WIN32API ODIN_waveInSetFixedBuffers();
253
254
255/** Enter odin context with this thread. */
256USHORT WIN32API ODIN_ThreadEnterOdinContext(void *pExceptionRegRec, BOOL fForceFSSwitch);
257/** Leave odin context with this thread. */
258void WIN32API ODIN_ThreadLeaveOdinContext(void *pExceptionRegRec, USHORT selFSOld);
259
260/** Leave odin context to call back into OS/2 code. */
261USHORT WIN32API ODIN_ThreadLeaveOdinContextNested(void *pExceptionRegRec, BOOL fRemoveOdinExcpt);
262/** Re-enter Odin context after being back in OS/2 code. */
263void WIN32API ODIN_ThreadEnterOdinContextNested(void *pExceptionRegRec, BOOL fRestoreOdinExcpt, USHORT selFSOld);
264
265
266#endif /*__CUSTOMBUILD_H__*/
267
Note: See TracBrowser for help on using the repository browser.