Release 970202
[wine/multimedia.git] / win32 / process.c
blobe403cdeb50759991275546f7ea9f4a3898b6fc0c
1 /*
2 * Win32 kernel functions
4 * Copyright 1995 Martin von Loewis
5 */
7 #include <stdio.h>
8 #include <string.h>
9 #include <unistd.h>
10 #include "windows.h"
11 #include "winerror.h"
12 #include "heap.h"
13 #include "handle32.h"
14 #include "pe_image.h"
15 #include "stddebug.h"
16 #include "debug.h"
18 /***********************************************************************
19 * CreateMutexA (KERNEL32.52)
21 HANDLE32 CreateMutexA (SECURITY_ATTRIBUTES *sa, BOOL on, const char *a)
23 return 0;
26 /***********************************************************************
27 * ReleaseMutex (KERNEL32.435)
29 BOOL ReleaseMutex (HANDLE32 h)
31 return 0;
34 /***********************************************************************
35 * CreateEventA (KERNEL32.43)
37 HANDLE32 CreateEventA (SECURITY_ATTRIBUTES *sa, BOOL au, BOOL on, const char
38 *name)
40 return 0;
42 /***********************************************************************
43 * SetEvent (KERNEL32.487)
45 BOOL SetEvent (HANDLE32 h)
47 return 0;
49 /***********************************************************************
50 * ResetEvent (KERNEL32.439)
52 BOOL ResetEvent (HANDLE32 h)
54 return 0;
56 /***********************************************************************
57 * WaitForSingleObject (KERNEL32.561)
59 DWORD WaitForSingleObject(HANDLE32 h, DWORD a)
61 return 0;
63 /***********************************************************************
64 * DuplicateHandle (KERNEL32.78)
66 BOOL DuplicateHandle(HANDLE32 a, HANDLE32 b, HANDLE32 c, HANDLE32 * d, DWORD e, BOOL f, DWORD g)
68 *d = b;
69 return 1;
73 /***********************************************************************
74 * LoadLibraryA (KERNEL32.365)
75 * copied from LoadLibrary
76 * This does not currently support built-in libraries
78 HINSTANCE32 LoadLibrary32A(LPCSTR libname)
80 HINSTANCE32 handle;
81 dprintf_module( stddeb, "LoadLibrary: (%08x) %s\n", (int)libname, libname);
82 handle = LoadModule( libname, (LPVOID)-1 );
83 if (handle == (HINSTANCE32) -1)
85 char buffer[256];
86 strcpy( buffer, libname );
87 strcat( buffer, ".dll" );
88 handle = LoadModule( buffer, (LPVOID)-1 );
90 /* Obtain module handle and call initialization function */
91 #ifndef WINELIB
92 if (handle >= (HINSTANCE32)32) PE_InitializeDLLs( GetExePtr(handle));
93 #endif
94 return handle;
97 /***********************************************************************
98 * LoadLibrary32W (KERNEL32.368)
100 HINSTANCE32 LoadLibrary32W(LPCWSTR libnameW)
102 LPSTR libnameA = HEAP_strdupWtoA( GetProcessHeap(), 0, libnameW );
103 HINSTANCE32 ret = LoadLibrary32A( libnameA );
104 HeapFree( GetProcessHeap(), 0, libnameA );
105 return ret;
108 /***********************************************************************
109 * FreeLibrary
111 BOOL FreeLibrary32(HINSTANCE32 hLibModule)
113 fprintf(stderr,"FreeLibrary: empty stub\n");
114 return TRUE;
117 /**********************************************************************
118 * GetProcessAffinityMask
120 BOOL GetProcessAffinityMask(HANDLE32 hProcess, LPDWORD lpProcessAffinityMask,
121 LPDWORD lpSystemAffinityMask)
123 dprintf_task(stddeb,"GetProcessAffinityMask(%x,%lx,%lx)\n",
124 hProcess,(lpProcessAffinityMask?*lpProcessAffinityMask:0),
125 (lpSystemAffinityMask?*lpSystemAffinityMask:0));
126 /* It is definitely important for a process to know on what processor
127 it is running :-) */
128 if(lpProcessAffinityMask)
129 *lpProcessAffinityMask=1;
130 if(lpSystemAffinityMask)
131 *lpSystemAffinityMask=1;
132 return TRUE;
135 /**********************************************************************
136 * SetThreadAffinityMask
138 BOOL SetThreadAffinityMask(HANDLE32 hThread, DWORD dwThreadAffinityMask)
140 dprintf_task(stddeb,"SetThreadAffinityMask(%x,%lx)\n",hThread,
141 dwThreadAffinityMask);
142 /* FIXME: We let it fail */
143 return 1;