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
19 /****************************************************************************
20 * UTRegister (KERNEL32.697)
22 BOOL WINAPI
UTRegister(HMODULE hModule
,
26 /*UT32PROC*/ LPVOID
*ppfn32Thunk
,
27 /*FARPROC*/ LPVOID pfnUT32CallBack
,
30 FIXME(updown
, "(%#x,...): stub\n",hModule
);
34 /****************************************************************************
35 * UTUnRegister (KERNEL32.698)
37 BOOL WINAPI
UTUnRegister(HMODULE hModule
)
39 FIXME(updown
, "(%#x...): stub\n", hModule
);
44 /****************************************************************************
45 * QueryPerformanceCounter (KERNEL32.564)
47 BOOL WINAPI
QueryPerformanceCounter(PLARGE_INTEGER counter
)
51 gettimeofday(&tv
,NULL
);
52 counter
->LowPart
= tv
.tv_usec
+tv
.tv_sec
*1000000;
53 counter
->HighPart
= 0;
57 /****************************************************************************
58 * QueryPerformanceFrequency (KERNEL32.565)
60 BOOL WINAPI
QueryPerformanceFrequency(PLARGE_INTEGER frequency
)
62 frequency
->LowPart
= 1000000;
63 frequency
->HighPart
= 0;
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
);
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;
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
,
130 /* suspend_or_hibernate flag: w95 does not support
131 this feature anyway */
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
);
158 /******************************************************************************
159 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
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
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
);
180 /******************************************************************************
181 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
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
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
;
207 /******************************************************************************
208 * GetCompressedFileSize32A [KERNEL32.291]
211 * This should call the W function below
213 DWORD WINAPI
GetCompressedFileSizeA(
215 LPDWORD lpFileSizeHigh
)
217 FIXME(win32
, "(...): stub\n");
222 /******************************************************************************
223 * GetCompressedFileSize32W [KERNEL32.292]
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
);
238 /******************************************************************************
239 * GetProcessWindowStation [USER32.280] Returns handle of window station
242 * Docs say the return value is HWINSTA
245 * Success: Handle to window station associated with calling process
248 DWORD WINAPI
GetProcessWindowStation(void)
250 FIXME(win32
, "(void): stub\n");
255 /******************************************************************************
256 * GetThreadDesktop [USER32.295] Returns handle to desktop
259 * Docs say the return value is HDESK
262 * dwThreadId [I] Thread identifier
265 * Success: Handle to desktop associated with specified thread
268 DWORD WINAPI
GetThreadDesktop( DWORD dwThreadId
)
270 FIXME(win32
, "(%lx): stub\n",dwThreadId
);
275 /******************************************************************************
276 * SetDebugErrorLevel [USER32.475]
277 * Sets the minimum error level for generating debugging events
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
293 * lpDebugEvent [I] Address of structure for event information
294 * dwMilliseconds [I] Number of milliseconds to wait for event
298 BOOL WINAPI
WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent
,
299 DWORD dwMilliseconds
)
301 FIXME(win32
, "(%p,%ld): stub\n", lpDebugEvent
, dwMilliseconds
);
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
);
318 /******************************************************************************
319 * SetComputerName32W [KERNEL32.622]
322 * lpComputerName [I] Address of new computer name
326 BOOL WINAPI
SetComputerNameW( LPCWSTR lpComputerName
)
328 FIXME(win32
, "(%s): stub\n", debugstr_w(lpComputerName
));
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
);
338 /******************************************************************************
339 * IsDebuggerPresent [KERNEL32.827]
342 BOOL WINAPI
IsDebuggerPresent() {
343 FIXME(win32
," ... no debuggers yet, returning FALSE.\n");
347 /******************************************************************************
348 * OpenDesktop32A [USER32.408]
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
);
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
);
370 BOOL WINAPI
SetThreadDesktop( HANDLE hDesktop
)
372 FIXME(win32
,"(%x): stub\n",hDesktop
);