Combobox should clear its current selection on response to
[wine/hacks.git] / win32 / newfns.c
blobca02763e8a97bc0adbd3d6d8a0b7cdf31e7e8081
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 "windef.h"
14 #include "winerror.h"
15 #include "heap.h"
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)
27 struct timeval tv;
29 gettimeofday(&tv,NULL);
30 counter->s.LowPart = tv.tv_usec+tv.tv_sec*1000000;
31 counter->s.HighPart = 0;
32 return TRUE;
35 /****************************************************************************
36 * QueryPerformanceFrequency (KERNEL32.565)
38 BOOL WINAPI QueryPerformanceFrequency(PLARGE_INTEGER frequency)
40 frequency->s.LowPart = 1000000;
41 frequency->s.HighPart = 0;
42 return TRUE;
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);
50 return TRUE;
53 /***********************************************************************
54 * GetSystemPowerStatus (KERNEL32.621)
56 BOOL WINAPI GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr)
58 return FALSE; /* no power management support */
62 /***********************************************************************
63 * SetSystemPowerState (KERNEL32.630)
65 BOOL WINAPI SetSystemPowerState(BOOL suspend_or_hibernate,
66 BOOL force_flag)
68 /* suspend_or_hibernate flag: w95 does not support
69 this feature anyway */
71 for ( ;0; )
73 if ( force_flag )
76 else
80 return TRUE;
84 /******************************************************************************
85 * CreateMailslotA [KERNEL32.164]
87 HANDLE WINAPI CreateMailslotA( LPCSTR lpName, DWORD nMaxMessageSize,
88 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa)
90 FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName),
91 nMaxMessageSize, lReadTimeout, sa);
92 return 1;
96 /******************************************************************************
97 * CreateMailslotW [KERNEL32.165] Creates a mailslot with specified name
99 * PARAMS
100 * lpName [I] Pointer to string for mailslot name
101 * nMaxMessageSize [I] Maximum message size
102 * lReadTimeout [I] Milliseconds before read time-out
103 * sa [I] Pointer to security structure
105 * RETURNS
106 * Success: Handle to mailslot
107 * Failure: INVALID_HANDLE_VALUE
109 HANDLE WINAPI CreateMailslotW( LPCWSTR lpName, DWORD nMaxMessageSize,
110 DWORD lReadTimeout, LPSECURITY_ATTRIBUTES sa )
112 FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName),
113 nMaxMessageSize, lReadTimeout, sa);
114 return 1;
118 /******************************************************************************
119 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
121 * PARAMS
122 * hMailslot [I] Mailslot handle
123 * lpMaxMessageSize [O] Address of maximum message size
124 * lpNextSize [O] Address of size of next message
125 * lpMessageCount [O] Address of number of messages
126 * lpReadTimeout [O] Address of read time-out
128 * RETURNS
129 * Success: TRUE
130 * Failure: FALSE
132 BOOL WINAPI GetMailslotInfo( HANDLE hMailslot, LPDWORD lpMaxMessageSize,
133 LPDWORD lpNextSize, LPDWORD lpMessageCount,
134 LPDWORD lpReadTimeout )
136 FIXME("(%04x): stub\n",hMailslot);
137 if (lpMaxMessageSize) *lpMaxMessageSize = (DWORD)NULL;
138 if (lpNextSize) *lpNextSize = (DWORD)NULL;
139 if (lpMessageCount) *lpMessageCount = (DWORD)NULL;
140 if (lpReadTimeout) *lpReadTimeout = (DWORD)NULL;
141 return TRUE;
145 /******************************************************************************
146 * GetCompressedFileSizeA [KERNEL32.291]
148 * NOTES
149 * This should call the W function below
151 DWORD WINAPI GetCompressedFileSizeA(
152 LPCSTR lpFileName,
153 LPDWORD lpFileSizeHigh)
155 FIXME("(...): stub\n");
156 return 0xffffffff;
160 /******************************************************************************
161 * GetCompressedFileSizeW [KERNEL32.292]
163 * RETURNS
164 * Success: Low-order doubleword of number of bytes
165 * Failure: 0xffffffff
167 DWORD WINAPI GetCompressedFileSizeW(
168 LPCWSTR lpFileName, /* [in] Pointer to name of file */
169 LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
171 FIXME("(%s,%p): stub\n",debugstr_w(lpFileName),lpFileSizeHigh);
172 return 0xffffffff;
176 /******************************************************************************
177 * SetComputerNameA [KERNEL32.621]
179 BOOL WINAPI SetComputerNameA( LPCSTR lpComputerName )
181 LPWSTR lpComputerNameW = HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName);
182 BOOL ret = SetComputerNameW(lpComputerNameW);
183 HeapFree(GetProcessHeap(),0,lpComputerNameW);
184 return ret;
188 /******************************************************************************
189 * SetComputerNameW [KERNEL32.622]
191 * PARAMS
192 * lpComputerName [I] Address of new computer name
194 * RETURNS STD
196 BOOL WINAPI SetComputerNameW( LPCWSTR lpComputerName )
198 FIXME("(%s): stub\n", debugstr_w(lpComputerName));
199 return TRUE;
202 /******************************************************************************
203 * CreateIoCompletionPort
205 HANDLE WINAPI CreateIoCompletionPort(HANDLE hFileHandle,
206 HANDLE hExistingCompletionPort, DWORD dwCompletionKey,
207 DWORD dwNumberOfConcurrentThreads)
209 FIXME("(%04x, %04x, %08lx, %08lx): stub.\n", hFileHandle, hExistingCompletionPort, dwCompletionKey, dwNumberOfConcurrentThreads);
210 return (HANDLE)NULL;