2 * Win32 miscellaneous functions
4 * Copyright 1995 Thomas Sandford (tdgsandf@prds-grn.demon.co.uk)
7 /* Misc. new functions - they should be moved into appropriate files
20 /****************************************************************************
21 * QueryPerformanceCounter (KERNEL32.564)
23 BOOL WINAPI QueryPerformanceCounter(PLARGE_INTEGER counter)
27 gettimeofday(&tv,NULL);
28 counter->LowPart = tv.tv_usec+tv.tv_sec*1000000;
29 counter->HighPart = 0;
33 /****************************************************************************
34 * QueryPerformanceFrequency (KERNEL32.565)
36 BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER frequency)
38 frequency->LowPart = 1000000;
39 frequency->HighPart = 0;
43 /****************************************************************************
44 * FlushInstructionCache (KERNEL32.261)
46 BOOL WINAPI FlushInstructionCache(DWORD x,DWORD y,DWORD z) {
47 FIXME(debug,"(0x%08lx,0x%08lx,0x%08lx): stub\n",x,y,z);
51 /***********************************************************************
52 * CreateNamedPipeA (KERNEL32.168)
54 HANDLE WINAPI CreateNamedPipeA (LPCSTR lpName, DWORD dwOpenMode,
55 DWORD dwPipeMode, DWORD nMaxInstances,
56 DWORD nOutBufferSize, DWORD nInBufferSize,
57 DWORD nDefaultTimeOut,
58 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
60 FIXME (win32, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
61 debugstr_a(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
62 nOutBufferSize, nInBufferSize, nDefaultTimeOut,
63 lpSecurityAttributes);
64 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
65 SetLastError (ERROR_INVALID_PARAMETER);
66 return INVALID_HANDLE_VALUE;
69 SetLastError (ERROR_UNKNOWN);
70 return INVALID_HANDLE_VALUE;
73 /***********************************************************************
74 * CreateNamedPipeW (KERNEL32.169)
76 HANDLE WINAPI CreateNamedPipeW (LPCWSTR lpName, DWORD dwOpenMode,
77 DWORD dwPipeMode, DWORD nMaxInstances,
78 DWORD nOutBufferSize, DWORD nInBufferSize,
79 DWORD nDefaultTimeOut,
80 LPSECURITY_ATTRIBUTES lpSecurityAttributes)
82 FIXME (win32, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
83 debugstr_w(lpName), dwOpenMode, dwPipeMode, nMaxInstances,
84 nOutBufferSize, nInBufferSize, nDefaultTimeOut,
85 lpSecurityAttributes);
87 SetLastError (ERROR_UNKNOWN);
88 return INVALID_HANDLE_VALUE;
91 /***********************************************************************
92 * GetSystemPowerStatus (KERNEL32.621)
94 BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
96 return FALSE; /* no power management support */
100 /***********************************************************************
101 * SetSystemPowerState (KERNEL32.630)
103 BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
106 /* suspend_or_hibernate flag: w95 does not support
107 this feature anyway */
122 /******************************************************************************
123 * CreateMailslot32A [KERNEL32.164]
125 HANDLE WINAPI CreateMailslotA( LPCSTR lpName, DWORD nMaxMessageSize,
126 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa)
128 FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName),
129 nMaxMessageSize, lReadTimeout, sa);
134 /******************************************************************************
135 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
138 * lpName [I] Pointer to string for mailslot name
139 * nMaxMessageSize [I] Maximum message size
140 * lReadTimeout [I] Milliseconds before read time-out
141 * sa [I] Pointer to security structure
144 * Success: Handle to mailslot
145 * Failure: INVALID_HANDLE_VALUE
147 HANDLE WINAPI CreateMailslotW( LPCWSTR lpName, DWORD nMaxMessageSize,
148 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa )
150 FIXME(win32, "(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName),
151 nMaxMessageSize, lReadTimeout, sa);
156 /******************************************************************************
157 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
160 * hMailslot [I] Mailslot handle
161 * lpMaxMessageSize [O] Address of maximum message size
162 * lpNextSize [O] Address of size of next message
163 * lpMessageCount [O] Address of number of messages
164 * lpReadTimeout [O] Address of read time-out
170 BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize,
171 LPDWORD lpNextSize, LPDWORD lpMessageCount,
172 LPDWORD lpReadTimeout )
174 FIXME(win32, "(%d): stub\n",hMailslot);
175 *lpMaxMessageSize = (DWORD)NULL;
176 *lpNextSize = (DWORD)NULL;
177 *lpMessageCount = (DWORD)NULL;
178 *lpReadTimeout = (DWORD)NULL;
183 /******************************************************************************
184 * GetCompressedFileSize32A [KERNEL32.291]
187 * This should call the W function below
189 DWORD WINAPI GetCompressedFileSizeA(
191 LPDWORD lpFileSizeHigh)
193 FIXME(win32, "(...): stub\n");
198 /******************************************************************************
199 * GetCompressedFileSize32W [KERNEL32.292]
202 * Success: Low-order doubleword of number of bytes
203 * Failure: 0xffffffff
205 DWORD WINAPI GetCompressedFileSizeW(
206 LPCWSTR lpFileName, /* [in] Pointer to name of file */
207 LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
209 FIXME(win32, "(%s,%p): stub\n",debugstr_w(lpFileName),lpFileSizeHigh);
214 /******************************************************************************
215 * GetProcessWindowStation [USER32.280] Returns handle of window station
218 * Docs say the return value is HWINSTA
221 * Success: Handle to window station associated with calling process
224 DWORD WINAPI GetProcessWindowStation(void)
226 FIXME(win32, "(void): stub\n");
231 /******************************************************************************
232 * GetThreadDesktop [USER32.295] Returns handle to desktop
235 * Docs say the return value is HDESK
238 * dwThreadId [I] Thread identifier
241 * Success: Handle to desktop associated with specified thread
244 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
246 FIXME(win32, "(%lx): stub\n",dwThreadId);
251 /******************************************************************************
252 * SetDebugErrorLevel [USER32.475]
253 * Sets the minimum error level for generating debugging events
256 * dwLevel [I] Debugging error level
258 VOID WINAPI SetDebugErrorLevel( DWORD dwLevel )
260 FIXME(win32, "(%ld): stub\n", dwLevel);
264 /******************************************************************************
265 * WaitForDebugEvent [KERNEL32.720]
266 * Waits for a debugging event to occur in a process being debugged
269 * lpDebugEvent [I] Address of structure for event information
270 * dwMilliseconds [I] Number of milliseconds to wait for event
274 BOOL WINAPI WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent,
275 DWORD dwMilliseconds )
277 FIXME(win32, "(%p,%ld): stub\n", lpDebugEvent, dwMilliseconds);
282 /******************************************************************************
283 * SetComputerName32A [KERNEL32.621]
285 BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName )
287 LPWSTR lpComputerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName);
288 BOOL ret = SetComputerNameW(lpComputerNameW);
289 HeapFree(GetProcessHeap(),0,lpComputerNameW);
294 /******************************************************************************
295 * SetComputerName32W [KERNEL32.622]
298 * lpComputerName [I] Address of new computer name
302 BOOL WINAPI SetComputerNameW( LPCWSTR lpComputerName )
304 FIXME(win32, "(%s): stub\n", debugstr_w(lpComputerName));
309 BOOL WINAPI EnumPortsA(LPSTR name,DWORD level,LPBYTE ports,DWORD bufsize,LPDWORD bufneeded,LPDWORD bufreturned) {
310 FIXME(win32,"(%s,%ld,%p,%ld,%p,%p), stub!\n",name,level,ports,bufsize,bufneeded,bufreturned);
314 /******************************************************************************
315 * IsDebuggerPresent [KERNEL32.827]
318 BOOL WINAPI IsDebuggerPresent() {
319 FIXME(win32," ... no debuggers yet, returning FALSE.\n");
323 /******************************************************************************
324 * OpenDesktop32A [USER32.408]
327 * Return type should be HDESK
329 HANDLE WINAPI OpenDesktopA( LPCSTR lpszDesktop, DWORD dwFlags,
330 BOOL fInherit, DWORD dwDesiredAccess )
332 FIXME(win32,"(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop),dwFlags,
333 fInherit,dwDesiredAccess);
338 BOOL WINAPI SetUserObjectInformationA( HANDLE hObj, int nIndex,
339 LPVOID pvInfo, DWORD nLength )
341 FIXME(win32,"(%x,%d,%p,%lx): stub\n",hObj,nIndex,pvInfo,nLength);
346 BOOL WINAPI SetThreadDesktop( HANDLE hDesktop )
348 FIXME(win32,"(%x): stub\n",hDesktop);
352 HANDLE WINAPI CreateIoCompletionPort(HANDLE hFileHandle,
353 HANDLE hExistingCompletionPort, DWORD dwCompletionKey,
354 DWORD dwNumberOfConcurrentThreads)
356 FIXME(win32, "(%04x, %04x, %08lx, %08lx): stub.\n", hFileHandle, hExistingCompletionPort, dwCompletionKey, dwNumberOfConcurrentThreads);