Release 980517
[wine/multimedia.git] / win32 / newfns.c
bloba8c0a63302ddb97cd289608104d85a83c4e17e43
1 /*
2 * Win32 miscellaneous functions
4 * Copyright 1995 Thomas Sandford (tdgsandf@prds-grn.demon.co.uk)
5 */
7 /* Misc. new functions - they should be moved into appropriate files
8 at a later date. */
10 #include <stdio.h>
11 #include <string.h>
12 #include <sys/time.h>
13 #include <unistd.h>
14 #include "windows.h"
15 #include "winnt.h"
16 #include "winerror.h"
17 #include "heap.h"
18 #include "debug.h"
20 /****************************************************************************
21 * UTRegister (KERNEL32.697)
23 BOOL32 WINAPI UTRegister(HMODULE32 hModule,
24 LPSTR lpsz16BITDLL,
25 LPSTR lpszInitName,
26 LPSTR lpszProcName,
27 /*UT32PROC*/ LPVOID *ppfn32Thunk,
28 /*FARPROC*/ LPVOID pfnUT32CallBack,
29 LPVOID lpBuff)
31 fprintf(stderr, "UTRegister(%#x,...): stub!\n",hModule);
32 return TRUE;
35 /****************************************************************************
36 * UTUnRegister (KERNEL32.698)
38 BOOL32 WINAPI UTUnRegister(HMODULE32 hModule)
40 fprintf(stderr, "UTUnRegister(%#x: stub!\n", hModule);
41 return TRUE;
45 /****************************************************************************
46 * QueryPerformanceCounter (KERNEL32.564)
48 BOOL32 WINAPI QueryPerformanceCounter(LPLARGE_INTEGER counter)
50 struct timeval tv;
52 gettimeofday(&tv,NULL);
53 counter->LowPart = tv.tv_usec+tv.tv_sec*1000000;
54 counter->HighPart = 0;
55 return TRUE;
58 HANDLE32 WINAPI FindFirstChangeNotification32A(LPCSTR lpPathName,BOOL32 bWatchSubtree,DWORD dwNotifyFilter) {
59 FIXME(file,"(%s,%d,%08lx): stub\n",
60 lpPathName,bWatchSubtree,dwNotifyFilter);
61 return 0xcafebabe;
64 BOOL32 WINAPI FindNextChangeNotification(HANDLE32 fcnhandle) {
65 FIXME(file,"(%08x): stub!\n",fcnhandle);
66 return FALSE;
69 /****************************************************************************
70 * QueryPerformanceFrequency (KERNEL32.565)
72 BOOL32 WINAPI QueryPerformanceFrequency(LPLARGE_INTEGER frequency)
74 frequency->LowPart = 1000000;
75 frequency->HighPart = 0;
76 return TRUE;
79 /****************************************************************************
80 * DeviceIoControl (KERNEL32.188)
82 BOOL32 WINAPI DeviceIoControl(HANDLE32 hDevice, DWORD dwIoControlCode,
83 LPVOID lpvlnBuffer, DWORD cblnBuffer,
84 LPVOID lpvOutBuffer, DWORD cbOutBuffer,
85 LPDWORD lpcbBytesReturned,
86 LPOVERLAPPED lpoPverlapped)
89 FIXME(comm, "(...): stub!\n");
90 /* FIXME: Set appropriate error */
91 return FALSE;
95 /****************************************************************************
96 * FlushInstructionCache (KERNEL32.261)
98 BOOL32 WINAPI FlushInstructionCache(DWORD x,DWORD y,DWORD z) {
99 FIXME(debug,"(0x%08lx,0x%08lx,0x%08lx): stub\n",x,y,z);
100 return TRUE;
103 /***********************************************************************
104 * CreateNamedPipeA (KERNEL32.168)
106 HANDLE32 WINAPI CreateNamedPipeA (LPCSTR lpName, DWORD dwOpenMode,
107 DWORD dwPipeMode, DWORD nMaxInstances,
108 DWORD nOutBufferSize, DWORD nInBufferSize,
109 DWORD nDafaultTimeOut,
110 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
112 FIXME (win32, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
113 debugstr_a(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
114 nOutBufferSize, nInBufferSize, nDafaultTimeOut,
115 lpSecurityAttributes);
116 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
117 SetLastError (ERROR_INVALID_PARAMETER);
118 return INVALID_HANDLE_VALUE;
119 } */
121 SetLastError (ERROR_UNKNOWN);
122 return INVALID_HANDLE_VALUE32;
125 /***********************************************************************
126 * CreateNamedPipeW (KERNEL32.169)
128 HANDLE32 WINAPI CreateNamedPipeW (LPCWSTR lpName, DWORD dwOpenMode,
129 DWORD dwPipeMode, DWORD nMaxInstances,
130 DWORD nOutBufferSize, DWORD nInBufferSize,
131 DWORD nDafaultTimeOut,
132 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
134 FIXME (win32, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
135 debugstr_w(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
136 nOutBufferSize, nInBufferSize, nDafaultTimeOut,
137 lpSecurityAttributes);
139 SetLastError (ERROR_UNKNOWN);
140 return INVALID_HANDLE_VALUE32;
143 /***********************************************************************
144 * GetSystemPowerStatus (KERNEL32.621)
146 BOOL32 WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
148 return FALSE; /* no power management support */
152 /***********************************************************************
153 * SetSystemPowerState (KERNEL32.630)
155 BOOL32 WINAPI SetSystemPowerState(BOOL32 suspend_or_hibernate,
156 BOOL32 force_flag)
158 /* suspend_or_hibernate flag: w95 does not support
159 this feature anyway */
161 for ( ;0; )
163 if ( force_flag )
166 else
170 return TRUE;
174 /******************************************************************************
175 * CreateMailslot32A [KERNEL32.164]
177 HANDLE32 WINAPI CreateMailslot32A( LPCSTR lpName, DWORD nMaxMessageSize,
178 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa)
180 FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName),
181 nMaxMessageSize, lReadTimeout, sa);
182 return 1;
186 /******************************************************************************
187 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
189 * PARAMS
190 * lpName [I] Pointer to string for mailslot name
191 * nMaxMessageSize [I] Maximum message size
192 * lReadTimeout [I] Milliseconds before read time-out
193 * sa [I] Pointer to security structure
195 * RETURNS
196 * Success: Handle to mailslot
197 * Failure: INVALID_HANDLE_VALUE
199 HANDLE32 WINAPI CreateMailslot32W( LPCWSTR lpName, DWORD nMaxMessageSize,
200 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa )
202 FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName),
203 nMaxMessageSize, lReadTimeout, sa);
204 return 1;
208 /******************************************************************************
209 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
211 * PARAMS
212 * hMailslot [I] Mailslot handle
213 * lpMaxMessageSize [O] Address of maximum message size
214 * lpNextSize [O] Address of size of next message
215 * lpMessageCount [O] Address of number of messages
216 * lpReadTimeout [O] Address of read time-out
218 * RETURNS
219 * Success: TRUE
220 * Failure: FALSE
222 BOOL32 WINAPI GetMailslotInfo( HANDLE32 hMailslot, LPDWORD lpMaxMessageSize,
223 LPDWORD lpNextSize, LPDWORD lpMessageCount,
224 LPDWORD lpReadTimeout )
226 FIXME(win32, "(%d): stub\n",hMailslot);
227 *lpMaxMessageSize = NULL;
228 *lpNextSize = NULL;
229 *lpMessageCount = NULL;
230 *lpReadTimeout = NULL;
231 return TRUE;
235 /******************************************************************************
236 * GetCompressedFileSize32A [KERNEL32.291]
238 * NOTES
239 * This should call the W function below
241 DWORD WINAPI GetCompressedFileSize32A(
242 LPCSTR lpFileName,
243 LPDWORD lpFileSizeHigh)
245 FIXME(win32, "(...): stub\n");
246 return 0xffffffff;
250 /******************************************************************************
251 * GetCompressedFileSize32W [KERNEL32.292]
253 * RETURNS
254 * Success: Low-order doubleword of number of bytes
255 * Failure: 0xffffffff
257 DWORD WINAPI GetCompressedFileSize32W(
258 LPCWSTR lpFileName, /* [in] Pointer to name of file */
259 LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
261 FIXME(win32, "(%s,%p): stub\n",debugstr_w(lpFileName),lpFileSizeHigh);
262 return 0xffffffff;
266 /******************************************************************************
267 * GetProcessWindowStation [USER32.280] Returns handle of window station
269 * NOTES
270 * Docs say the return value is HWINSTA
272 * RETURNS
273 * Success: Handle to window station associated with calling process
274 * Failure: NULL
276 DWORD WINAPI GetProcessWindowStation(void)
278 FIXME(win32, "(void): stub\n");
279 return 1;
283 /******************************************************************************
284 * GetThreadDesktop [USER32.295] Returns handle to desktop
286 * NOTES
287 * Docs say the return value is HDESK
289 * PARAMS
290 * dwThreadId [I] Thread identifier
292 * RETURNS
293 * Success: Handle to desktop associated with specified thread
294 * Failure: NULL
296 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
298 FIXME(win32, "(%ld): stub\n",dwThreadId);
299 return 1;
303 /******************************************************************************
304 * SetDebugErrorLevel [USER32.475]
305 * Sets the minimum error level for generating debugging events
307 * PARAMS
308 * dwLevel [I] Debugging error level
310 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
312 FIXME(win32, "(%ld): stub\n", dwLevel);
316 /******************************************************************************
317 * WaitForDebugEvent [KERNEL32.720]
318 * Waits for a debugging event to occur in a process being debugged
320 * PARAMS
321 * lpDebugEvent [I] Address of structure for event information
322 * dwMilliseconds [I] Number of milliseconds to wait for event
324 * RETURNS STD
326 BOOL32 WINAPI WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent,
327 DWORD dwMilliseconds )
329 FIXME(win32, "(%p,%ld): stub\n", lpDebugEvent, dwMilliseconds);
330 return TRUE;
334 /******************************************************************************
335 * SetComputerName32A [KERNEL32.621]
337 BOOL32 WINAPI SetComputerName32A( LPCSTR lpComputerName )
339 LPWSTR lpComputerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName);
340 BOOL32 ret = SetComputerName32W(lpComputerNameW);
341 HeapFree(GetProcessHeap(),0,lpComputerNameW);
342 return ret;
346 /******************************************************************************
347 * SetComputerName32W [KERNEL32.622]
349 * PARAMS
350 * lpComputerName [I] Address of new computer name
352 * RETURNS STD
354 BOOL32 WINAPI SetComputerName32W( LPCWSTR lpComputerName )
356 FIXME(win32, "(%s): stub\n", debugstr_w(lpComputerName));
357 return TRUE;