2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis
16 /***********************************************************************
17 * ExitProcess (KERNEL32.100)
20 void ExitProcess(DWORD status
)
25 /***********************************************************************
26 * CreateMutexA (KERNEL32.52)
28 WINAPI HANDLE32
CreateMutexA (SECURITY_ATTRIBUTES
*sa
, BOOL on
, const char *a
)
33 /***********************************************************************
34 * ReleaseMutex (KERNEL32.435)
36 WINAPI BOOL
ReleaseMutex (HANDLE32 h
)
41 /***********************************************************************
42 * CreateEventA (KERNEL32.43)
44 WINAPI HANDLE32
CreateEventA (SECURITY_ATTRIBUTES
*sa
, BOOL au
, BOOL on
, const char
49 /***********************************************************************
50 * SetEvent (KERNEL32.487)
52 WINAPI BOOL
SetEvent (HANDLE32 h
)
56 /***********************************************************************
57 * ResetEvent (KERNEL32.439)
59 WINAPI BOOL
ResetEvent (HANDLE32 h
)
63 /***********************************************************************
64 * WaitForSingleObject (KERNEL32.561)
66 DWORD WINAPI
WaitForSingleObject(HANDLE32 h
, DWORD a
)
70 /***********************************************************************
71 * DuplicateHandle (KERNEL32.78)
73 BOOL WINAPI
DuplicateHandle(HANDLE32 a
, HANDLE32 b
, HANDLE32 c
, HANDLE32
* d
, DWORD e
, BOOL f
, DWORD g
)
78 /***********************************************************************
79 * GetCurrentProcess (KERNEL32.198)
81 HANDLE32 WINAPI
GetCurrentProcess(void)
86 /***********************************************************************
87 * LoadLibraryA (KERNEL32.365)
88 * copied from LoadLibrary
89 * This does not currently support built-in libraries
91 HANDLE32 WINAPI
LoadLibraryA(char *libname
)
94 dprintf_module( stddeb
, "LoadLibrary: (%08x) %s\n", (int)libname
, libname
);
95 handle
= LoadModule( libname
, (LPVOID
)-1 );
96 if (handle
== (HANDLE
) -1)
99 strcpy( buffer
, libname
);
100 strcat( buffer
, ".dll" );
101 handle
= LoadModule( buffer
, (LPVOID
)-1 );
103 /* Obtain module handle and call initialization function */
105 if (handle
>= (HANDLE
)32) PE_InitializeDLLs( GetExePtr(handle
));
112 /***********************************************************************
113 * WIN32_GetProcAddress
115 void* WINAPI
WIN32_GetProcAddress(HANDLE32 hModule
, char* function
)
117 dprintf_module( stddeb
, "WIN32_GetProcAddress(%08x,%s)\n",
119 return PE_GetProcAddress(GetExePtr(hModule
),function
);