wined3d: Drop support for WINED3DFMT_D32_UNORM.
[wine.git] / dlls / localui / localui.c
blobab8f5c95d52b50a73bf14ee79dd002239c45c316
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 "localui.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(localui);
37 /*****************************************************/
39 static HINSTANCE LOCALUI_hInstance;
41 static const WCHAR cmd_AddPortW[] = {'A','d','d','P','o','r','t',0};
42 static const WCHAR cmd_ConfigureLPTPortCommandOKW[] = {'C','o','n','f','i','g','u','r','e',
43 'L','P','T','P','o','r','t',
44 'C','o','m','m','a','n','d','O','K',0};
45 static const WCHAR cmd_DeletePortW[] = {'D','e','l','e','t','e','P','o','r','t',0};
46 static const WCHAR cmd_GetDefaultCommConfigW[] = {'G','e','t',
47 'D','e','f','a','u','l','t',
48 'C','o','m','m','C','o','n','f','i','g',0};
49 static const WCHAR cmd_GetTransmissionRetryTimeoutW[] = {'G','e','t',
50 'T','r','a','n','s','m','i','s','s','i','o','n',
51 'R','e','t','r','y','T','i','m','e','o','u','t',0};
52 static const WCHAR cmd_PortIsValidW[] = {'P','o','r','t','I','s','V','a','l','i','d',0};
53 static const WCHAR cmd_SetDefaultCommConfigW[] = {'S','e','t',
54 'D','e','f','a','u','l','t',
55 'C','o','m','m','C','o','n','f','i','g',0};
57 static const WCHAR fmt_uW[] = {'%','u',0};
58 static const WCHAR portname_LPT[] = {'L','P','T',0};
59 static const WCHAR portname_COM[] = {'C','O','M',0};
60 static const WCHAR portname_FILE[] = {'F','I','L','E',':',0};
61 static const WCHAR portname_CUPS[] = {'C','U','P','S',':',0};
62 static const WCHAR portname_LPR[] = {'L','P','R',':',0};
64 static const WCHAR XcvMonitorW[] = {',','X','c','v','M','o','n','i','t','o','r',' ',0};
65 static const WCHAR XcvPortW[] = {',','X','c','v','P','o','r','t',' ',0};
67 /*****************************************************/
69 typedef struct tag_addportui_t {
70 LPWSTR portname;
71 HANDLE hXcv;
72 } addportui_t;
74 typedef struct tag_lptconfig_t {
75 HANDLE hXcv;
76 DWORD value;
77 } lptconfig_t;
80 static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam);
82 /*****************************************************
83 * strdupWW [internal]
86 static LPWSTR strdupWW(LPCWSTR pPrefix, LPCWSTR pSuffix)
88 LPWSTR ptr;
89 DWORD len;
91 len = lstrlenW(pPrefix) + (pSuffix ? lstrlenW(pSuffix) : 0) + 1;
92 ptr = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
93 if (ptr) {
94 lstrcpyW(ptr, pPrefix);
95 if (pSuffix) lstrcatW(ptr, pSuffix);
97 return ptr;
100 /*****************************************************
101 * dlg_configure_com [internal]
105 static BOOL dlg_configure_com(HANDLE hXcv, HWND hWnd, PCWSTR pPortName)
107 COMMCONFIG cfg;
108 LPWSTR shortname;
109 DWORD status;
110 DWORD dummy;
111 DWORD len;
112 BOOL res;
114 /* strip the colon (pPortName is never empty here) */
115 len = lstrlenW(pPortName);
116 shortname = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
117 if (shortname) {
118 memcpy(shortname, pPortName, (len -1) * sizeof(WCHAR));
119 shortname[len-1] = '\0';
121 /* get current settings */
122 len = FIELD_OFFSET(COMMCONFIG, wcProviderData[1]);
123 status = ERROR_SUCCESS;
124 res = XcvDataW( hXcv, cmd_GetDefaultCommConfigW,
125 (PBYTE) shortname,
126 (lstrlenW(shortname) +1) * sizeof(WCHAR),
127 (PBYTE) &cfg, len, &len, &status);
129 if (res && (status == ERROR_SUCCESS)) {
130 /* display the Dialog */
131 res = CommConfigDialogW(pPortName, hWnd, &cfg);
132 if (res) {
133 status = ERROR_SUCCESS;
134 /* set new settings */
135 res = XcvDataW(hXcv, cmd_SetDefaultCommConfigW,
136 (PBYTE) &cfg, len,
137 (PBYTE) &dummy, 0, &len, &status);
140 HeapFree(GetProcessHeap(), 0, shortname);
141 return res;
143 return FALSE;
147 /*****************************************************
148 * dlg_configure_lpt [internal]
152 static BOOL dlg_configure_lpt(HANDLE hXcv, HWND hWnd)
154 lptconfig_t data;
155 BOOL res;
158 data.hXcv = hXcv;
160 res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(LPTCONFIG_DIALOG), hWnd,
161 dlgproc_lptconfig, (LPARAM) &data);
163 TRACE("got %u with %u\n", res, GetLastError());
165 if (!res) SetLastError(ERROR_CANCELLED);
166 return res;
169 /******************************************************************
170 * dlg_port_already_exists [internal]
173 static void dlg_port_already_exists(HWND hWnd, LPCWSTR portname)
175 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
176 WCHAR res_PortExistsW[IDS_PORTEXISTS_MAXLEN];
177 LPWSTR message;
178 DWORD len;
180 res_PortW[0] = '\0';
181 res_PortExistsW[0] = '\0';
182 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
183 LoadStringW(LOCALUI_hInstance, IDS_PORTEXISTS, res_PortExistsW, IDS_PORTEXISTS_MAXLEN);
185 len = lstrlenW(portname) + IDS_PORTEXISTS_MAXLEN + 1;
186 message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
187 if (message) {
188 message[0] = '\0';
189 swprintf(message, len, res_PortExistsW, portname);
190 MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
191 HeapFree(GetProcessHeap(), 0, message);
195 /******************************************************************
196 * dlg_invalid_portname [internal]
199 static void dlg_invalid_portname(HWND hWnd, LPCWSTR portname)
201 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
202 WCHAR res_InvalidNameW[IDS_INVALIDNAME_MAXLEN];
203 LPWSTR message;
204 DWORD len;
206 res_PortW[0] = '\0';
207 res_InvalidNameW[0] = '\0';
208 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
209 LoadStringW(LOCALUI_hInstance, IDS_INVALIDNAME, res_InvalidNameW, IDS_INVALIDNAME_MAXLEN);
211 len = lstrlenW(portname) + IDS_INVALIDNAME_MAXLEN;
212 message = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR));
213 if (message) {
214 message[0] = '\0';
215 swprintf(message, len, res_InvalidNameW, portname);
216 MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
217 HeapFree(GetProcessHeap(), 0, message);
221 /******************************************************************
222 * display the Dialog "Nothing to configure"
226 static void dlg_nothingtoconfig(HWND hWnd)
228 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
229 WCHAR res_nothingW[IDS_NOTHINGTOCONFIG_MAXLEN];
231 res_PortW[0] = '\0';
232 res_nothingW[0] = '\0';
233 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
234 LoadStringW(LOCALUI_hInstance, IDS_NOTHINGTOCONFIG, res_nothingW, IDS_NOTHINGTOCONFIG_MAXLEN);
236 MessageBoxW(hWnd, res_nothingW, res_PortW, MB_OK | MB_ICONINFORMATION);
239 /******************************************************************
240 * dlg_win32error [internal]
243 static void dlg_win32error(HWND hWnd, DWORD lasterror)
245 WCHAR res_PortW[IDS_LOCALPORT_MAXLEN];
246 LPWSTR message = NULL;
247 DWORD res;
249 res_PortW[0] = '\0';
250 LoadStringW(LOCALUI_hInstance, IDS_LOCALPORT, res_PortW, IDS_LOCALPORT_MAXLEN);
253 res = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
254 NULL, lasterror, 0, (LPWSTR) &message, 0, NULL);
256 if (res > 0) {
257 MessageBoxW(hWnd, message, res_PortW, MB_OK | MB_ICONERROR);
258 LocalFree(message);
262 /*****************************************************************************
266 static INT_PTR CALLBACK dlgproc_addport(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
268 addportui_t * data;
269 DWORD status;
270 DWORD dummy;
271 DWORD len;
272 DWORD res;
274 switch(msg)
276 case WM_INITDIALOG:
277 SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
278 return TRUE;
280 case WM_COMMAND:
281 if (wparam == MAKEWPARAM(IDOK, BN_CLICKED))
283 data = (addportui_t *) GetWindowLongPtrW(hwnd, DWLP_USER);
284 /* length in WCHAR, without the '\0' */
285 len = SendDlgItemMessageW(hwnd, ADDPORT_EDIT, WM_GETTEXTLENGTH, 0, 0);
286 data->portname = HeapAlloc(GetProcessHeap(), 0, (len + 1) * sizeof(WCHAR));
288 if (!data->portname) {
289 EndDialog(hwnd, FALSE);
290 return TRUE;
292 /* length is in WCHAR, including the '\0' */
293 GetDlgItemTextW(hwnd, ADDPORT_EDIT, data->portname, len + 1);
294 status = ERROR_SUCCESS;
295 res = XcvDataW( data->hXcv, cmd_PortIsValidW, (PBYTE) data->portname,
296 (lstrlenW(data->portname) + 1) * sizeof(WCHAR),
297 (PBYTE) &dummy, 0, &len, &status);
299 TRACE("got %u with status %u\n", res, status);
300 if (res && (status == ERROR_SUCCESS)) {
301 /* The caller must free data->portname */
302 EndDialog(hwnd, TRUE);
303 return TRUE;
306 if (res && (status == ERROR_INVALID_NAME)) {
307 dlg_invalid_portname(hwnd, data->portname);
308 HeapFree(GetProcessHeap(), 0, data->portname);
309 data->portname = NULL;
310 return TRUE;
313 dlg_win32error(hwnd, status);
314 HeapFree(GetProcessHeap(), 0, data->portname);
315 data->portname = NULL;
316 return TRUE;
319 if (wparam == MAKEWPARAM(IDCANCEL, BN_CLICKED))
321 EndDialog(hwnd, FALSE);
322 return TRUE;
324 return FALSE;
326 return FALSE;
329 /*****************************************************************************
330 * dlgproc_lptconfig [internal]
332 * Our message-proc is simple, as the range-check is done only during the
333 * command "OK" and the dialog is set to the start-value at "out of range".
335 * Native localui.dll does the check during keyboard-input and set the dialog
336 * to the previous value.
340 static INT_PTR CALLBACK dlgproc_lptconfig(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
342 lptconfig_t * data;
343 WCHAR bufferW[16];
344 DWORD status;
345 DWORD dummy;
346 DWORD len;
347 DWORD res;
350 switch(msg)
352 case WM_INITDIALOG:
353 SetWindowLongPtrW(hwnd, DWLP_USER, lparam);
354 data = (lptconfig_t *) lparam;
356 /* Get current setting */
357 data->value = 45;
358 status = ERROR_SUCCESS;
359 res = XcvDataW( data->hXcv, cmd_GetTransmissionRetryTimeoutW,
360 (PBYTE) &dummy, 0,
361 (PBYTE) &data->value, sizeof(data->value), &len, &status);
363 TRACE("got %u with status %u\n", res, status);
365 /* Set current setting as the initial value in the Dialog */
366 SetDlgItemInt(hwnd, LPTCONFIG_EDIT, data->value, FALSE);
367 return TRUE;
369 case WM_COMMAND:
370 if (wparam == MAKEWPARAM(IDOK, BN_CLICKED))
372 data = (lptconfig_t *) GetWindowLongPtrW(hwnd, DWLP_USER);
374 status = FALSE;
375 res = GetDlgItemInt(hwnd, LPTCONFIG_EDIT, (BOOL *) &status, FALSE);
376 /* length is in WCHAR, including the '\0' */
377 GetDlgItemTextW(hwnd, LPTCONFIG_EDIT, bufferW, ARRAY_SIZE(bufferW));
378 TRACE("got %s and %u (translated: %u)\n", debugstr_w(bufferW), res, status);
380 /* native localui.dll use the same limits */
381 if ((res > 0) && (res < 1000000) && status) {
382 swprintf(bufferW, ARRAY_SIZE(bufferW), fmt_uW, res);
383 res = XcvDataW( data->hXcv, cmd_ConfigureLPTPortCommandOKW,
384 (PBYTE) bufferW,
385 (lstrlenW(bufferW) +1) * sizeof(WCHAR),
386 (PBYTE) &dummy, 0, &len, &status);
388 TRACE("got %u with status %u\n", res, status);
389 EndDialog(hwnd, TRUE);
390 return TRUE;
393 /* Set initial value and rerun the Dialog */
394 SetDlgItemInt(hwnd, LPTCONFIG_EDIT, data->value, FALSE);
395 return TRUE;
398 if (wparam == MAKEWPARAM(IDCANCEL, BN_CLICKED))
400 EndDialog(hwnd, FALSE);
401 return TRUE;
403 return FALSE;
405 return FALSE;
409 /*****************************************************
410 * get_type_from_name (internal)
414 static DWORD get_type_from_name(LPCWSTR name)
416 HANDLE hfile;
418 if (!wcsnicmp(name, portname_LPT, ARRAY_SIZE(portname_LPT) -1))
419 return PORT_IS_LPT;
421 if (!wcsnicmp(name, portname_COM, ARRAY_SIZE(portname_COM) -1))
422 return PORT_IS_COM;
424 if (!wcsicmp(name, portname_FILE))
425 return PORT_IS_FILE;
427 if (name[0] == '/')
428 return PORT_IS_UNIXNAME;
430 if (name[0] == '|')
431 return PORT_IS_PIPE;
433 if (!wcsncmp(name, portname_CUPS, ARRAY_SIZE(portname_CUPS) -1))
434 return PORT_IS_CUPS;
436 if (!wcsncmp(name, portname_LPR, ARRAY_SIZE(portname_LPR) -1))
437 return PORT_IS_LPR;
439 /* Must be a file or a directory. Does the file exist ? */
440 hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
441 TRACE("%p for OPEN_EXISTING on %s\n", hfile, debugstr_w(name));
442 if (hfile == INVALID_HANDLE_VALUE) {
443 /* Can we create the file? */
444 hfile = CreateFileW(name, GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_FLAG_DELETE_ON_CLOSE, NULL);
445 TRACE("%p for OPEN_ALWAYS\n", hfile);
447 if (hfile != INVALID_HANDLE_VALUE) {
448 CloseHandle(hfile);
449 return PORT_IS_FILENAME;
451 /* We can't use the name. use GetLastError() for the reason */
452 return PORT_IS_UNKNOWN;
455 /*****************************************************
456 * open_monitor_by_name [internal]
459 static BOOL open_monitor_by_name(LPCWSTR pPrefix, LPCWSTR pPort, HANDLE * phandle)
461 PRINTER_DEFAULTSW pd;
462 LPWSTR fullname;
463 BOOL res;
465 * phandle = 0;
466 TRACE("(%s,%s)\n", debugstr_w(pPrefix),debugstr_w(pPort) );
468 fullname = strdupWW(pPrefix, pPort);
469 pd.pDatatype = NULL;
470 pd.pDevMode = NULL;
471 pd.DesiredAccess = SERVER_ACCESS_ADMINISTER;
473 res = OpenPrinterW(fullname, phandle, &pd);
474 HeapFree(GetProcessHeap(), 0, fullname);
475 return res;
478 /*****************************************************
479 * localui_AddPortUI [exported through MONITORUI]
481 * Display a Dialog to add a local Port
483 * PARAMS
484 * pName [I] Servername or NULL (local Computer)
485 * hWnd [I] Handle to parent Window for the Dialog-Box or NULL
486 * pMonitorName[I] Name of the Monitor, that should be used to add a Port or NULL
487 * ppPortName [O] PTR to PTR of a buffer, that receive the Name of the new Port or NULL
489 * RETURNS
490 * Success: TRUE
491 * Failure: FALSE
493 * NOTES
494 * The caller must free the buffer (returned in ppPortName) with GlobalFree().
495 * Native localui.dll failed with ERROR_INVALID_PARAMETER, when the user tried
496 * to add a Port, that start with "COM" or "LPT".
499 static BOOL WINAPI localui_AddPortUI(PCWSTR pName, HWND hWnd, PCWSTR pMonitorName, PWSTR *ppPortName)
501 addportui_t data;
502 HANDLE hXcv;
503 DWORD needed;
504 DWORD dummy;
505 DWORD status;
506 DWORD res = FALSE;
508 TRACE( "(%s, %p, %s, %p) (*ppPortName: %p)\n", debugstr_w(pName), hWnd,
509 debugstr_w(pMonitorName), ppPortName, ppPortName ? *ppPortName : NULL);
511 if (open_monitor_by_name(XcvMonitorW, pMonitorName, &hXcv)) {
513 ZeroMemory(&data, sizeof(addportui_t));
514 data.hXcv = hXcv;
515 res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(ADDPORT_DIALOG), hWnd,
516 dlgproc_addport, (LPARAM) &data);
518 TRACE("got %u with %u for %s\n", res, GetLastError(), debugstr_w(data.portname));
520 if (ppPortName) *ppPortName = NULL;
522 if (res) {
523 res = XcvDataW(hXcv, cmd_AddPortW, (PBYTE) data.portname,
524 (lstrlenW(data.portname)+1) * sizeof(WCHAR),
525 (PBYTE) &dummy, 0, &needed, &status);
527 TRACE("got %u with status %u\n", res, status);
528 if (res && (status == ERROR_SUCCESS) && ppPortName) {
529 /* Native localui uses GlobalAlloc also.
530 The caller must GlobalFree the buffer */
531 *ppPortName = GlobalAlloc(GPTR, (lstrlenW(data.portname)+1) * sizeof(WCHAR));
532 if (*ppPortName) lstrcpyW(*ppPortName, data.portname);
535 if (res && (status == ERROR_ALREADY_EXISTS)) {
536 dlg_port_already_exists(hWnd, data.portname);
537 /* Native localui also return "TRUE" from AddPortUI in this case */
540 HeapFree(GetProcessHeap(), 0, data.portname);
542 else
544 SetLastError(ERROR_CANCELLED);
546 ClosePrinter(hXcv);
549 TRACE("=> %u with %u\n", res, GetLastError());
550 return res;
554 /*****************************************************
555 * localui_ConfigurePortUI [exported through MONITORUI]
557 * Display the Configuration-Dialog for a specific Port
559 * PARAMS
560 * pName [I] Servername or NULL (local Computer)
561 * hWnd [I] Handle to parent Window for the Dialog-Box or NULL
562 * pPortName [I] Name of the Port, that should be configured
564 * RETURNS
565 * Success: TRUE
566 * Failure: FALSE
569 static BOOL WINAPI localui_ConfigurePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName)
571 HANDLE hXcv;
572 DWORD res;
574 TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
575 if (open_monitor_by_name(XcvPortW, pPortName, &hXcv)) {
577 res = get_type_from_name(pPortName);
578 switch(res)
581 case PORT_IS_COM:
582 res = dlg_configure_com(hXcv, hWnd, pPortName);
583 break;
585 case PORT_IS_LPT:
586 res = dlg_configure_lpt(hXcv, hWnd);
587 break;
589 default:
590 dlg_nothingtoconfig(hWnd);
591 SetLastError(ERROR_CANCELLED);
592 res = FALSE;
595 ClosePrinter(hXcv);
596 return res;
598 return FALSE;
602 /*****************************************************
603 * localui_DeletePortUI [exported through MONITORUI]
605 * Delete a specific Port
607 * PARAMS
608 * pName [I] Servername or NULL (local Computer)
609 * hWnd [I] Handle to parent Window
610 * pPortName [I] Name of the Port, that should be deleted
612 * RETURNS
613 * Success: TRUE
614 * Failure: FALSE
616 * NOTES
617 * Native localui does not allow deleting a COM/LPT port (ERROR_NOT_SUPPORTED)
620 static BOOL WINAPI localui_DeletePortUI(PCWSTR pName, HWND hWnd, PCWSTR pPortName)
622 HANDLE hXcv;
623 DWORD dummy;
624 DWORD needed;
625 DWORD status;
627 TRACE("(%s, %p, %s)\n", debugstr_w(pName), hWnd, debugstr_w(pPortName));
629 if ((!pPortName) || (!pPortName[0])) {
630 SetLastError(ERROR_INVALID_PARAMETER);
631 return FALSE;
634 if (open_monitor_by_name(XcvPortW, pPortName, &hXcv)) {
635 /* native localui tests here for LPT / COM - Ports and failed with
636 ERROR_NOT_SUPPORTED. */
637 if (XcvDataW(hXcv, cmd_DeletePortW, (LPBYTE) pPortName,
638 (lstrlenW(pPortName)+1) * sizeof(WCHAR), (LPBYTE) &dummy, 0, &needed, &status)) {
640 ClosePrinter(hXcv);
641 if (status != ERROR_SUCCESS) SetLastError(status);
642 return (status == ERROR_SUCCESS);
644 ClosePrinter(hXcv);
645 return FALSE;
647 SetLastError(ERROR_UNKNOWN_PORT);
648 return FALSE;
651 /*****************************************************
652 * InitializePrintMonitorUI (LOCALUI.@)
654 * Initialize the User-Interface for the Local Ports
656 * RETURNS
657 * Success: Pointer to a MONITORUI Structure
658 * Failure: NULL
662 PMONITORUI WINAPI InitializePrintMonitorUI(void)
664 static MONITORUI mymonitorui =
666 sizeof(MONITORUI),
667 localui_AddPortUI,
668 localui_ConfigurePortUI,
669 localui_DeletePortUI
672 TRACE("=> %p\n", &mymonitorui);
673 return &mymonitorui;
676 /*****************************************************
677 * DllMain
679 BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
681 TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
683 switch(fdwReason)
685 case DLL_PROCESS_ATTACH:
686 DisableThreadLibraryCalls( hinstDLL );
687 LOCALUI_hInstance = hinstDLL;
688 break;
690 return TRUE;