Release 980601
[wine.git] / win32 / newfns.c
blob376f4a19a909e7066b60cc23084901ae4bdd6e74
1 /*
2 * Win32 miscellaneous functions
4 * Copyright 1995 Thomas Sandford (tdgsandf@prds-grn.demon.co.uk)
5 */
7 /* Misc. new functions - they should be moved into appropriate files
8 at a later date. */
10 #include <string.h>
11 #include <sys/time.h>
12 #include <unistd.h>
13 #include "windows.h"
14 #include "winnt.h"
15 #include "winerror.h"
16 #include "heap.h"
17 #include "debug.h"
19 /****************************************************************************
20 * UTRegister (KERNEL32.697)
22 BOOL32 WINAPI UTRegister(HMODULE32 hModule,
23 LPSTR lpsz16BITDLL,
24 LPSTR lpszInitName,
25 LPSTR lpszProcName,
26 /*UT32PROC*/ LPVOID *ppfn32Thunk,
27 /*FARPROC*/ LPVOID pfnUT32CallBack,
28 LPVOID lpBuff)
30 FIXME(updown, "(%#x,...): stub\n",hModule);
31 return TRUE;
34 /****************************************************************************
35 * UTUnRegister (KERNEL32.698)
37 BOOL32 WINAPI UTUnRegister(HMODULE32 hModule)
39 FIXME(updown, "(%#x...): stub\n", hModule);
40 return TRUE;
44 /****************************************************************************
45 * QueryPerformanceCounter (KERNEL32.564)
47 BOOL32 WINAPI QueryPerformanceCounter(LPLARGE_INTEGER counter)
49 struct timeval tv;
51 gettimeofday(&tv,NULL);
52 counter->LowPart = tv.tv_usec+tv.tv_sec*1000000;
53 counter->HighPart = 0;
54 return TRUE;
57 HANDLE32 WINAPI FindFirstChangeNotification32A(LPCSTR lpPathName,BOOL32 bWatchSubtree,DWORD dwNotifyFilter) {
58 FIXME(file,"(%s,%d,%08lx): stub\n",
59 lpPathName,bWatchSubtree,dwNotifyFilter);
60 return 0xcafebabe;
63 BOOL32 WINAPI FindNextChangeNotification(HANDLE32 fcnhandle) {
64 FIXME(file,"(%08x): stub!\n",fcnhandle);
65 return FALSE;
68 BOOL32 WINAPI FindCloseChangeNotification(HANDLE32 fcnhandle) {
69 FIXME(file,"(%08x): stub!\n",fcnhandle);
70 return FALSE;
73 /****************************************************************************
74 * QueryPerformanceFrequency (KERNEL32.565)
76 BOOL32 WINAPI QueryPerformanceFrequency(LPLARGE_INTEGER frequency)
78 frequency->LowPart = 1000000;
79 frequency->HighPart = 0;
80 return TRUE;
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 */
95 return FALSE;
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);
104 return TRUE;
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;
123 } */
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,
160 BOOL32 force_flag)
162 /* suspend_or_hibernate flag: w95 does not support
163 this feature anyway */
165 for ( ;0; )
167 if ( force_flag )
170 else
174 return TRUE;
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);
186 return 1;
190 /******************************************************************************
191 * CreateMailslot32W [KERNEL32.165] Creates a mailslot with specified name
193 * PARAMS
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
199 * RETURNS
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);
208 return 1;
212 /******************************************************************************
213 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
215 * PARAMS
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
222 * RETURNS
223 * Success: TRUE
224 * Failure: FALSE
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;
232 *lpNextSize = NULL;
233 *lpMessageCount = NULL;
234 *lpReadTimeout = NULL;
235 return TRUE;
239 /******************************************************************************
240 * GetCompressedFileSize32A [KERNEL32.291]
242 * NOTES
243 * This should call the W function below
245 DWORD WINAPI GetCompressedFileSize32A(
246 LPCSTR lpFileName,
247 LPDWORD lpFileSizeHigh)
249 FIXME(win32, "(...): stub\n");
250 return 0xffffffff;
254 /******************************************************************************
255 * GetCompressedFileSize32W [KERNEL32.292]
257 * RETURNS
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);
266 return 0xffffffff;
270 /******************************************************************************
271 * GetProcessWindowStation [USER32.280] Returns handle of window station
273 * NOTES
274 * Docs say the return value is HWINSTA
276 * RETURNS
277 * Success: Handle to window station associated with calling process
278 * Failure: NULL
280 DWORD WINAPI GetProcessWindowStation(void)
282 FIXME(win32, "(void): stub\n");
283 return 1;
287 /******************************************************************************
288 * GetThreadDesktop [USER32.295] Returns handle to desktop
290 * NOTES
291 * Docs say the return value is HDESK
293 * PARAMS
294 * dwThreadId [I] Thread identifier
296 * RETURNS
297 * Success: Handle to desktop associated with specified thread
298 * Failure: NULL
300 DWORD WINAPI GetThreadDesktop( DWORD dwThreadId )
302 FIXME(win32, "(%ld): stub\n",dwThreadId);
303 return 1;
307 /******************************************************************************
308 * SetDebugErrorLevel [USER32.475]
309 * Sets the minimum error level for generating debugging events
311 * PARAMS
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
324 * PARAMS
325 * lpDebugEvent [I] Address of structure for event information
326 * dwMilliseconds [I] Number of milliseconds to wait for event
328 * RETURNS STD
330 BOOL32 WINAPI WaitForDebugEvent( LPDEBUG_EVENT lpDebugEvent,
331 DWORD dwMilliseconds )
333 FIXME(win32, "(%p,%ld): stub\n", lpDebugEvent, dwMilliseconds);
334 return TRUE;
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);
346 return ret;
350 /******************************************************************************
351 * SetComputerName32W [KERNEL32.622]
353 * PARAMS
354 * lpComputerName [I] Address of new computer name
356 * RETURNS STD
358 BOOL32 WINAPI SetComputerName32W( LPCWSTR lpComputerName )
360 FIXME(win32, "(%s): stub\n", debugstr_w(lpComputerName));
361 return TRUE;
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);
367 return FALSE;