source: trunk/include/custombuild.h@ 10010

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

Added custom build function to disable DirectAudio (always use DART)

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