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 BOOL32 WINAPI
UTRegister(HMODULE32 hModule
,
26 /*UT32PROC*/ LPVOID
*ppfn32Thunk
,
27 /*FARPROC*/ LPVOID pfnUT32CallBack
,
30 FIXME(updown
, "(%#x,...): stub\n",hModule
);
34 /****************************************************************************
35 * UTUnRegister (KERNEL32.698)
37 BOOL32 WINAPI
UTUnRegister(HMODULE32 hModule
)
39 FIXME(updown
, "(%#x...): stub\n", hModule
);
44 /****************************************************************************
45 * QueryPerformanceCounter (KERNEL32.564)
47 BOOL32 WINAPI
QueryPerformanceCounter(LPLARGE_INTEGER counter
)
51 gettimeofday(&tv
,NULL
);
52 counter
->LowPart
= tv
.tv_usec
+tv
.tv_sec
*1000000;
53 counter
->HighPart
= 0;
57 HANDLE32 WINAPI
FindFirstChangeNotification32A(LPCSTR lpPathName
,BOOL32 bWatchSubtree
,DWORD dwNotifyFilter
) {
58 FIXME(file
,"(%s,%d,%08lx): stub\n",
59 lpPathName
,bWatchSubtree
,dwNotifyFilter
);
63 BOOL32 WINAPI
FindNextChangeNotification(HANDLE32 fcnhandle
) {
64 FIXME(file
,"(%08x): stub!\n",fcnhandle
);
68 BOOL32 WINAPI
FindCloseChangeNotification(HANDLE32 fcnhandle
) {
69 FIXME(file
,"(%08x): stub!\n",fcnhandle
);
73 /****************************************************************************
74 * QueryPerformanceFrequency (KERNEL32.565)
76 BOOL32 WINAPI
QueryPerformanceFrequency(LPLARGE_INTEGER frequency
)
78 frequency
->LowPart
= 1000000;
79 frequency
->HighPart
= 0;
83 /****************************************************************************
84 * DeviceIoControl (KERNEL32.188)
86 BOOL32 WINAPI
DeviceIoControl(HANDLE32 hDevice
, DWORD dwIoControlCode
,
87 LPVOID lpvlnBuffer
, DWORD cblnBuffer
,
88 LPVOID lpvOutBuffer
, DWORD cbOutBuffer
,
89 LPDWORD lpcbBytesReturned
,
90 LPOVERLAPPED lpoPverlapped
)
93 FIXME(comm
, "(...): stub!\n");
94 /* FIXME: Set appropriate error */
99 /****************************************************************************
100 * FlushInstructionCache (KERNEL32.261)
102 BOOL32 WINAPI
FlushInstructionCache(DWORD x
,DWORD y
,DWORD z
) {
103 FIXME(debug
,"(0x%08lx,0x%08lx,0x%08lx): stub\n",x
,y
,z
);
107 /***********************************************************************
108 * CreateNamedPipeA (KERNEL32.168)
110 HANDLE32 WINAPI
CreateNamedPipeA (LPCSTR lpName
, DWORD dwOpenMode
,
111 DWORD dwPipeMode
, DWORD nMaxInstances
,
112 DWORD nOutBufferSize
, DWORD nInBufferSize
,
113 DWORD nDafaultTimeOut
,
114 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
116 FIXME (win32
, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
117 debugstr_a(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
118 nOutBufferSize
, nInBufferSize
, nDafaultTimeOut
,
119 lpSecurityAttributes
);
120 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
121 SetLastError (ERROR_INVALID_PARAMETER);
122 return INVALID_HANDLE_VALUE;
125 SetLastError (ERROR_UNKNOWN
);
126 return INVALID_HANDLE_VALUE32
;
129 /***********************************************************************
130 * CreateNamedPipeW (KERNEL32.169)
132 HANDLE32 WINAPI
CreateNamedPipeW (LPCWSTR lpName
, DWORD dwOpenMode
,
133 DWORD dwPipeMode
, DWORD nMaxInstances
,
134 DWORD nOutBufferSize
, DWORD nInBufferSize
,
135 DWORD nDafaultTimeOut
,
136 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
138 FIXME (win32
, "(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
139 debugstr_w(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
140 nOutBufferSize
, nInBufferSize
, nDafaultTimeOut
,
141 lpSecurityAttributes
);
143 SetLastError (ERROR_UNKNOWN
);
144 return INVALID_HANDLE_VALUE32
;
147 /***********************************************************************
148 * GetSystemPowerStatus (KERNEL32.621)
150 BOOL32 WINAPI
GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr
)
152 return FALSE
; /* no power management support */
156 /***********************************************************************
157 * SetSystemPowerState (KERNEL32.630)
159 BOOL32 WINAPI
SetSystemPowerState(BOOL32 suspend_or_hibernate
,
162 /* suspend_or_hibernate flag: w95 does not support
163 this feature anyway */
178 /******************************************************************************
179 * CreateMailslot32A [KERNEL32.164]
181 HANDLE32 WINAPI
CreateMailslot32A( LPCSTR lpName
, DWORD nMaxMessageSize
,
182 DWORD lReadTimeout
, LPSECURITY_ATTRIBUTES sa
)
184 FIXME(win32
, "(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName
),
185 nMaxMessageSize
, lReadTimeout
, sa
);
190 /******************************************************************************
191 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
194 * lpName [I] Pointer to string for mailslot name
195 * nMaxMessageSize [I] Maximum message size
196 * lReadTimeout [I] Milliseconds before read time-out
197 * sa [I] Pointer to security structure
200 * Success: Handle to mailslot
201 * Failure: INVALID_HANDLE_VALUE
203 HANDLE32 WINAPI
CreateMailslot32W( LPCWSTR lpName
, DWORD nMaxMessageSize
,
204 DWORD lReadTimeout
, LPSECURITY_ATTRIBUTES sa
)
206 FIXME(win32
, "(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName
),
207 nMaxMessageSize
, lReadTimeout
, sa
);
212 /******************************************************************************
213 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
216 * hMailslot [I] Mailslot handle
217 * lpMaxMessageSize [O] Address of maximum message size
218 * lpNextSize [O] Address of size of next message
219 * lpMessageCount [O] Address of number of messages
220 * lpReadTimeout [O] Address of read time-out
226 BOOL32 WINAPI
GetMailslotInfo( HANDLE32 hMailslot
, LPDWORD lpMaxMessageSize
,
227 LPDWORD lpNextSize
, LPDWORD lpMessageCount
,
228 LPDWORD lpReadTimeout
)
230 FIXME(win32
, "(%d): stub\n",hMailslot
);
231 *lpMaxMessageSize
= NULL
;
233 *lpMessageCount
= NULL
;
234 *lpReadTimeout
= NULL
;
239 /******************************************************************************
240 * GetCompressedFileSize32A [KERNEL32.291]
243 * This should call the W function below
245 DWORD WINAPI
GetCompressedFileSize32A(
247 LPDWORD lpFileSizeHigh
)
249 FIXME(win32
, "(...): stub\n");
254 /******************************************************************************
255 * GetCompressedFileSize32W [KERNEL32.292]
258 * Success: Low-order doubleword of number of bytes
259 * Failure: 0xffffffff
261 DWORD WINAPI
GetCompressedFileSize32W(
262 LPCWSTR lpFileName
, /* [in] Pointer to name of file */
263 LPDWORD lpFileSizeHigh
) /* [out] Receives high-order doubleword of size */
265 FIXME(win32
, "(%s,%p): stub\n",debugstr_w(lpFileName
),lpFileSizeHigh
);
270 /******************************************************************************
271 * GetProcessWindowStation [USER32.280] Returns handle of window station
274 * Docs say the return value is HWINSTA
277 * Success: Handle to window station associated with calling process
280 DWORD WINAPI
GetProcessWindowStation(void)
282 FIXME(win32
, "(void): stub\n");
287 /******************************************************************************
288 * GetThreadDesktop [USER32.295] Returns handle to desktop
291 * Docs say the return value is HDESK
294 * dwThreadId [I] Thread identifier
297 * Success: Handle to desktop associated with specified thread
300 DWORD WINAPI
GetThreadDesktop( DWORD dwThreadId
)
302 FIXME(win32
, "(%ld): stub\n",dwThreadId
);
307 /******************************************************************************
308 * SetDebugErrorLevel [USER32.475]
309 * Sets the minimum error level for generating debugging events
312 * dwLevel [I] Debugging error level
314 VOID WINAPI
SetDebugErrorLevel( DWORD dwLevel
)
316 FIXME(win32
, "(%ld): stub\n", dwLevel
);
320 /******************************************************************************
321 * WaitForDebugEvent [KERNEL32.720]
322 * Waits for a debugging event to occur in a process being debugged
325 * lpDebugEvent [I] Address of structure for event information
326 * dwMilliseconds [I] Number of milliseconds to wait for event
330 BOOL32 WINAPI
WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent
,
331 DWORD dwMilliseconds
)
333 FIXME(win32
, "(%p,%ld): stub\n", lpDebugEvent
, dwMilliseconds
);
338 /******************************************************************************
339 * SetComputerName32A [KERNEL32.621]
341 BOOL32 WINAPI
SetComputerName32A( LPCSTR lpComputerName
)
343 LPWSTR lpComputerNameW
= HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName
);
344 BOOL32 ret
= SetComputerName32W(lpComputerNameW
);
345 HeapFree(GetProcessHeap(),0,lpComputerNameW
);
350 /******************************************************************************
351 * SetComputerName32W [KERNEL32.622]
354 * lpComputerName [I] Address of new computer name
358 BOOL32 WINAPI
SetComputerName32W( LPCWSTR lpComputerName
)
360 FIXME(win32
, "(%s): stub\n", debugstr_w(lpComputerName
));
365 BOOL32 WINAPI
EnumPorts32A(LPSTR name
,DWORD level
,LPBYTE ports
,DWORD bufsize
,LPDWORD bufneeded
,LPDWORD bufreturned
) {
366 FIXME(win32
,"(%s,%d,%p,%d,%p,%p), stub!\n",name
,level
,ports
,bufsize
,bufneeded
,bufreturned
);