Fixed/commented out duplicate entry point names.
[wine/multimedia.git] / win32 / newfns.c
blobedd5c919b14dc24245f93fdaa4fda604454e0f17
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 <string.h>
11 #include <sys/time.h>
12 #include <unistd.h>
13 #include "windef.h"
14 #include "winerror.h"
15 #include "heap.h"
16 #include "debugtools.h"
17 #include "debugstr.h"
19 DEFAULT_DEBUG_CHANNEL(win32)
20 DECLARE_DEBUG_CHANNEL(debug)
23 /****************************************************************************
24 * QueryPerformanceCounter (KERNEL32.564)
26 BOOL WINAPI QueryPerformanceCounter(PLARGE_INTEGER counter)
28 struct timeval tv;
30 gettimeofday(&tv,NULL);
31 counter->s.LowPart = tv.tv_usec+tv.tv_sec*1000000;
32 counter->s.HighPart = 0;
33 return TRUE;
36 /****************************************************************************
37 * QueryPerformanceFrequency (KERNEL32.565)
39 BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER frequency)
41 frequency->s.LowPart = 1000000;
42 frequency->s.HighPart = 0;
43 return TRUE;
46 /****************************************************************************
47 * FlushInstructionCache (KERNEL32.261)
49 BOOL WINAPI FlushInstructionCache(DWORD x,DWORD y,DWORD z) {
50 FIXME_(debug)("(0x%08lx,0x%08lx,0x%08lx): stub\n",x,y,z);
51 return TRUE;
54 /***********************************************************************
55 * CreateNamedPipeA (KERNEL32.168)
57 HANDLE WINAPI CreateNamedPipeA (LPCSTR lpName, DWORD dwOpenMode,
58 DWORD dwPipeMode, DWORD nMaxInstances,
59 DWORD nOutBufferSize, DWORD nInBufferSize,
60 DWORD nDefaultTimeOut,
61 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
63 FIXME("(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
64 debugstr_a(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
65 nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes);
66 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
67 SetLastError (ERROR_INVALID_PARAMETER);
68 return INVALID_HANDLE_VALUE;
69 } */
71 SetLastError (ERROR_UNKNOWN);
72 return INVALID_HANDLE_VALUE;
75 /***********************************************************************
76 * CreateNamedPipeW (KERNEL32.169)
78 HANDLE WINAPI CreateNamedPipeW (LPCWSTR lpName, DWORD dwOpenMode,
79 DWORD dwPipeMode, DWORD nMaxInstances,
80 DWORD nOutBufferSize, DWORD nInBufferSize,
81 DWORD nDefaultTimeOut,
82 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
84 FIXME("(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
85 debugstr_w(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
86 nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes);
88 SetLastError (ERROR_UNKNOWN);
89 return INVALID_HANDLE_VALUE;
92 /***********************************************************************
93 * GetSystemPowerStatus (KERNEL32.621)
95 BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
97 return FALSE; /* no power management support */
101 /***********************************************************************
102 * SetSystemPowerState (KERNEL32.630)
104 BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
105 BOOL force_flag)
107 /* suspend_or_hibernate flag: w95 does not support
108 this feature anyway */
110 for ( ;0; )
112 if ( force_flag )
115 else
119 return TRUE;
123 /******************************************************************************
124 * CreateMailslot32A [KERNEL32.164]
126 HANDLE WINAPI CreateMailslotA( LPCSTR lpName, DWORD nMaxMessageSize,
127 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa)
129 FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName),
130 nMaxMessageSize, lReadTimeout, sa);
131 return 1;
135 /******************************************************************************
136 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
138 * PARAMS
139 * lpName [I] Pointer to string for mailslot name
140 * nMaxMessageSize [I] Maximum message size
141 * lReadTimeout [I] Milliseconds before read time-out
142 * sa [I] Pointer to security structure
144 * RETURNS
145 * Success: Handle to mailslot
146 * Failure: INVALID_HANDLE_VALUE
148 HANDLE WINAPI CreateMailslotW( LPCWSTR lpName, DWORD nMaxMessageSize,
149 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa )
151 FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName),
152 nMaxMessageSize, lReadTimeout, sa);
153 return 1;
157 /******************************************************************************
158 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
160 * PARAMS
161 * hMailslot [I] Mailslot handle
162 * lpMaxMessageSize [O] Address of maximum message size
163 * lpNextSize [O] Address of size of next message
164 * lpMessageCount [O] Address of number of messages
165 * lpReadTimeout [O] Address of read time-out
167 * RETURNS
168 * Success: TRUE
169 * Failure: FALSE
171 BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize,
172 LPDWORD lpNextSize, LPDWORD lpMessageCount,
173 LPDWORD lpReadTimeout )
175 FIXME("(%04x): stub\n",hMailslot);
176 if (lpMaxMessageSize) *lpMaxMessageSize = (DWORD)NULL;
177 if (lpNextSize) *lpNextSize = (DWORD)NULL;
178 if (lpMessageCount) *lpMessageCount = (DWORD)NULL;
179 if (lpReadTimeout) *lpReadTimeout = (DWORD)NULL;
180 return TRUE;
184 /******************************************************************************
185 * GetCompressedFileSize32A [KERNEL32.291]
187 * NOTES
188 * This should call the W function below
190 DWORD WINAPI GetCompressedFileSizeA(
191 LPCSTR lpFileName,
192 LPDWORD lpFileSizeHigh)
194 FIXME("(...): stub\n");
195 return 0xffffffff;
199 /******************************************************************************
200 * GetCompressedFileSize32W [KERNEL32.292]
202 * RETURNS
203 * Success: Low-order doubleword of number of bytes
204 * Failure: 0xffffffff
206 DWORD WINAPI GetCompressedFileSizeW(
207 LPCWSTR lpFileName, /* [in] Pointer to name of file */
208 LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
210 FIXME("(%s,%p): stub\n",debugstr_w(lpFileName),lpFileSizeHigh);
211 return 0xffffffff;
215 /******************************************************************************
216 * GetProcessWindowStation [USER32.280] Returns handle of window station
218 * NOTES
219 * Docs say the return value is HWINSTA
221 * RETURNS
222 * Success: Handle to window station associated with calling process
223 * Failure: NULL
225 DWORD WINAPI GetProcessWindowStation(void)
227 FIXME("(void): stub\n");
228 return 1;
232 /******************************************************************************
233 * GetThreadDesktop [USER32.295] Returns handle to desktop
235 * NOTES
236 * Docs say the return value is HDESK
238 * PARAMS
239 * dwThreadId [I] Thread identifier
241 * RETURNS
242 * Success: Handle to desktop associated with specified thread
243 * Failure: NULL
245 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
247 FIXME("(%lx): stub\n",dwThreadId);
248 return 1;
252 /******************************************************************************
253 * SetDebugErrorLevel [USER32.475]
254 * Sets the minimum error level for generating debugging events
256 * PARAMS
257 * dwLevel [I] Debugging error level
259 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
261 FIXME("(%ld): stub\n", dwLevel);
265 /******************************************************************************
266 * SetComputerName32A [KERNEL32.621]
268 BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName )
270 LPWSTR lpComputerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName);
271 BOOL ret = SetComputerNameW(lpComputerNameW);
272 HeapFree(GetProcessHeap(),0,lpComputerNameW);
273 return ret;
277 /******************************************************************************
278 * SetComputerName32W [KERNEL32.622]
280 * PARAMS
281 * lpComputerName [I] Address of new computer name
283 * RETURNS STD
285 BOOL WINAPI SetComputerNameW( LPCWSTR lpComputerName )
287 FIXME("(%s): stub\n", debugstr_w(lpComputerName));
288 return TRUE;
292 BOOL WINAPI EnumPortsA(LPSTR name,DWORD level,LPBYTE ports,DWORD bufsize,LPDWORD bufneeded,LPDWORD bufreturned) {
293 FIXME("(%s,%ld,%p,%ld,%p,%p), stub!\n",name,level,ports,bufsize,bufneeded,bufreturned);
294 return FALSE;
297 /******************************************************************************
298 * IsDebuggerPresent [KERNEL32.827]
301 BOOL WINAPI IsDebuggerPresent() {
302 FIXME(" ... no debuggers yet, returning FALSE.\n");
303 return FALSE;
306 /******************************************************************************
307 * OpenDesktop32A [USER32.408]
309 * NOTES
310 * Return type should be HDESK
312 * Not supported on Win9x - returns NULL and calls SetLastError.
314 HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
315 BOOL fInherit, DWORD dwDesiredAccess )
317 FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
318 fInherit,dwDesiredAccess);
320 SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
321 return 0;
325 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, int nIndex,
326 LPVOID pvInfo, DWORD nLength )
328 FIXME("(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
329 return TRUE;
333 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
335 FIXME("(%x): stub\n",hDesktop);
336 return TRUE;
339 HANDLE WINAPI CreateIoCompletionPort(HANDLE hFileHandle,
340 HANDLE hExistingCompletionPort, DWORD dwCompletionKey,
341 DWORD dwNumberOfConcurrentThreads)
343 FIXME("(%04x, %04x, %08lx, %08lx): stub.\n", hFileHandle, hExistingCompletionPort, dwCompletionKey, dwNumberOfConcurrentThreads);
344 return (HANDLE)NULL;
348 /******************************************************************************
349 * GetProcessDefaultLayout [USER32.802]
351 * Gets the default layout for parentless windows.
352 * Right now, just returns 0 (left-to-right).
354 * RETURNS
355 * Success: Nonzero
356 * Failure: Zero
358 * BUGS
359 * No RTL
361 BOOL WINAPI GetProcessDefaultLayout( DWORD *pdwDefaultLayout )
363 if ( !pdwDefaultLayout ) {
364 SetLastError( ERROR_INVALID_PARAMETER );
365 return 0;
367 *pdwDefaultLayout = 0;
368 return TRUE;
372 /******************************************************************************
373 * SetProcessDefaultLayout [USER32.803]
375 * Sets the default layout for parentless windows.
376 * Right now, only accepts 0 (left-to-right).
378 * RETURNS
379 * Success: Nonzero
380 * Failure: Zero
382 * BUGS
383 * No RTL
385 BOOL WINAPI SetProcessDefaultLayout( DWORD dwDefaultLayout )
387 return ( dwDefaultLayout == 0 );