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
16 #include "debugtools.h"
18 DEFAULT_DEBUG_CHANNEL(win32
);
19 DECLARE_DEBUG_CHANNEL(debug
);
22 /****************************************************************************
23 * QueryPerformanceCounter (KERNEL32.564)
25 BOOL WINAPI
QueryPerformanceCounter(PLARGE_INTEGER counter
)
29 gettimeofday(&tv
,NULL
);
30 counter
->s
.LowPart
= tv
.tv_usec
+tv
.tv_sec
*1000000;
31 counter
->s
.HighPart
= 0;
35 /****************************************************************************
36 * QueryPerformanceFrequency (KERNEL32.565)
38 BOOL WINAPI
QueryPerformanceFrequency(PLARGE_INTEGER frequency
)
40 frequency
->s
.LowPart
= 1000000;
41 frequency
->s
.HighPart
= 0;
45 /****************************************************************************
46 * FlushInstructionCache (KERNEL32.261)
48 BOOL WINAPI
FlushInstructionCache(DWORD x
,DWORD y
,DWORD z
) {
49 FIXME_(debug
)("(0x%08lx,0x%08lx,0x%08lx): stub\n",x
,y
,z
);
53 /***********************************************************************
54 * CreateNamedPipeA (KERNEL32.168)
56 HANDLE WINAPI
CreateNamedPipeA (LPCSTR lpName
, DWORD dwOpenMode
,
57 DWORD dwPipeMode
, DWORD nMaxInstances
,
58 DWORD nOutBufferSize
, DWORD nInBufferSize
,
59 DWORD nDefaultTimeOut
,
60 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
62 FIXME("(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
63 debugstr_a(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
64 nOutBufferSize
, nInBufferSize
, nDefaultTimeOut
, lpSecurityAttributes
);
65 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
66 SetLastError (ERROR_INVALID_PARAMETER);
67 return INVALID_HANDLE_VALUE;
70 SetLastError (ERROR_UNKNOWN
);
71 return INVALID_HANDLE_VALUE
;
74 /***********************************************************************
75 * CreateNamedPipeW (KERNEL32.169)
77 HANDLE WINAPI
CreateNamedPipeW (LPCWSTR lpName
, DWORD dwOpenMode
,
78 DWORD dwPipeMode
, DWORD nMaxInstances
,
79 DWORD nOutBufferSize
, DWORD nInBufferSize
,
80 DWORD nDefaultTimeOut
,
81 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
83 FIXME("(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
84 debugstr_w(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
85 nOutBufferSize
, nInBufferSize
, nDefaultTimeOut
, 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("(%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("(%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("(%04x): stub\n",hMailslot
);
175 if (lpMaxMessageSize
) *lpMaxMessageSize
= (DWORD
)NULL
;
176 if (lpNextSize
) *lpNextSize
= (DWORD
)NULL
;
177 if (lpMessageCount
) *lpMessageCount
= (DWORD
)NULL
;
178 if (lpReadTimeout
) *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("(...): 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("(%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("(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("(%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("(%ld): stub\n", dwLevel
);
264 /******************************************************************************
265 * SetComputerName32A [KERNEL32.621]
267 BOOL WINAPI
SetComputerNameA( LPCSTR lpComputerName
)
269 LPWSTR lpComputerNameW
= HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName
);
270 BOOL ret
= SetComputerNameW(lpComputerNameW
);
271 HeapFree(GetProcessHeap(),0,lpComputerNameW
);
276 /******************************************************************************
277 * SetComputerName32W [KERNEL32.622]
280 * lpComputerName [I] Address of new computer name
284 BOOL WINAPI
SetComputerNameW( LPCWSTR lpComputerName
)
286 FIXME("(%s): stub\n", debugstr_w(lpComputerName
));
291 BOOL WINAPI
EnumPortsA(LPSTR name
,DWORD level
,LPBYTE ports
,DWORD bufsize
,LPDWORD bufneeded
,LPDWORD bufreturned
) {
292 FIXME("(%s,%ld,%p,%ld,%p,%p), stub!\n",name
,level
,ports
,bufsize
,bufneeded
,bufreturned
);
296 /******************************************************************************
297 * IsDebuggerPresent [KERNEL32.827]
300 BOOL WINAPI
IsDebuggerPresent() {
301 FIXME(" ... no debuggers yet, returning FALSE.\n");
305 /******************************************************************************
306 * OpenDesktop32A [USER32.408]
309 * Return type should be HDESK
311 * Not supported on Win9x - returns NULL and calls SetLastError.
313 HANDLE WINAPI
OpenDesktopA( LPCSTR lpszDesktop
, DWORD dwFlags
,
314 BOOL fInherit
, DWORD dwDesiredAccess
)
316 FIXME("(%s,%lx,%i,%lx): stub\n",debugstr_a(lpszDesktop
),dwFlags
,
317 fInherit
,dwDesiredAccess
);
319 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
324 BOOL WINAPI
SetUserObjectInformationA( HANDLE hObj
, int nIndex
,
325 LPVOID pvInfo
, DWORD nLength
)
327 FIXME("(%x,%d,%p,%lx): stub\n",hObj
,nIndex
,pvInfo
,nLength
);
332 BOOL WINAPI
SetThreadDesktop( HANDLE hDesktop
)
334 FIXME("(%x): stub\n",hDesktop
);
338 HANDLE WINAPI
CreateIoCompletionPort(HANDLE hFileHandle
,
339 HANDLE hExistingCompletionPort
, DWORD dwCompletionKey
,
340 DWORD dwNumberOfConcurrentThreads
)
342 FIXME("(%04x, %04x, %08lx, %08lx): stub.\n", hFileHandle
, hExistingCompletionPort
, dwCompletionKey
, dwNumberOfConcurrentThreads
);
347 /******************************************************************************
348 * GetProcessDefaultLayout [USER32.802]
350 * Gets the default layout for parentless windows.
351 * Right now, just returns 0 (left-to-right).
360 BOOL WINAPI
GetProcessDefaultLayout( DWORD
*pdwDefaultLayout
)
362 if ( !pdwDefaultLayout
) {
363 SetLastError( ERROR_INVALID_PARAMETER
);
366 FIXME( "( %p ): No BiDi\n", pdwDefaultLayout
);
367 *pdwDefaultLayout
= 0;
372 /******************************************************************************
373 * SetProcessDefaultLayout [USER32.803]
375 * Sets the default layout for parentless windows.
376 * Right now, only accepts 0 (left-to-right).
385 BOOL WINAPI
SetProcessDefaultLayout( DWORD dwDefaultLayout
)
387 if ( dwDefaultLayout
== 0 )
389 FIXME( "( %08lx ): No BiDi\n", dwDefaultLayout
);
390 SetLastError( ERROR_CALL_NOT_IMPLEMENTED
);