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
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
)
29 gettimeofday(&tv
,NULL
);
30 counter
->s
.LowPart
= tv
.tv_usec
+tv
.tv_sec
*1000000;
31 counter
->s
.HighPart
= 0;
35 /****************************************************************************
36 * QueryPerformanceFrequency (KERNEL32.565)
38 BOOL WINAPI
QueryPerformanceFrequency(PLARGE_INTEGER frequency
)
40 frequency
->s
.LowPart
= 1000000;
41 frequency
->s
.HighPart
= 0;
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
);
53 /***********************************************************************
54 * CreateNamedPipeA (KERNEL32.168)
56 HANDLE WINAPI
CreateNamedPipeA (LPCSTR lpName
, DWORD dwOpenMode
,
57 DWORD dwPipeMode
, DWORD nMaxInstances
,
58 DWORD nOutBufferSize
, DWORD nInBufferSize
,
59 DWORD nDefaultTimeOut
,
60 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
62 FIXME("(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
63 debugstr_a(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
64 nOutBufferSize
, nInBufferSize
, nDefaultTimeOut
, lpSecurityAttributes
);
65 /* if (nMaxInstances > PIPE_UNLIMITED_INSTANCES) {
66 SetLastError (ERROR_INVALID_PARAMETER);
67 return INVALID_HANDLE_VALUE;
70 SetLastError (ERROR_UNKNOWN
);
71 return INVALID_HANDLE_VALUE
;
74 /***********************************************************************
75 * CreateNamedPipeW (KERNEL32.169)
77 HANDLE WINAPI
CreateNamedPipeW (LPCWSTR lpName
, DWORD dwOpenMode
,
78 DWORD dwPipeMode
, DWORD nMaxInstances
,
79 DWORD nOutBufferSize
, DWORD nInBufferSize
,
80 DWORD nDefaultTimeOut
,
81 LPSECURITY_ATTRIBUTES lpSecurityAttributes
)
83 FIXME("(Name=%s, OpenMode=%#08lx, dwPipeMode=%#08lx, MaxInst=%ld, OutBSize=%ld, InBuffSize=%ld, DefTimeOut=%ld, SecAttr=%p): stub\n",
84 debugstr_w(lpName
), dwOpenMode
, dwPipeMode
, nMaxInstances
,
85 nOutBufferSize
, nInBufferSize
, nDefaultTimeOut
, lpSecurityAttributes
);
87 SetLastError (ERROR_UNKNOWN
);
88 return INVALID_HANDLE_VALUE
;
91 /***********************************************************************
92 * PeekNamedPipe (KERNEL32.552)
94 BOOL WINAPI
PeekNamedPipe (HANDLE hPipe
,
95 LPVOID lpvBuffer
, DWORD cbBuffer
,
96 LPDWORD lpcbRead
, LPDWORD lpcbAvail
, LPDWORD lpcbMessage
)
98 FIXME("(%08x, %p, %08lx, %p, %p, %p): stub\n",
99 hPipe
, lpvBuffer
, cbBuffer
, lpcbRead
, lpcbAvail
, lpcbMessage
);
101 SetLastError(ERROR_CALL_NOT_IMPLEMENTED
);
106 /***********************************************************************
107 * GetSystemPowerStatus (KERNEL32.621)
109 BOOL WINAPI
GetSystemPowerStatus(LPSYSTEM_POWER_STATUS sps_ptr
)
111 return FALSE
; /* no power management support */
115 /***********************************************************************
116 * SetSystemPowerState (KERNEL32.630)
118 BOOL WINAPI
SetSystemPowerState(BOOL suspend_or_hibernate
,
121 /* suspend_or_hibernate flag: w95 does not support
122 this feature anyway */
137 /******************************************************************************
138 * CreateMailslotA [KERNEL32.164]
140 HANDLE WINAPI
CreateMailslotA( LPCSTR lpName
, DWORD nMaxMessageSize
,
141 DWORD lReadTimeout
, LPSECURITY_ATTRIBUTES sa
)
143 FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_a(lpName
),
144 nMaxMessageSize
, lReadTimeout
, sa
);
149 /******************************************************************************
150 * CreateMailslotW [KERNEL32.165] Creates a mailslot with specified name
153 * lpName [I] Pointer to string for mailslot name
154 * nMaxMessageSize [I] Maximum message size
155 * lReadTimeout [I] Milliseconds before read time-out
156 * sa [I] Pointer to security structure
159 * Success: Handle to mailslot
160 * Failure: INVALID_HANDLE_VALUE
162 HANDLE WINAPI
CreateMailslotW( LPCWSTR lpName
, DWORD nMaxMessageSize
,
163 DWORD lReadTimeout
, LPSECURITY_ATTRIBUTES sa
)
165 FIXME("(%s,%ld,%ld,%p): stub\n", debugstr_w(lpName
),
166 nMaxMessageSize
, lReadTimeout
, sa
);
171 /******************************************************************************
172 * GetMailslotInfo [KERNEL32.347] Retrieves info about specified mailslot
175 * hMailslot [I] Mailslot handle
176 * lpMaxMessageSize [O] Address of maximum message size
177 * lpNextSize [O] Address of size of next message
178 * lpMessageCount [O] Address of number of messages
179 * lpReadTimeout [O] Address of read time-out
185 BOOL WINAPI
GetMailslotInfo( HANDLE hMailslot
, LPDWORD lpMaxMessageSize
,
186 LPDWORD lpNextSize
, LPDWORD lpMessageCount
,
187 LPDWORD lpReadTimeout
)
189 FIXME("(%04x): stub\n",hMailslot
);
190 if (lpMaxMessageSize
) *lpMaxMessageSize
= (DWORD
)NULL
;
191 if (lpNextSize
) *lpNextSize
= (DWORD
)NULL
;
192 if (lpMessageCount
) *lpMessageCount
= (DWORD
)NULL
;
193 if (lpReadTimeout
) *lpReadTimeout
= (DWORD
)NULL
;
198 /******************************************************************************
199 * GetCompressedFileSizeA [KERNEL32.291]
202 * This should call the W function below
204 DWORD WINAPI
GetCompressedFileSizeA(
206 LPDWORD lpFileSizeHigh
)
208 FIXME("(...): stub\n");
213 /******************************************************************************
214 * GetCompressedFileSizeW [KERNEL32.292]
217 * Success: Low-order doubleword of number of bytes
218 * Failure: 0xffffffff
220 DWORD WINAPI
GetCompressedFileSizeW(
221 LPCWSTR lpFileName
, /* [in] Pointer to name of file */
222 LPDWORD lpFileSizeHigh
) /* [out] Receives high-order doubleword of size */
224 FIXME("(%s,%p): stub\n",debugstr_w(lpFileName
),lpFileSizeHigh
);
229 /******************************************************************************
230 * SetComputerNameA [KERNEL32.621]
232 BOOL WINAPI
SetComputerNameA( LPCSTR lpComputerName
)
234 LPWSTR lpComputerNameW
= HEAP_strdupAtoW(GetProcessHeap(),0,lpComputerName
);
235 BOOL ret
= SetComputerNameW(lpComputerNameW
);
236 HeapFree(GetProcessHeap(),0,lpComputerNameW
);
241 /******************************************************************************
242 * SetComputerNameW [KERNEL32.622]
245 * lpComputerName [I] Address of new computer name
249 BOOL WINAPI
SetComputerNameW( LPCWSTR lpComputerName
)
251 FIXME("(%s): stub\n", debugstr_w(lpComputerName
));
255 /******************************************************************************
258 BOOL WINAPI
EnumPortsA(LPSTR name
,DWORD level
,LPBYTE ports
,DWORD bufsize
,LPDWORD bufneeded
,LPDWORD bufreturned
) {
259 FIXME("(%s,%ld,%p,%ld,%p,%p), stub!\n",name
,level
,ports
,bufsize
,bufneeded
,bufreturned
);
263 /******************************************************************************
264 * CreateIoCompletionPort
266 HANDLE WINAPI
CreateIoCompletionPort(HANDLE hFileHandle
,
267 HANDLE hExistingCompletionPort
, DWORD dwCompletionKey
,
268 DWORD dwNumberOfConcurrentThreads
)
270 FIXME("(%04x, %04x, %08lx, %08lx): stub.\n", hFileHandle
, hExistingCompletionPort
, dwCompletionKey
, dwNumberOfConcurrentThreads
);