Large-scale renaming of all Win32 functions and types to use the
[wine/multimedia.git] / win32 / newfns.c
blob501452542e0d65a5b922432a82012e7c1874e44b
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 "wintypes.h"
14 #include "winerror.h"
15 #include "heap.h"
16 #include "debug.h"
17 #include "debugstr.h"
19 /****************************************************************************
20 * UTRegister (KERNEL32.697)
22 BOOL WINAPI UTRegister(HMODULE hModule,
23 LPSTR lpsz16BITDLL,
24 LPSTR lpszInitName,
25 LPSTR lpszProcName,
26 /*UT32PROC*/ LPVOID *ppfn32Thunk,
27 /*FARPROC*/ LPVOID pfnUT32CallBack,
28 LPVOID lpBuff)
30 FIXME(updown, "(%#x,...): stub\n",hModule);
31 return TRUE;
34 /****************************************************************************
35 * UTUnRegister (KERNEL32.698)
37 BOOL WINAPI UTUnRegister(HMODULE hModule)
39 FIXME(updown, "(%#x...): stub\n", hModule);
40 return TRUE;
44 /****************************************************************************
45 * QueryPerformanceCounter (KERNEL32.564)
47 BOOL WINAPI QueryPerformanceCounter(PLARGE_INTEGER counter)
49 struct timeval tv;
51 gettimeofday(&tv,NULL);
52 counter->LowPart = tv.tv_usec+tv.tv_sec*1000000;
53 counter->HighPart = 0;
54 return TRUE;
57 /****************************************************************************
58 * QueryPerformanceFrequency (KERNEL32.565)
60 BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER frequency)
62 frequency->LowPart = 1000000;
63 frequency->HighPart = 0;
64 return TRUE;
67 /****************************************************************************
68 * FlushInstructionCache (KERNEL32.261)
70 BOOL WINAPI FlushInstructionCache(DWORD x,DWORD y,DWORD z) {
71 FIXME(debug,"(0x%08lx,0x%08lx,0x%08lx): stub\n",x,y,z);
72 return TRUE;
75 /***********************************************************************
76 * CreateNamedPipeA (KERNEL32.168)
78 HANDLE WINAPI CreateNamedPipeA (LPCSTR lpName, DWORD dwOpenMode,
79 DWORD dwPipeMode, DWORD nMaxInstances,
80 DWORD nOutBufferSize, DWORD nInBufferSize,
81 DWORD nDefaultTimeOut,
82 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
84 FIXME (win32, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
85 debugstr_a(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
86 nOutBufferSize, nInBufferSize, nDefaultTimeOut,
87 lpSecurityAttributes);
88 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
89 SetLastError (ERROR_INVALID_PARAMETER);
90 return INVALID_HANDLE_VALUE;
91 } */
93 SetLastError (ERROR_UNKNOWN);
94 return INVALID_HANDLE_VALUE;
97 /***********************************************************************
98 * CreateNamedPipeW (KERNEL32.169)
100 HANDLE WINAPI CreateNamedPipeW (LPCWSTR lpName, DWORD dwOpenMode,
101 DWORD dwPipeMode, DWORD nMaxInstances,
102 DWORD nOutBufferSize, DWORD nInBufferSize,
103 DWORD nDefaultTimeOut,
104 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
106 FIXME (win32, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
107 debugstr_w(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
108 nOutBufferSize, nInBufferSize, nDefaultTimeOut,
109 lpSecurityAttributes);
111 SetLastError (ERROR_UNKNOWN);
112 return INVALID_HANDLE_VALUE;
115 /***********************************************************************
116 * GetSystemPowerStatus (KERNEL32.621)
118 BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
120 return FALSE; /* no power management support */
124 /***********************************************************************
125 * SetSystemPowerState (KERNEL32.630)
127 BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
128 BOOL force_flag)
130 /* suspend_or_hibernate flag: w95 does not support
131 this feature anyway */
133 for ( ;0; )
135 if ( force_flag )
138 else
142 return TRUE;
146 /******************************************************************************
147 * CreateMailslot32A [KERNEL32.164]
149 HANDLE WINAPI CreateMailslotA( LPCSTR lpName, DWORD nMaxMessageSize,
150 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa)
152 FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName),
153 nMaxMessageSize, lReadTimeout, sa);
154 return 1;
158 /******************************************************************************
159 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
161 * PARAMS
162 * lpName [I] Pointer to string for mailslot name
163 * nMaxMessageSize [I] Maximum message size
164 * lReadTimeout [I] Milliseconds before read time-out
165 * sa [I] Pointer to security structure
167 * RETURNS
168 * Success: Handle to mailslot
169 * Failure: INVALID_HANDLE_VALUE
171 HANDLE WINAPI CreateMailslotW( LPCWSTR lpName, DWORD nMaxMessageSize,
172 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa )
174 FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName),
175 nMaxMessageSize, lReadTimeout, sa);
176 return 1;
180 /******************************************************************************
181 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
183 * PARAMS
184 * hMailslot [I] Mailslot handle
185 * lpMaxMessageSize [O] Address of maximum message size
186 * lpNextSize [O] Address of size of next message
187 * lpMessageCount [O] Address of number of messages
188 * lpReadTimeout [O] Address of read time-out
190 * RETURNS
191 * Success: TRUE
192 * Failure: FALSE
194 BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize,
195 LPDWORD lpNextSize, LPDWORD lpMessageCount,
196 LPDWORD lpReadTimeout )
198 FIXME(win32, "(%d): stub\n",hMailslot);
199 *lpMaxMessageSize = (DWORD)NULL;
200 *lpNextSize = (DWORD)NULL;
201 *lpMessageCount = (DWORD)NULL;
202 *lpReadTimeout = (DWORD)NULL;
203 return TRUE;
207 /******************************************************************************
208 * GetCompressedFileSize32A [KERNEL32.291]
210 * NOTES
211 * This should call the W function below
213 DWORD WINAPI GetCompressedFileSizeA(
214 LPCSTR lpFileName,
215 LPDWORD lpFileSizeHigh)
217 FIXME(win32, "(...): stub\n");
218 return 0xffffffff;
222 /******************************************************************************
223 * GetCompressedFileSize32W [KERNEL32.292]
225 * RETURNS
226 * Success: Low-order doubleword of number of bytes
227 * Failure: 0xffffffff
229 DWORD WINAPI GetCompressedFileSizeW(
230 LPCWSTR lpFileName, /* [in] Pointer to name of file */
231 LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
233 FIXME(win32, "(%s,%p): stub\n",debugstr_w(lpFileName),lpFileSizeHigh);
234 return 0xffffffff;
238 /******************************************************************************
239 * GetProcessWindowStation [USER32.280] Returns handle of window station
241 * NOTES
242 * Docs say the return value is HWINSTA
244 * RETURNS
245 * Success: Handle to window station associated with calling process
246 * Failure: NULL
248 DWORD WINAPI GetProcessWindowStation(void)
250 FIXME(win32, "(void): stub\n");
251 return 1;
255 /******************************************************************************
256 * GetThreadDesktop [USER32.295] Returns handle to desktop
258 * NOTES
259 * Docs say the return value is HDESK
261 * PARAMS
262 * dwThreadId [I] Thread identifier
264 * RETURNS
265 * Success: Handle to desktop associated with specified thread
266 * Failure: NULL
268 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
270 FIXME(win32, "(%lx): stub\n",dwThreadId);
271 return 1;
275 /******************************************************************************
276 * SetDebugErrorLevel [USER32.475]
277 * Sets the minimum error level for generating debugging events
279 * PARAMS
280 * dwLevel [I] Debugging error level
282 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
284 FIXME(win32, "(%ld): stub\n", dwLevel);
288 /******************************************************************************
289 * WaitForDebugEvent [KERNEL32.720]
290 * Waits for a debugging event to occur in a process being debugged
292 * PARAMS
293 * lpDebugEvent [I] Address of structure for event information
294 * dwMilliseconds [I] Number of milliseconds to wait for event
296 * RETURNS STD
298 BOOL WINAPI WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent,
299 DWORD dwMilliseconds )
301 FIXME(win32, "(%p,%ld): stub\n", lpDebugEvent, dwMilliseconds);
302 return FALSE;
306 /******************************************************************************
307 * SetComputerName32A [KERNEL32.621]
309 BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName )
311 LPWSTR lpComputerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName);
312 BOOL ret = SetComputerNameW(lpComputerNameW);
313 HeapFree(GetProcessHeap(),0,lpComputerNameW);
314 return ret;
318 /******************************************************************************
319 * SetComputerName32W [KERNEL32.622]
321 * PARAMS
322 * lpComputerName [I] Address of new computer name
324 * RETURNS STD
326 BOOL WINAPI SetComputerNameW( LPCWSTR lpComputerName )
328 FIXME(win32, "(%s): stub\n", debugstr_w(lpComputerName));
329 return TRUE;
333 BOOL WINAPI EnumPortsA(LPSTR name,DWORD level,LPBYTE ports,DWORD bufsize,LPDWORD bufneeded,LPDWORD bufreturned) {
334 FIXME(win32,"(%s,%ld,%p,%ld,%p,%p), stub!\n",name,level,ports,bufsize,bufneeded,bufreturned);
335 return FALSE;
338 /******************************************************************************
339 * IsDebuggerPresent [KERNEL32.827]
342 BOOL WINAPI IsDebuggerPresent() {
343 FIXME(win32," ... no debuggers yet, returning FALSE.\n");
344 return FALSE;
347 /******************************************************************************
348 * OpenDesktop32A [USER32.408]
350 * NOTES
351 * Return type should be HDESK
353 HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
354 BOOL fInherit, DWORD dwDesiredAccess )
356 FIXME(win32,"(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
357 fInherit,dwDesiredAccess);
358 return 1;
362 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, int nIndex,
363 LPVOID pvInfo, DWORD nLength )
365 FIXME(win32,"(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
366 return TRUE;
370 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
372 FIXME(win32,"(%x): stub\n",hDesktop);
373 return TRUE;