ReactOS 0.4.15-dev-5667-ged97270
xcv.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Local Port Monitor
3 * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4 * PURPOSE: Implementation of Xcv* and support functions
5 * COPYRIGHT: Copyright 2015 Colin Finck (colin@reactos.org)
6 */
7
8#include "precomp.h"
9
10static DWORD
11_HandleAddPort(PLOCALMON_XCV pXcv, PBYTE pInputData, PDWORD pcbOutputNeeded)
12{
13 DWORD res, cbPortName;
14 HKEY hroot;
15 HKEY hToken = NULL;
16 PLOCALMON_PORT pPort;
17 PLOCALMON_HANDLE pLocalmon = pXcv->pLocalmon;
18 PWSTR PortName = (PWSTR)pInputData;
19
20 FIXME("LcmXcvAddPort : %s\n", debugstr_w( (LPWSTR) PortName ) );
21
22 if (!pLocalmon )
23 {
25 goto Cleanup;
26 }
27
28 // This action can only happen at SERVER_ACCESS_ADMINISTER access level.
30 {
32 goto Cleanup;
33 }
34
35 // Switch to the SYSTEM context for modifying the registry.
36 hToken = RevertToPrinterSelf();
37 if (!hToken)
38 {
39 res = GetLastError();
40 ERR("RevertToPrinterSelf failed with error %lu!\n", res);
41 goto Cleanup;
42 }
43
44 res = RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports", &hroot);
45 if (res == ERROR_SUCCESS)
46 {
47 if ( DoesPortExist( PortName ) )
48 {
49 RegCloseKey(hroot);
50 FIXME("=> %u\n", ERROR_ALREADY_EXISTS);
52 goto Cleanup;
53 }
54
55 cbPortName = (wcslen( PortName ) + 1) * sizeof(WCHAR);
56
57 // Create a new LOCALMON_PORT structure for it.
58 pPort = DllAllocSplMem(sizeof(LOCALMON_PORT) + cbPortName);
59 if (!pPort)
60 {
62 RegCloseKey( hroot );
63 goto Cleanup;
64 }
65 memset( pPort, 0, sizeof(LOCALMON_PORT) + cbPortName );
66
68 pPort->pLocalmon = pLocalmon;
69 pPort->pwszPortName = wcscpy( (PWSTR)(pPort+1), PortName );
70
71 // Insert it into the Registry list.
72 InsertTailList(&pLocalmon->RegistryPorts, &pPort->Entry);
73
74 res = RegSetValueExW(hroot, PortName, 0, REG_SZ, (const BYTE *) L"", sizeof(L""));
75 RegCloseKey(hroot);
76 }
77
78 FIXME("=> %u\n", res);
79
81 if (hToken) ImpersonatePrinterClient(hToken);
83 return res;
84}
85
104static DWORD
106{
107 DWORD cbBuffer;
108 DWORD dwErrorCode;
109 HKEY hKey = NULL;
110 HKEY hToken = NULL;
111
112 // Sanity checks
113 if (!pXcv || !pInputData || !pcbOutputNeeded)
114 {
115 dwErrorCode = ERROR_INVALID_PARAMETER;
116 goto Cleanup;
117 }
118
119 *pcbOutputNeeded = 0;
120
121 // This action can only happen at SERVER_ACCESS_ADMINISTER access level.
123 {
124 dwErrorCode = ERROR_ACCESS_DENIED;
125 goto Cleanup;
126 }
127
128 // Switch to the SYSTEM context for modifying the registry.
129 hToken = RevertToPrinterSelf();
130 if (!hToken)
131 {
132 dwErrorCode = GetLastError();
133 ERR("RevertToPrinterSelf failed with error %lu!\n", dwErrorCode);
134 goto Cleanup;
135 }
136
137 // Open the key where our value is stored.
138 dwErrorCode = (DWORD)RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Windows", 0, KEY_SET_VALUE, &hKey);
139 if (dwErrorCode != ERROR_SUCCESS)
140 {
141 ERR("RegOpenKeyExW failed with status %lu!\n", dwErrorCode);
142 goto Cleanup;
143 }
144
145 // We don't use cbInputData here, because the buffer pInputData could be bigger than the data it contains.
146 cbBuffer = (wcslen((PWSTR)pInputData) + 1) * sizeof(WCHAR);
147
148 // Write the value to the registry.
149 dwErrorCode = (DWORD)RegSetValueExW(hKey, L"TransmissionRetryTimeout", 0, REG_SZ, pInputData, cbBuffer);
150 if (dwErrorCode != ERROR_SUCCESS)
151 {
152 ERR("RegSetValueExW failed with status %lu!\n", dwErrorCode);
153 goto Cleanup;
154 }
155
156Cleanup:
157 if (hKey)
159
160 if (hToken)
162
163 return dwErrorCode;
164}
165
166static DWORD
167_HandleDeletePort(PLOCALMON_XCV pXcv, PBYTE pInputData, PDWORD pcbOutputNeeded)
168{
169 DWORD res;
170 HKEY hroot;
171 HKEY hToken = NULL;
172 PLOCALMON_HANDLE pLocalmon = pXcv->pLocalmon;
173 PLOCALMON_PORT pPort = NULL;
175 PWSTR pPortName = (PWSTR)pInputData;
176
177 FIXME("LcmXcvDeletePort : %s\n", debugstr_w( pPortName ) );
178
179 if (!pLocalmon )
180 {
182 goto Cleanup;
183 }
184
185 // This action can only happen at SERVER_ACCESS_ADMINISTER access level.
187 {
189 goto Cleanup;
190 }
191
192 // Switch to the SYSTEM context for modifying the registry.
193 hToken = RevertToPrinterSelf();
194 if (!hToken)
195 {
196 res = GetLastError();
197 ERR("RevertToPrinterSelf failed with error %lu!\n", res);
198 goto Cleanup;
199 }
200
201 res = RegOpenKeyW(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports", &hroot);
202 if ( res == ERROR_SUCCESS )
203 {
204 res = RegDeleteValueW(hroot, pPortName );
205
206 RegCloseKey(hroot);
207
208 if ( res == ERROR_SUCCESS )
209 {
210 EnterCriticalSection(&pLocalmon->Section);
211
212 if (!IsListEmpty(&pLocalmon->RegistryPorts) )
213 {
214 for (pEntry = pLocalmon->RegistryPorts.Flink; pEntry != &pLocalmon->RegistryPorts; pEntry = pEntry->Flink)
215 {
217
218 if (wcscmp(pPort->pwszPortName, pPortName) == 0)
219 break;
220 }
221 }
222
223 LeaveCriticalSection(&pLocalmon->Section);
224
225 if ( pPort )
226 {
227 FIXME("LcmXcvDeletePort removed Port Entry\n");
229 RemoveEntryList(&pPort->Entry);
231
232 DllFreeSplMem(pPort);
233 }
234 }
235 FIXME("LcmXcvDeletePort => %u with %u\n", res, GetLastError() );
236 }
237
238Cleanup:
239 if (hToken) ImpersonatePrinterClient(hToken);
241 return res;
242}
243
265static DWORD
266_HandleGetDefaultCommConfig(PBYTE pInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
267{
268 // Sanity checks
269 if (!pInputData || !pcbOutputNeeded)
271
272 *pcbOutputNeeded = sizeof(COMMCONFIG);
273
274 // Check if the supplied buffer is large enough.
275 if (cbOutputData < *pcbOutputNeeded)
277
278 // Finally get the port configuration.
279 if (!GetDefaultCommConfigW((PCWSTR)pInputData, (LPCOMMCONFIG)pOutputData, pcbOutputNeeded))
280 return GetLastError();
281
282 return ERROR_SUCCESS;
283}
284
303static DWORD
304_HandleGetTransmissionRetryTimeout(PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
305{
307
308 // Sanity checks
309 if (!pOutputData || !pcbOutputNeeded)
311
312 *pcbOutputNeeded = sizeof(DWORD);
313
314 // Check if the supplied buffer is large enough.
315 if (cbOutputData < *pcbOutputNeeded)
317
318 // Retrieve and copy the number.
320 CopyMemory(pOutputData, &dwTimeout, sizeof(DWORD));
321 return ERROR_SUCCESS;
322}
323
341static DWORD
342_HandleMonitorUI(PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
343{
344 const WCHAR wszMonitorUI[] = L"LocalUI.dll";
345
346 // Sanity checks
347 if (!pcbOutputNeeded)
349
350 *pcbOutputNeeded = sizeof(wszMonitorUI);
351
352 // Check if the supplied buffer is large enough.
353 if (cbOutputData < *pcbOutputNeeded)
355
356 if (!pOutputData)
358
359 // Copy the string.
360 CopyMemory(pOutputData, wszMonitorUI, sizeof(wszMonitorUI));
361 return ERROR_SUCCESS;
362}
363
384static DWORD
385_HandlePortExists(PBYTE pInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
386{
387 // Sanity checks
388 if (!pInputData || !pOutputData || !pcbOutputNeeded)
390
391 *pcbOutputNeeded = sizeof(BOOL);
392
393 // Check if the supplied buffer is large enough.
394 if (cbOutputData < *pcbOutputNeeded)
396
397 // Return the check result and error code.
398 *(PBOOL)pOutputData = DoesPortExist((PCWSTR)pInputData);
399 return GetLastError();
400}
401
402static DWORD
403_HandlePortIsValid(PBYTE pInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
404{
405 DWORD res;
406
407 TRACE("HandlePortIsValid : pInputData %s\n", debugstr_w( (LPWSTR) pInputData));
408
409 res = GetTypeFromName((LPCWSTR) pInputData);
410
411 TRACE("HandlePortIsValid : detected as %u\n", res);
412
413 /* names, that we have recognized, are valid */
414 if (res) return ERROR_SUCCESS;
415
416 TRACE("=> %u\n", GetLastError());
417
418 /* ERROR_ACCESS_DENIED, ERROR_PATH_NOT_FOUND or something else */
419 return GetLastError();
420}
421
441static DWORD
442_HandleSetDefaultCommConfig(PLOCALMON_XCV pXcv, PBYTE pInputData, PDWORD pcbOutputNeeded)
443{
444 DWORD dwErrorCode;
445 HANDLE hToken = NULL;
446 LPCOMMCONFIG pCommConfig;
447 PWSTR pwszPortNameWithoutColon = NULL;
448
449 // Sanity checks
450 // pwszObject needs to be at least 2 characters long to be a port name with a trailing colon.
451 if (!pXcv || !pXcv->pwszObject || !pXcv->pwszObject[0] || !pXcv->pwszObject[1] || !pInputData || !pcbOutputNeeded)
452 {
453 dwErrorCode = ERROR_INVALID_PARAMETER;
454 goto Cleanup;
455 }
456
457 *pcbOutputNeeded = 0;
458
459 // This action can only happen at SERVER_ACCESS_ADMINISTER access level.
461 {
462 dwErrorCode = ERROR_ACCESS_DENIED;
463 goto Cleanup;
464 }
465
466 // SetDefaultCommConfigW needs the port name without colon.
467 dwErrorCode = GetPortNameWithoutColon(pXcv->pwszObject, &pwszPortNameWithoutColon);
468 if (dwErrorCode != ERROR_SUCCESS)
469 goto Cleanup;
470
471 // Switch to the SYSTEM context for setting the port configuration.
472 hToken = RevertToPrinterSelf();
473 if (!hToken)
474 {
475 dwErrorCode = GetLastError();
476 ERR("RevertToPrinterSelf failed with error %lu!\n", dwErrorCode);
477 goto Cleanup;
478 }
479
480 // Finally pass the parameters to SetDefaultCommConfigW.
481 pCommConfig = (LPCOMMCONFIG)pInputData;
482 if (!SetDefaultCommConfigW(pwszPortNameWithoutColon, pCommConfig, pCommConfig->dwSize))
483 {
484 dwErrorCode = GetLastError();
485 ERR("SetDefaultCommConfigW failed with error %lu!\n", dwErrorCode);
486 goto Cleanup;
487 }
488
489 dwErrorCode = ERROR_SUCCESS;
490
491Cleanup:
492 if (hToken)
494
495 if (pwszPortNameWithoutColon)
496 DllFreeSplMem(pwszPortNameWithoutColon);
497
498 return dwErrorCode;
499}
500
503{
505
506 TRACE("LocalmonXcvClosePort(%p)\n", hXcv);
507
508 // Sanity checks
509 if (!pXcv)
510 {
512 return FALSE;
513 }
514
515 // Remove it from the list and free the memory.
517 RemoveEntryList(&pXcv->Entry);
519 DllFreeSplMem(pXcv);
520
522 return TRUE;
523}
524
526LocalmonXcvDataPort(HANDLE hXcv, PCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
527{
528 FIXME("LocalmonXcvDataPort(%p, %S, %p, %lu, %p, %lu, %p)\n", hXcv, pszDataName, pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded);
529
530 // Sanity checks
531 if (!pszDataName)
533
534 // Call the appropriate handler for the requested data name.
535 if (wcscmp(pszDataName, L"AddPort") == 0)
536 return _HandleAddPort((PLOCALMON_XCV)hXcv, pInputData, pcbOutputNeeded);
537
538 if (wcscmp(pszDataName, L"ConfigureLPTPortCommandOK") == 0)
539 return _HandleConfigureLPTPortCommandOK((PLOCALMON_XCV)hXcv, pInputData, pcbOutputNeeded);
540
541 if (wcscmp(pszDataName, L"DeletePort") == 0)
542 return _HandleDeletePort((PLOCALMON_XCV)hXcv, pInputData, pcbOutputNeeded);
543
544 if (wcscmp(pszDataName, L"GetDefaultCommConfig") == 0)
545 return _HandleGetDefaultCommConfig(pInputData, pOutputData, cbOutputData, pcbOutputNeeded);
546
547 if (wcscmp(pszDataName, L"GetTransmissionRetryTimeout") == 0)
548 return _HandleGetTransmissionRetryTimeout(pOutputData, cbOutputData, pcbOutputNeeded);
549
550 if (wcscmp(pszDataName, L"MonitorUI") == 0)
551 return _HandleMonitorUI(pOutputData, cbOutputData, pcbOutputNeeded);
552
553 if (wcscmp(pszDataName, L"PortExists") == 0)
554 return _HandlePortExists(pInputData, pOutputData, cbOutputData, pcbOutputNeeded);
555
556 if (wcscmp(pszDataName, L"PortIsValid") == 0)
557 return _HandlePortIsValid(pInputData, pOutputData, cbOutputData, pcbOutputNeeded);
558
559 if (wcscmp(pszDataName, L"SetDefaultCommConfig") == 0)
560 return _HandleSetDefaultCommConfig((PLOCALMON_XCV)hXcv, pInputData, pcbOutputNeeded);
561
563}
564
567{
568 DWORD cbObject = 0;
569 DWORD dwErrorCode;
570 PLOCALMON_HANDLE pLocalmon = (PLOCALMON_HANDLE)hMonitor;
571 PLOCALMON_XCV pXcv;
572
573 FIXME("LocalmonXcvOpenPort(%p, %S, %lu, %p)\n", hMonitor, pwszObject, GrantedAccess, phXcv);
574
575 // Sanity checks
576 if (!pLocalmon || !phXcv)
577 {
578 dwErrorCode = ERROR_INVALID_PARAMETER;
579 goto Cleanup;
580 }
581
582 if (pwszObject)
583 cbObject = (wcslen(pwszObject) + 1) * sizeof(WCHAR);
584
585 // Create a new LOCALMON_XCV structure and fill the relevant fields.
586 pXcv = DllAllocSplMem(sizeof(LOCALMON_XCV) + cbObject);
587 if (!pXcv)
588 {
589 dwErrorCode = ERROR_NOT_ENOUGH_MEMORY;
590 ERR("DllAllocSplMem failed with error %lu!\n", GetLastError());
591 goto Cleanup;
592 }
593
594 pXcv->pLocalmon = pLocalmon;
596
597 if (cbObject)
598 {
599 pXcv->pwszObject = (PWSTR)((PBYTE)pXcv + sizeof(LOCALMON_XCV));
600 CopyMemory(pXcv->pwszObject, pwszObject, cbObject);
601 }
602
603 InsertTailList(&pLocalmon->XcvHandles, &pXcv->Entry);
604
605 // Return it as the Xcv handle.
606 *phXcv = (HANDLE)pXcv;
607 dwErrorCode = ERROR_SUCCESS;
608
609Cleanup:
610 SetLastError(dwErrorCode);
611 return (dwErrorCode == ERROR_SUCCESS);
612}
static UNICODE_STRING PortName
#define FIXME(fmt,...)
Definition: debug.h:111
#define ERR(fmt,...)
Definition: debug.h:110
#define RegCloseKey(hKey)
Definition: registry.h:47
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3291
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4900
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2355
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
BOOL WINAPI SetDefaultCommConfigW(LPCWSTR lpszDevice, LPCOMMCONFIG lpCommConfig, DWORD dwSize)
Definition: comm.c:1338
BOOL WINAPI GetDefaultCommConfigW(LPCWSTR lpszName, LPCOMMCONFIG lpCC, LPDWORD lpdwSize)
Definition: comm.c:1398
static const WCHAR Cleanup[]
Definition: register.c:80
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
GLuint res
Definition: glext.h:9613
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define debugstr_w
Definition: kernel32.h:32
#define REG_SZ
Definition: layer.c:22
static HANDLE hXcv
Definition: localmon.c:73
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
static DWORD _HandleGetTransmissionRetryTimeout(PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:304
BOOL WINAPI LocalmonXcvOpenPort(HANDLE hMonitor, PCWSTR pwszObject, ACCESS_MASK GrantedAccess, PHANDLE phXcv)
Definition: xcv.c:566
static DWORD _HandleDeletePort(PLOCALMON_XCV pXcv, PBYTE pInputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:167
static DWORD _HandleSetDefaultCommConfig(PLOCALMON_XCV pXcv, PBYTE pInputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:442
BOOL WINAPI LocalmonXcvClosePort(HANDLE hXcv)
Definition: xcv.c:502
static DWORD _HandlePortIsValid(PBYTE pInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:403
static DWORD _HandleGetDefaultCommConfig(PBYTE pInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:266
static DWORD _HandlePortExists(PBYTE pInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:385
DWORD WINAPI LocalmonXcvDataPort(HANDLE hXcv, PCWSTR pszDataName, PBYTE pInputData, DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:526
static DWORD _HandleConfigureLPTPortCommandOK(PLOCALMON_XCV pXcv, PBYTE pInputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:105
static DWORD _HandleAddPort(PLOCALMON_XCV pXcv, PBYTE pInputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:11
static DWORD _HandleMonitorUI(PBYTE pOutputData, DWORD cbOutputData, PDWORD pcbOutputNeeded)
Definition: xcv.c:342
#define BOOL
Definition: nt_native.h:43
ULONG ACCESS_MASK
Definition: nt_native.h:40
#define DWORD
Definition: nt_native.h:44
#define KEY_SET_VALUE
Definition: nt_native.h:1017
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:455
#define L(x)
Definition: ntvdm.h:50
BYTE * PBYTE
Definition: pedump.c:66
DWORD * PDWORD
Definition: pedump.c:68
HANDLE WINAPI RevertToPrinterSelf(VOID)
Definition: context.c:64
BOOL WINAPI ImpersonatePrinterClient(_In_ HANDLE hToken)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE(s)
Definition: solgame.cpp:4
base of all file and directory entries
Definition: entries.h:83
DWORD dwSize
Definition: winbase.h:677
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
LIST_ENTRY XcvHandles
Definition: precomp.h:44
CRITICAL_SECTION Section
Definition: precomp.h:40
LIST_ENTRY RegistryPorts
Definition: precomp.h:43
PWSTR pwszPortName
Definition: precomp.h:55
PLOCALMON_HANDLE pLocalmon
Definition: precomp.h:56
LIST_ENTRY Entry
Definition: precomp.h:54
HANDLE hFile
Definition: precomp.h:67
PLOCALMON_HANDLE pLocalmon
Definition: precomp.h:81
PWSTR pwszObject
Definition: precomp.h:82
LIST_ENTRY Entry
Definition: precomp.h:79
ACCESS_MASK GrantedAccess
Definition: precomp.h:80
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
PVOID HANDLE
Definition: typedefs.h:73
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
BOOL WINAPI DllFreeSplMem(PVOID pMem)
Definition: memory.c:112
PVOID WINAPI DllAllocSplMem(DWORD dwBytes)
Definition: memory.c:95
DWORD GetTypeFromName(LPCWSTR name)
Definition: tools.c:215
struct _LOCALMON_XCV LOCALMON_XCV
DWORD GetPortNameWithoutColon(PCWSTR pwszPortName, PWSTR *ppwszPortNameWithoutColon)
Definition: tools.c:142
struct _LOCALMON_HANDLE * PLOCALMON_HANDLE
struct _LOCALMON_XCV * PLOCALMON_XCV
DWORD GetLPTTransmissionRetryTimeout(VOID)
Definition: tools.c:85
BOOL DoesPortExist(PCWSTR pwszPortName)
Definition: tools.c:24
struct _COMM_CONFIG COMMCONFIG
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define CopyMemory
Definition: winbase.h:1668
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
struct _COMM_CONFIG * LPCOMMCONFIG
Definition: confdlg.c:35
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD dwTimeout
Definition: wincrypt.h:6081
BOOL * PBOOL
Definition: windef.h:161
#define WINAPI
Definition: msvc.h:6
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define SERVER_ACCESS_ADMINISTER
Definition: winspool.h:1366
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess
Definition: sefuncs.h:20
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193