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
RevLine 
[7061]1#ifndef __CUSTOMBUILD_H__
2#define __CUSTOMBUILD_H__
3
[7238]4//HKEY_LOCAL_MACHINE
5#define CUSTOM_BUILD_OPTIONS_KEY "System\\CustomBuild"
6#define DISABLE_AUDIO_KEY "DisableAudio"
[8095]7#define DISABLE_ASPI_KEY "DisableASPI"
[7238]8
[7061]9extern BOOL fCustomBuild;
10
[9596]11void WIN32API InitDirectoriesCustom(char *szSystemDir, char *szWindowsDir);
[7061]12
[9596]13void WIN32API DisableOdinIni();
[7061]14
[9596]15void WIN32API DisableOdinSysMenuItems();
[7246]16
[9596]17
[7763]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,
[7572]21 LPVOID lpInBuffer, DWORD nInBufferSize,
22 LPVOID lpOutBuffer, DWORD nOutBufferSize,
[7756]23 LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped,
[7763]24 LPVOID lpHandleData);
[7246]25
[9829]26typedef BOOL (* WIN32API PFNDRVREAD)(LPVOID lpDriverData,
[7763]27 HANDLE hDevice,
[7631]28 DWORD dwFlags,
[7572]29 LPCVOID lpBuffer,
30 DWORD nNumberOfBytesToRead,
31 LPDWORD lpNumberOfBytesRead,
32 LPOVERLAPPED lpOverlapped,
[7756]33 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
[7763]34 LPVOID lpHandleData);
[7572]35
[9829]36typedef BOOL (* WIN32API PFNDRVWRITE)(LPVOID lpDriverData,
[7763]37 HANDLE hDevice,
[7631]38 DWORD dwFlags,
[7572]39 LPCVOID lpBuffer,
40 DWORD nNumberOfBytesToWrite,
41 LPDWORD lpNumberOfBytesWrite,
42 LPOVERLAPPED lpOverlapped,
[7756]43 LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine,
[7763]44 LPVOID lpHandleData);
[7572]45
[7763]46typedef BOOL (* WIN32API PFNDRVCANCELIO)(LPVOID lpDriverData, HANDLE hDevice, DWORD dwFlags, PVOID lpHandleData);
[9829]47typedef DWORD (* WIN32API PFNDRVGETOVERLAPPEDRESULT)(LPVOID lpDriverData,
[7763]48 HANDLE hDevice,
[7631]49 DWORD dwFlags,
[7629]50 LPOVERLAPPED lpOverlapped,
51 LPDWORD lpcbTransfer,
[7756]52 BOOL fWait,
[7763]53 LPVOID lpHandleData);
[7572]54
[9829]55BOOL WIN32API RegisterCustomDriver(PFNDRVOPEN pfnDriverOpen, PFNDRVCLOSE pfnDriverClose,
[7572]56 PFNDRVIOCTL pfnDriverIOCtl, PFNDRVREAD pfnDriverRead,
[7629]57 PFNDRVWRITE pfnDriverWrite, PFNDRVCANCELIO pfnDriverCancelIo,
58 PFNDRVGETOVERLAPPEDRESULT pfnDriverGetOverlappedResult,
[7763]59 LPCSTR lpDriverName, LPVOID lpDriverData);
[7246]60
[7763]61BOOL WIN32API UnRegisterCustomDriver(LPCSTR lpDriverName);
[7247]62
[7763]63
[7247]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
[8132]67#define HODIN_PREDIALOGCREATION 0
68#define HODIN_POSTDIALOGCREATION 1
69#define HODIN_WINDOWCREATED 2
[7247]70
[8132]71HHOOK WIN32API SetOdinHookA(HOOKPROC proc );
72BOOL WIN32API UnhookOdinHook(HHOOK hhook);
73LRESULT HOOK_CallOdinHookA(INT code, WPARAM wParam, LPARAM lParam );
[7247]74
[8112]75//Override LoadImage function
76typedef void (* WIN32API PFNLOADIMAGEW)(HINSTANCE *phinst, LPWSTR *lplpszName, UINT *lpuType);
[7251]77
[8112]78BOOL WIN32API SetCustomLoadImage(PFNLOADIMAGEW pfnLoadImageW);
[8012]79
[7251]80//Set the default language in kernel32
81void WIN32API SetDefaultLanguage(DWORD deflang);
82
[7621]83//Override pm keyboard hook dll name
84void WIN32API SetCustomPMHookDll(LPSTR pszKbdDllName);
[7251]85
[8736]86void WIN32API DisableDragDrop(BOOL fDisabled);
[8733]87
[7674]88//Turn off wave audio in winmm
89void WIN32API DisableWaveAudio();
90
[8947]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
[9829]97//Override shared semaphore name used to synchronize global window handle
[8656]98//array access (to avoid name clash with Odin)
99void WIN32API SetCustomWndHandleSemName(LPSTR pszSemName);
100
[9829]101//Override shared semaphore name used to synchronize global memory map
[8658]102//list access (to avoid name clash with Odin)
103void WIN32API SetCustomMMapSemName(LPSTR pszSemName);
104
[8095]105//Turn off ASPI
106void WIN32API DisableASPI();
107
[7943]108//force color to mono cursor conversion
109void WIN32API CustForceMonoCursor();
110
[8408]111//force GetVolumeInformation to tell the app all partitions are FAT
112void WIN32API CustForce2GBFileSize();
113
[8833]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
[8929]120//Disable OS2CDROM.DMD aspi support
121void WIN32API DisableCDIo();
[8833]122
[8987]123//Force DirectDraw to report only one fullscreen mode
124void WIN32API SetCustomFullScreenMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP);
125
[9156]126//Force DirectSurface Lock & Unlock methods to hide & show the mouse cursor
127BOOL WIN32API SetCustomHideCursorOnLock(BOOL state);
128
[9302]129//Call to enable access to physical disks or volumes (default is disabled)
130void WIN32API EnablePhysicalDiskAccess(BOOL fEnable);
131
[9829]132//Override a system color without forcing a desktop repaint (which
[9444]133//SetSysColors does)
134BOOL WIN32API ODIN_SetSysColors(INT nChanges, const INT *lpSysColor,
135 const COLORREF *lpColorValues);
136
[9484]137//Override loader names (PEC, PE, W16ODIN)
138BOOL WIN32API ODIN_SetLoaders(LPCSTR pszPECmdLoader, LPCSTR pszPEGUILoader,
139 LPCSTR pszNELoader);
140
[9494]141//Returns path of loaders
142BOOL WIN32API ODIN_QueryLoaders(LPSTR pszPECmdLoader, INT cchPECmdLoader,
143 LPSTR pszPEGUILoader, INT cchPEGUILoader,
144 LPSTR pszNELoader, INT cchNELoader);
145
[9849]146//Checks whether program is LX or PE
147BOOL WIN32API ODIN_IsWin32App(LPSTR lpszProgramPath);
148
[9484]149//Custom build function to disable loading of LX dlls
150void WIN32API ODIN_DisableLXDllLoading();
151
[9829]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);
[9616]163
[9829]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
[9616]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
[9829]194
[9616]195//******************************************************************************
196// ODIN_SetProcAddress: Override a dll export
[9829]197//
[9616]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
[9798]209//******************************************************************************
210// ODIN_SetTIBSwitch: override TIB switching
[9829]211//
[9798]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
[9898]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
[7061]229#endif /*__CUSTOMBUILD_H__*/
230
Note: See TracBrowser for help on using the repository browser.