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
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
[9829]91//Override shared semaphore name used to synchronize global window handle
[8656]92//array access (to avoid name clash with Odin)
93void WIN32API SetCustomWndHandleSemName(LPSTR pszSemName);
94
[9829]95//Override shared semaphore name used to synchronize global memory map
[8658]96//list access (to avoid name clash with Odin)
97void WIN32API SetCustomMMapSemName(LPSTR pszSemName);
98
[9964]99//Override std class names used in Odin
100void WIN32API SetCustomCDClassName(LPSTR pszCDClassName);
101void WIN32API SetCustomStdClassName(LPSTR pszStdClassName);
102void WIN32API SetCustomStdFrameClassName(LPSTR pszStdFrameClassName);
103
[8095]104//Turn off ASPI
105void WIN32API DisableASPI();
106
[7943]107//force color to mono cursor conversion
108void WIN32API CustForceMonoCursor();
109
[8408]110//force GetVolumeInformation to tell the app all partitions are FAT
111void WIN32API CustForce2GBFileSize();
112
[8833]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
[8929]119//Disable OS2CDROM.DMD aspi support
120void WIN32API DisableCDIo();
[8833]121
[8987]122//Force DirectDraw to report only one fullscreen mode
123void WIN32API SetCustomFullScreenMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP);
124
[9156]125//Force DirectSurface Lock & Unlock methods to hide & show the mouse cursor
126BOOL WIN32API SetCustomHideCursorOnLock(BOOL state);
127
[9302]128//Call to enable access to physical disks or volumes (default is disabled)
129void WIN32API EnablePhysicalDiskAccess(BOOL fEnable);
130
[9829]131//Override a system color without forcing a desktop repaint (which
[9444]132//SetSysColors does)
133BOOL WIN32API ODIN_SetSysColors(INT nChanges, const INT *lpSysColor,
134 const COLORREF *lpColorValues);
135
[9484]136//Override loader names (PEC, PE, W16ODIN)
137BOOL WIN32API ODIN_SetLoaders(LPCSTR pszPECmdLoader, LPCSTR pszPEGUILoader,
138 LPCSTR pszNELoader);
139
[9494]140//Returns path of loaders
141BOOL WIN32API ODIN_QueryLoaders(LPSTR pszPECmdLoader, INT cchPECmdLoader,
142 LPSTR pszPEGUILoader, INT cchPEGUILoader,
143 LPSTR pszNELoader, INT cchNELoader);
144
[9849]145//Checks whether program is LX or PE
146BOOL WIN32API ODIN_IsWin32App(LPSTR lpszProgramPath);
147
[9484]148//Custom build function to disable loading of LX dlls
149void WIN32API ODIN_DisableLXDllLoading();
150
[9829]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);
[9616]162
[9829]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
[9616]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
[9829]193
[9616]194//******************************************************************************
195// ODIN_SetProcAddress: Override a dll export
[9829]196//
[9616]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
[9798]208//******************************************************************************
209// ODIN_SetTIBSwitch: override TIB switching
[9829]210//
[9798]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
[9898]219//******************************************************************************
220// ODIN_DisableFolderShellLink
221//
[9909]222// Disable object creation in Odin folder. Desktop shortcuts will still be
[9898]223// created as WPS objects on the desktop.
224//
225//******************************************************************************
226void WIN32API ODIN_DisableFolderShellLink();
227
[9900]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.
[9909]236//
[9900]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.
[9909]250//
[9900]251//******************************************************************************
252void WIN32API ODIN_waveInSetFixedBuffers();
253
[9909]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
[7061]266#endif /*__CUSTOMBUILD_H__*/
267
Note: See TracBrowser for help on using the repository browser.