bcrypt: Add support for AES encryption on macOS.
[wine.git] / dlls / localui / localui.c
blob9fb975cd851b5a22aeffbfeab8851e353b946ad0
1 /*
2 * Implementation of the Local Printmonitor User Interface
4 * Copyright 2007 Detlef Riekenberg
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #include "windef.h"
24 #include "winbase.h"
25 #include "wingdi.h"
26 #include "winreg.h"
27 #include "winuser.h"
29 #include "winspool.h"
30 #include "ddk/winsplp.h"
32 #include "wine/debug.h"
33 #include "wine/unicode.h"
34 #include "localui.h"
36 WINE_DEFAULT_DEBUG_CHANNEL(localui);
38 /*****************************************************/
40 static HINSTANCE LOCALUI_hInstance;
42 static const WCHAR cmd_AddPortW[] = {'A','d','d','P','o','r','t',0};
43 static const WCHAR cmd_ConfigureLPTPortCommandOKW[] = {'C','o','n','f','i','g','u','r','e',
44 'L','P','T','P','o','r','t',
45 'C','o','m','m','a','n','d','O','K',0};
46 static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0};
47 static const WCHAR cmd_GetDefaultCommConfigW[] = {'G','e','t',
48 'D','e','f','a','u','l','t',
49 'C','o','m','m','C','o','n','f','i','g',0};
50 static const WCHAR cmd_GetTransmissionRetryTimeoutW[] = {'G','e','t',
51 'T','r','a','n','s','m','i','s','s','i','o','n',
52 'R','e','t','r','y','T','i','m','e','o','u','t',0};
53 static const WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0};
54 static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
55 'D','e','f','a','u','l','t',
56 'C','o','m','m','C','o','n','f','i','g',0};
58 static const WCHAR fmt_uW[] = {'%','u',0};
59 static const WCHAR portname_LPT[] = {'L','P','T',0};
60 static const WCHAR portname_COM[] = {'C','O','M',0};
61 static const WCHAR portname_FILE[] = {'F','I','L','E',':',0};
62 static const WCHAR portname_CUPS[] = {'C','U','P','S',':',0};
63 static const WCHAR portname_LPR[] = {'L','P','R',':',0};
65 static const WCHAR XcvMonitorW[] = {',','X','c','v','M','o','n','i','t','o','r',' ',0};
66 static const WCHAR XcvPortW[] = {',','X','c','v','P','o','r','t',' ',0};
68 /*****************************************************/
70 typedef struct tag_addportui_t {
71 LPWSTR portname;
72 HANDLE hXcv;
73 } addportui_t;
75 typedef struct tag_lptconfig_t {
76 HANDLE hXcv;
77 DWORD value;
78 } lptconfig_t;
81 static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
83 /*****************************************************
84 * strdupWW [internal]
87 static LPWSTR strdupWW(LPCWSTR pPrefix, LPCWSTR pSuffix)
89 LPWSTR ptr;
90 DWORD len;
92 len = lstrlenW(pPrefix) + (pSuffix ? lstrlenW(pSuffix) : 0) + 1;
93 ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
94 if (ptr) {
95 lstrcpyW(ptr, pPrefix);
96 if (pSuffix) lstrcatW(ptr, pSuffix);
98 return ptr;
101 /*****************************************************
102 * dlg_configure_com [internal]
106 static BOOL dlg_configure_com(HANDLE hXcv, HWND hWnd, PCWSTR pPortName)
108 COMMCONFIG cfg;
109 LPWSTR shortname;
110 DWORD status;
111 DWORD dummy;
112 DWORD len;
113 BOOL res;
115 /* strip the colon (pPortName is never empty here) */
116 len = lstrlenW(pPortName);
117 shortname = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
118 if (shortname) {
119 memcpy(shortname, pPortName, (len -1) * sizeof(WCHAR));
120 shortname[len-1] = '\0';
122 /* get current settings */
123 len = FIELD_OFFSET(COMMCONFIG, wcProviderData[1]);
124 status = ERROR_SUCCESS;
125 res = XcvDataW( hXcv, cmd_GetDefaultCommConfigW,
126 (PBYTE) shortname,
127 (lstrlenW(shortname) +1) * sizeof(WCHAR),
128 (PBYTE) &cfg, len, &len, &status);
130 if (res && (status == ERROR_SUCCESS)) {
131 /* display the Dialog */
132 res = CommConfigDialogW(pPortName, hWnd, &cfg);
133 if (res) {
134 status = ERROR_SUCCESS;
135 /* set new settings */
136 res = XcvDataW(hXcv, cmd_SetDefaultCommConfigW,
137 (PBYTE) &cfg, len,
138 (PBYTE) &dummy, 0, &len, &status);
141 HeapFree(GetProcessHeap(), 0, shortname);
142 return res;
144 return FALSE;
148 /*****************************************************
149 * dlg_configure_lpt [internal]
153 static BOOL dlg_configure_lpt(HANDLE hXcv, HWND hWnd)
155 lptconfig_t data;
156 BOOL res;
159 data.hXcv = hXcv;
161 res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(LPTCONFIG_DIALOG), hWnd,
162 dlgproc_lptconfig, (LPARAM) &data);
164 TRACE("got %u with %u\n", res, GetLastError());
166 if (!res) SetLastError(ERROR_CANCELLED);
167 return res;
170 /******************************************************************
171 * dlg_port_already_exists [internal]
174 static void dlg_port_already_exists(HWND hWnd, LPCWSTR portname)
176 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
177 WCHAR res_PortExistsW[IDS_PORTEXISTS_MAXLEN];
178 LPWSTR message;
179 DWORD len;
181 res_PortW[0] = '\0';
182 res_PortExistsW[0] = '\0';
183 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
184 LoadStringW(LOCALUI_hInstance, IDS_PORTEXISTS, res_PortExistsW, IDS_PORTEXISTS_MAXLEN);
186 len = lstrlenW(portname) + IDS_PORTEXISTS_MAXLEN + 1;
187 message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
188 if (message) {
189 message[0] = '\0';
190 snprintfW(message, len, res_PortExistsW, portname);
191 MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
192 HeapFree(GetProcessHeap(), 0, message);
196 /******************************************************************
197 * dlg_invalid_portname [internal]
200 static void dlg_invalid_portname(HWND hWnd, LPCWSTR portname)
202 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
203 WCHAR res_InvalidNameW[IDS_INVALIDNAME_MAXLEN];
204 LPWSTR message;
205 DWORD len;
207 res_PortW[0] = '\0';
208 res_InvalidNameW[0] = '\0';
209 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
210 LoadStringW(LOCALUI_hInstance, IDS_INVALIDNAME, res_InvalidNameW, IDS_INVALIDNAME_MAXLEN);
212 len = lstrlenW(portname) + IDS_INVALIDNAME_MAXLEN;
213 message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
214 if (message) {
215 message[0] = '\0';
216 snprintfW(message, len, res_InvalidNameW, portname);
217 MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
218 HeapFree(GetProcessHeap(), 0, message);
222 /******************************************************************
223 * display the Dialog "Nothing to configure"
227 static void dlg_nothingtoconfig(HWND hWnd)
229 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
230 WCHAR res_nothingW[IDS_NOTHINGTOCONFIG_MAXLEN];
232 res_PortW[0] = '\0';
233 res_nothingW[0] = '\0';
234 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
235 LoadStringW(LOCALUI_hInstance, IDS_NOTHINGTOCONFIG, res_nothingW, IDS_NOTHINGTOCONFIG_MAXLEN);
237 MessageBoxW(hWnd, res_nothingW, res_PortW, MB_OK | MB_ICONINFORMATION);
240 /******************************************************************
241 * dlg_win32error [internal]
244 static void dlg_win32error(HWND hWnd, DWORD lasterror)
246 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
247 LPWSTR message = NULL;
248 DWORD res;
250 res_PortW[0] = '\0';
251 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
254 res = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
255 NULL, lasterror, 0, (LPWSTR) &message, 0, NULL);
257 if (res > 0) {
258 MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
259 LocalFree(message);
263 /*****************************************************************************
267 static INT_PTR CALLBACK dlgproc_addport(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
269 addportui_t * data;
270 DWORD status;
271 DWORD dummy;
272 DWORD len;
273 DWORD res;
275 switch(msg)
277 case WM_INITDIALOG:
278 SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
279 return TRUE;
281 case WM_COMMAND:
282 if (wparam == MAKEWPARAM(IDOK, BN_CLICKED))
284 data = (addportui_t *) GetWindowLongPtrW(hwnd, DWLP_USER);
285 /* length in WCHAR, without the '\0' */
286 len = SendDlgItemMessageW(hwnd, ADDPORT_EDIT, WM_GETTEXTLENGTH, 0, 0);
287 data->portname = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
289 if (!data->portname) {
290 EndDialog(hwnd, FALSE);
291 return TRUE;
293 /* length is in WCHAR, including the '\0' */
294 GetDlgItemTextW(hwnd, ADDPORT_EDIT, data->portname, len + 1);
295 status = ERROR_SUCCESS;
296 res = XcvDataW( data->hXcv, cmd_PortIsValidW, (PBYTE) data->portname,
297 (lstrlenW(data->portname) + 1) * sizeof(WCHAR),
298 (PBYTE) &dummy, 0, &len, &status);
300 TRACE("got %u with status %u\n", res, status);
301 if (res && (status == ERROR_SUCCESS)) {
302 /* The caller must free data->portname */
303 EndDialog(hwnd, TRUE);
304 return TRUE;
307 if (res && (status == ERROR_INVALID_NAME)) {
308 dlg_invalid_portname(hwnd, data->portname);
309 HeapFree(GetProcessHeap(), 0, data->portname);
310 data->portname = NULL;
311 return TRUE;
314 dlg_win32error(hwnd, status);
315 HeapFree(GetProcessHeap(), 0, data->portname);
316 data->portname = NULL;
317 return TRUE;
320 if (wparam == MAKEWPARAM(IDCANCEL, BN_CLICKED))
322 EndDialog(hwnd, FALSE);
323 return TRUE;
325 return FALSE;
327 return FALSE;
330 /*****************************************************************************
331 * dlgproc_lptconfig [internal]
333 * Our message-proc is simple, as the range-check is done only during the
334 * command "OK" and the dialog is set to the start-value at "out of range".
336 * Native localui.dll does the check during keyboard-input and set the dialog
337 * to the previous value.
341 static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
343 lptconfig_t * data;
344 WCHAR bufferW[16];
345 DWORD status;
346 DWORD dummy;
347 DWORD len;
348 DWORD res;
351 switch(msg)
353 case WM_INITDIALOG:
354 SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
355 data = (lptconfig_t *) lparam;
357 /* Get current setting */
358 data->value = 45;
359 status = ERROR_SUCCESS;
360 res = XcvDataW( data->hXcv, cmd_GetTransmissionRetryTimeoutW,
361 (PBYTE) &dummy, 0,
362 (PBYTE) &data->value, sizeof(data->value), &len, &status);
364 TRACE("got %u with status %u\n", res, status);
366 /* Set current setting as the initial value in the Dialog */
367 SetDlgItemInt(hwnd, LPTCONFIG_EDIT, data->value, FALSE);
368 return TRUE;
370 case WM_COMMAND:
371 if (wparam == MAKEWPARAM(IDOK, BN_CLICKED))
373 data = (lptconfig_t *) GetWindowLongPtrW(hwnd, DWLP_USER);
375 status = FALSE;
376 res = GetDlgItemInt(hwnd, LPTCONFIG_EDIT, (BOOL *) &status, FALSE);
377 /* length is in WCHAR, including the '\0' */
378 GetDlgItemTextW(hwnd, LPTCONFIG_EDIT, bufferW, sizeof(bufferW) / sizeof(bufferW[0]));
379 TRACE("got %s and %u (translated: %u)\n", debugstr_w(bufferW), res, status);
381 /* native localui.dll use the same limits */
382 if ((res > 0) && (res < 1000000) && status) {
383 sprintfW(bufferW, fmt_uW, res);
384 res = XcvDataW( data->hXcv, cmd_ConfigureLPTPortCommandOKW,
385 (PBYTE) bufferW,
386 (lstrlenW(bufferW) +1) * sizeof(WCHAR),
387 (PBYTE) &dummy, 0, &len, &status);
389 TRACE("got %u with status %u\n", res, status);
390 EndDialog(hwnd, TRUE);
391 return TRUE;
394 /* Set initial value and rerun the Dialog */
395 SetDlgItemInt(hwnd, LPTCONFIG_EDIT, data->value, FALSE);
396 return TRUE;
399 if (wparam == MAKEWPARAM(IDCANCEL, BN_CLICKED))
401 EndDialog(hwnd, FALSE);
402 return TRUE;
404 return FALSE;
406 return FALSE;
410 /*****************************************************
411 * get_type_from_name (internal)
415 static DWORD get_type_from_name(LPCWSTR name)
417 HANDLE hfile;
419 if (!strncmpiW(name, portname_LPT, sizeof(portname_LPT) / sizeof(WCHAR) -1))
420 return PORT_IS_LPT;
422 if (!strncmpiW(name, portname_COM, sizeof(portname_COM) / sizeof(WCHAR) -1))
423 return PORT_IS_COM;
425 if (!strcmpiW(name, portname_FILE))
426 return PORT_IS_FILE;
428 if (name[0] == '/')
429 return PORT_IS_UNIXNAME;
431 if (name[0] == '|')
432 return PORT_IS_PIPE;
434 if (!strncmpW(name, portname_CUPS, sizeof(portname_CUPS) / sizeof(WCHAR) -1))
435 return PORT_IS_CUPS;
437 if (!strncmpW(name, portname_LPR, sizeof(portname_LPR) / sizeof(WCHAR) -1))
438 return PORT_IS_LPR;
440 /* Must be a file or a directory. Does the file exist ? */
441 hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
442 TRACE("%p for OPEN_EXISTING on %s\n", hfile, debugstr_w(name));
443 if (hfile == INVALID_HANDLE_VALUE) {
444 /* Can we create the file? */
445 hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL);
446 TRACE("%p for OPEN_ALWAYS\n", hfile);
448 if (hfile != INVALID_HANDLE_VALUE) {
449 CloseHandle(hfile);
450 return PORT_IS_FILENAME;
452 /* We can't use the name. use GetLastError() for the reason */
453 return PORT_IS_UNKNOWN;
456 /*****************************************************
457 * open_monitor_by_name [internal]
460 static BOOL open_monitor_by_name(LPCWSTR pPrefix, LPCWSTR pPort, HANDLE * phandle)
462 PRINTER_DEFAULTSW pd;
463 LPWSTR fullname;
464 BOOL res;
466 * phandle = 0;
467 TRACE("(%s,%s)\n", debugstr_w(pPrefix),debugstr_w(pPort) );
469 fullname = strdupWW(pPrefix, pPort);
470 pd.pDatatype = NULL;
471 pd.pDevMode = NULL;
472 pd.DesiredAccess = SERVER_ACCESS_ADMINISTER;
474 res = OpenPrinterW(fullname, phandle, &pd);
475 HeapFree(GetProcessHeap(), 0, fullname);
476 return res;
479 /*****************************************************
480 * localui_AddPortUI [exported through MONITORUI]
482 * Display a Dialog to add a local Port
484 * PARAMS
485 * pName [I] Servername or NULL (local Computer)
486 * hWnd [I] Handle to parent Window for the Dialog-Box or NULL
487 * pMonitorName[I] Name of the Monitor, that should be used to add a Port or NULL
488 * ppPortName [O] PTR to PTR of a buffer, that receive the Name of the new Port or NULL
490 * RETURNS
491 * Success: TRUE
492 * Failure: FALSE
494 * NOTES
495 * The caller must free the buffer (returned in ppPortName) with GlobalFree().
496 * Native localui.dll failed with ERROR_INVALID_PARAMETER, when the user tried
497 * to add a Port, that start with "COM" or "LPT".
500 static BOOL WINAPI localui_AddPortUI(PCWSTR pName, HWND hWnd, PCWSTR pMonitorName, PWSTR *ppPortName)
502 addportui_t data;
503 HANDLE hXcv;
504 DWORD needed;
505 DWORD dummy;
506 DWORD status;
507 DWORD res = FALSE;
509 TRACE( "(%s, %p, %s, %p) (*ppPortName: %p)\n", debugstr_w(pName), hWnd,
510 debugstr_w(pMonitorName), ppPortName, ppPortName ? *ppPortName : NULL);
512 if (open_monitor_by_name(XcvMonitorW, pMonitorName, &hXcv)) {
514 ZeroMemory(&data, sizeof(addportui_t));
515 data.hXcv = hXcv;
516 res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(ADDPORT_DIALOG), hWnd,
517 dlgproc_addport, (LPARAM) &data);
519 TRACE("got %u with %u for %s\n", res, GetLastError(), debugstr_w(data.portname));
521 if (ppPortName) *ppPortName = NULL;
523 if (res) {
524 res = XcvDataW(hXcv, cmd_AddPortW, (PBYTE) data.portname,
525 (lstrlenW(data.portname)+1) * sizeof(WCHAR),
526 (PBYTE) &dummy, 0, &needed, &status);
528 TRACE("got %u with status %u\n", res, status);
529 if (res && (status == ERROR_SUCCESS) && ppPortName) {
530 /* Native localui uses GlobalAlloc also.
531 The caller must GlobalFree the buffer */
532 *ppPortName = GlobalAlloc(GPTR, (lstrlenW(data.portname)+1) * sizeof(WCHAR));
533 if (*ppPortName) lstrcpyW(*ppPortName, data.portname);
536 if (res && (status == ERROR_ALREADY_EXISTS)) {
537 dlg_port_already_exists(hWnd, data.portname);
538 /* Native localui also return "TRUE" from AddPortUI in this case */
541 HeapFree(GetProcessHeap(), 0, data.portname);
543 else
545 SetLastError(ERROR_CANCELLED);
547 ClosePrinter(hXcv);
550 TRACE("=> %u with %u\n", res, GetLastError());
551 return res;
555 /*****************************************************
556 * localui_ConfigurePortUI [exported through MONITORUI]
558 * Display the Configuration-Dialog for a specific Port
560 * PARAMS
561 * pName [I] Servername or NULL (local Computer)
562 * hWnd [I] Handle to parent Window for the Dialog-Box or NULL
563 * pPortName [I] Name of the Port, that should be configured
565 * RETURNS
566 * Success: TRUE
567 * Failure: FALSE
570 static BOOL WINAPI localui_ConfigurePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName)
572 HANDLE hXcv;
573 DWORD res;
575 TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
576 if (open_monitor_by_name(XcvPortW, pPortName, &hXcv)) {
578 res = get_type_from_name(pPortName);
579 switch(res)
582 case PORT_IS_COM:
583 res = dlg_configure_com(hXcv, hWnd, pPortName);
584 break;
586 case PORT_IS_LPT:
587 res = dlg_configure_lpt(hXcv, hWnd);
588 break;
590 default:
591 dlg_nothingtoconfig(hWnd);
592 SetLastError(ERROR_CANCELLED);
593 res = FALSE;
596 ClosePrinter(hXcv);
597 return res;
599 return FALSE;
603 /*****************************************************
604 * localui_DeletePortUI [exported through MONITORUI]
606 * Delete a specific Port
608 * PARAMS
609 * pName [I] Servername or NULL (local Computer)
610 * hWnd [I] Handle to parent Window
611 * pPortName [I] Name of the Port, that should be deleted
613 * RETURNS
614 * Success: TRUE
615 * Failure: FALSE
617 * NOTES
618 * Native localui does not allow deleting a COM/LPT port (ERROR_NOT_SUPPORTED)
621 static BOOL WINAPI localui_DeletePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName)
623 HANDLE hXcv;
624 DWORD dummy;
625 DWORD needed;
626 DWORD status;
628 TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
630 if ((!pPortName) || (!pPortName[0])) {
631 SetLastError(ERROR_INVALID_PARAMETER);
632 return FALSE;
635 if (open_monitor_by_name(XcvPortW, pPortName, &hXcv)) {
636 /* native localui tests here for LPT / COM - Ports and failed with
637 ERROR_NOT_SUPPORTED. */
638 if (XcvDataW(hXcv, cmd_DeletePortW, (LPBYTE) pPortName,
639 (lstrlenW(pPortName)+1) * sizeof(WCHAR), (LPBYTE) &dummy, 0, &needed, &status)) {
641 ClosePrinter(hXcv);
642 if (status != ERROR_SUCCESS) SetLastError(status);
643 return (status == ERROR_SUCCESS);
645 ClosePrinter(hXcv);
646 return FALSE;
648 SetLastError(ERROR_UNKNOWN_PORT);
649 return FALSE;
652 /*****************************************************
653 * InitializePrintMonitorUI (LOCALUI.@)
655 * Initialize the User-Interface for the Local Ports
657 * RETURNS
658 * Success: Pointer to a MONITORUI Structure
659 * Failure: NULL
663 PMONITORUI WINAPI InitializePrintMonitorUI(void)
665 static MONITORUI mymonitorui =
667 sizeof(MONITORUI),
668 localui_AddPortUI,
669 localui_ConfigurePortUI,
670 localui_DeletePortUI
673 TRACE("=> %p\n", &mymonitorui);
674 return &mymonitorui;
677 /*****************************************************
678 * DllMain
680 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
682 TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
684 switch(fdwReason)
686 case DLL_PROCESS_ATTACH:
687 DisableThreadLibraryCalls( hinstDLL );
688 LOCALUI_hInstance = hinstDLL;
689 break;
691 return TRUE;