source: trunk/include/custombuild.h@ 9898

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

update

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