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 * UTRegister (KERNEL32.697)
23 BOOL32 WINAPI
UTRegister(HMODULE32 hModule
,
27 /*UT32PROC*/ LPVOID
*ppfn32Thunk
,
28 /*FARPROC*/ LPVOID pfnUT32CallBack
,
31 fprintf(stderr
, "UTRegister(%#x,...): stub!\n",hModule
);
35 /****************************************************************************
36 * UTUnRegister (KERNEL32.698)
38 BOOL32 WINAPI
UTUnRegister(HMODULE32 hModule
)
40 fprintf(stderr
, "UTUnRegister(%#x: stub!\n", hModule
);
45 /****************************************************************************
46 * QueryPerformanceCounter (KERNEL32.564)
48 BOOL32 WINAPI
QueryPerformanceCounter(LPLARGE_INTEGER counter
)
52 gettimeofday(&tv
,NULL
);
53 counter
->LowPart
= tv
.tv_usec
+tv
.tv_sec
*1000000;
54 counter
->HighPart
= 0;
58 HANDLE32 WINAPI
FindFirstChangeNotification32A(LPCSTR lpPathName
,BOOL32 bWatchSubtree
,DWORD dwNotifyFilter
) {
59 FIXME(file
,"(%s,%d,%08lx): stub\n",
60 lpPathName
,bWatchSubtree
,dwNotifyFilter
);
64 BOOL32 WINAPI
FindNextChangeNotification(HANDLE32 fcnhandle
) {
65 FIXME(file
,"(%08x): stub!\n",fcnhandle
);
69 /****************************************************************************
70 * QueryPerformanceFrequency (KERNEL32.565)
72 BOOL32 WINAPI
QueryPerformanceFrequency(LPLARGE_INTEGER frequency
)
74 frequency
->LowPart
= 1000000;
75 frequency
->HighPart
= 0;
79 /****************************************************************************
80 * DeviceIoControl (KERNEL32.188)
82 BOOL32 WINAPI
DeviceIoControl(HANDLE32 hDevice
, DWORD dwIoControlCode
,
83 LPVOID lpvlnBuffer
, DWORD cblnBuffer
,
84 LPVOID lpvOutBuffer
, DWORD cbOutBuffer
,
85 LPDWORD lpcbBytesReturned
,
86 LPOVERLAPPED lpoPverlapped
)
89 FIXME(comm
, "(...): stub!\n");
90 /* FIXME: Set appropriate error */
95 /****************************************************************************
96 * FlushInstructionCache (KERNEL32.261)
98 BOOL32 WINAPI
FlushInstructionCache(DWORD x
,DWORD y
,DWORD z
) {
99 FIXME(debug
,"(0x%08lx,0x%08lx,0x%08lx): stub\n",x
,y
,z
);
103 /***********************************************************************
104 * CreateNamedPipeA (KERNEL32.168)
106 HANDLE32 WINAPI
CreateNamedPipeA (LPCSTR lpName
, DWORD dwOpenMode
,
107 DWORD dwPipeMode
, DWORD nMaxInstances
,
108 DWORD nOutBufferSize
, DWORD nInBufferSize
,
109 DWORD nDafaultTimeOut
,
110 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
112 FIXME (win32
, "(Name=%s, OpenMode=%#08x, dwPipeMode=%#08x, MaxInst=%d, OutBSize=%d, InBuffSize=%d, DefTimeOut=%d, SecAttr=%p): stub\n",
113 debugstr_a(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
114 nOutBufferSize
, nInBufferSize
, nDafaultTimeOut
,
115 lpSecurityAttributes
);
116 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
117 SetLastError (ERROR_INVALID_PARAMETER);
118 return INVALID_HANDLE_VALUE;
121 SetLastError (ERROR_UNKNOWN
);
122 return INVALID_HANDLE_VALUE32
;
125 /***********************************************************************
126 * CreateNamedPipeW (KERNEL32.169)
128 HANDLE32 WINAPI
CreateNamedPipeW (LPCWSTR lpName
, DWORD dwOpenMode
,
129 DWORD dwPipeMode
, DWORD nMaxInstances
,
130 DWORD nOutBufferSize
, DWORD nInBufferSize
,
131 DWORD nDafaultTimeOut
,
132 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
134 FIXME (win32
, "(Name=%s, OpenMode=%#08x, dwPipeMode=%#08x, MaxInst=%d, OutBSize=%d, InBuffSize=%d, DefTimeOut=%d, SecAttr=%p): stub\n",
135 debugstr_w(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
136 nOutBufferSize
, nInBufferSize
, nDafaultTimeOut
,
137 lpSecurityAttributes
);
139 SetLastError (ERROR_UNKNOWN
);
140 return INVALID_HANDLE_VALUE32
;
143 /***********************************************************************
144 * GetSystemPowerStatus (KERNEL32.621)
146 BOOL32 WINAPI
GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr
)
148 return FALSE
; /* no power management support */
152 /***********************************************************************
153 * SetSystemPowerState (KERNEL32.630)
155 BOOL32 WINAPI
SetSystemPowerState(BOOL32 suspend_or_hibernate
,
158 /* suspend_or_hibernate flag: w95 does not support
159 this feature anyway */
174 /******************************************************************************
175 * CreateMailslot32A [KERNEL32.164]
177 HANDLE32 WINAPI
CreateMailslot32A( LPCSTR lpName
, DWORD nMaxMessageSize
,
178 DWORD lReadTimeout
, LPSECURITY_ATTRIBUTES sa
)
180 FIXME(win32
, "(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName
),
181 nMaxMessageSize
, lReadTimeout
, sa
);
186 /******************************************************************************
187 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
190 * lpName [I] Pointer to string for mailslot name
191 * nMaxMessageSize [I] Maximum message size
192 * lReadTimeout [I] Milliseconds before read time-out
193 * sa [I] Pointer to security structure
196 * Success: Handle to mailslot
197 * Failure: INVALID_HANDLE_VALUE
199 HANDLE32 WINAPI
CreateMailslot32W( LPCWSTR lpName
, DWORD nMaxMessageSize
,
200 DWORD lReadTimeout
, LPSECURITY_ATTRIBUTES sa
)
202 FIXME(win32
, "(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName
),
203 nMaxMessageSize
, lReadTimeout
, sa
);
208 /******************************************************************************
209 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
212 * hMailslot [I] Mailslot handle
213 * lpMaxMessageSize [O] Address of maximum message size
214 * lpNextSize [O] Address of size of next message
215 * lpMessageCount [O] Address of number of messages
216 * lpReadTimeout [O] Address of read time-out
222 BOOL32 WINAPI
GetMailslotInfo( HANDLE32 hMailslot
, LPDWORD lpMaxMessageSize
,
223 LPDWORD lpNextSize
, LPDWORD lpMessageCount
,
224 LPDWORD lpReadTimeout
)
226 FIXME(win32
, "(%d): stub\n",hMailslot
);
227 *lpMaxMessageSize
= NULL
;
229 *lpMessageCount
= NULL
;
230 *lpReadTimeout
= NULL
;
235 /******************************************************************************
236 * GetCompressedFileSize32A [KERNEL32.291]
239 * This should call the W function below
241 DWORD WINAPI
GetCompressedFileSize32A(
243 LPDWORD lpFileSizeHigh
)
245 FIXME(win32
, "(...): stub\n");
250 /******************************************************************************
251 * GetCompressedFileSize32W [KERNEL32.292]
254 * Success: Low-order doubleword of number of bytes
255 * Failure: 0xffffffff
257 DWORD WINAPI
GetCompressedFileSize32W(
258 LPCWSTR lpFileName
, /* [in] Pointer to name of file */
259 LPDWORD lpFileSizeHigh
) /* [out] Receives high-order doubleword of size */
261 FIXME(win32
, "(%s,%p): stub\n",debugstr_w(lpFileName
),lpFileSizeHigh
);
266 /******************************************************************************
267 * GetProcessWindowStation [USER32.280] Returns handle of window station
270 * Docs say the return value is HWINSTA
273 * Success: Handle to window station associated with calling process
276 DWORD WINAPI
GetProcessWindowStation(void)
278 FIXME(win32
, "(void): stub\n");
283 /******************************************************************************
284 * GetThreadDesktop [USER32.295] Returns handle to desktop
287 * Docs say the return value is HDESK
290 * dwThreadId [I] Thread identifier
293 * Success: Handle to desktop associated with specified thread
296 DWORD WINAPI
GetThreadDesktop( DWORD dwThreadId
)
298 FIXME(win32
, "(%ld): stub\n",dwThreadId
);
303 /******************************************************************************
304 * SetDebugErrorLevel [USER32.475]
305 * Sets the minimum error level for generating debugging events
308 * dwLevel [I] Debugging error level
310 VOID WINAPI
SetDebugErrorLevel( DWORD dwLevel
)
312 FIXME(win32
, "(%ld): stub\n", dwLevel
);
316 /******************************************************************************
317 * WaitForDebugEvent [KERNEL32.720]
318 * Waits for a debugging event to occur in a process being debugged
321 * lpDebugEvent [I] Address of structure for event information
322 * dwMilliseconds [I] Number of milliseconds to wait for event
326 BOOL32 WINAPI
WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent
,
327 DWORD dwMilliseconds
)
329 FIXME(win32
, "(%p,%ld): stub\n", lpDebugEvent
, dwMilliseconds
);
334 /******************************************************************************
335 * SetComputerName32A [KERNEL32.621]
337 BOOL32 WINAPI
SetComputerName32A( LPCSTR lpComputerName
)
339 LPWSTR lpComputerNameW
= HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName
);
340 BOOL32 ret
= SetComputerName32W(lpComputerNameW
);
341 HeapFree(GetProcessHeap(),0,lpComputerNameW
);
346 /******************************************************************************
347 * SetComputerName32W [KERNEL32.622]
350 * lpComputerName [I] Address of new computer name
354 BOOL32 WINAPI
SetComputerName32W( LPCWSTR lpComputerName
)
356 FIXME(win32
, "(%s): stub\n", debugstr_w(lpComputerName
));