#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winuser.h>
#include <winreg.h>
#include <windns.h>
#include <lm.h>
#include <prsht.h>
#include "resource.h"
Go to the source code of this file.
|
static INT | FormatMessageBox (HWND hDlg, UINT uType, DWORD dwMessage,...) |
|
static BOOL | GetComputerNames (PNETIDDATA pNetIdData) |
|
static BOOL | IsUserAdmin (VOID) |
|
static BOOL | IsValidDomainName (HWND hDlg, UINT uId) |
|
static INT_PTR CALLBACK | DNSSuffixPropDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) |
|
static VOID | SetRadioBtnState (HWND hDlg, BOOL IsDomain) |
|
static BOOL | IsValidComputerName (HWND hDlg, UINT uId) |
|
static VOID | SetFullComputerName (HWND hDlg, UINT uId, PNETIDDATA pNetIdData) |
|
static VOID | UpdateFullComputerName (HWND hDlg, UINT uId, PNETIDDATA pNetIdData) |
|
static VOID | UpdateNetbiosName (HWND hDlg, UINT uId, PNETIDDATA pNetIdData) |
|
static VOID | CheckForChangedNames (_In_ HWND hwndDlg, _In_ PNETIDDATA pNetIdData) |
|
static VOID | NetworkDlg_OnInitDialog (HWND hDlg, PNETIDDATA pNetIdData) |
|
static BOOL | NetworkDlg_OnOK (HWND hDlg, PNETIDDATA pNetIdData) |
|
static INT_PTR CALLBACK | NetworkPropDlgProc (HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) |
|
static VOID | NetIDPage_OnInitDialog (HWND hwndDlg, PNETIDDATA pNetIdData) |
|
static LONG | NetIDPage_OnApply (HWND hwndDlg) |
|
static INT_PTR CALLBACK | NetIDPageProc (IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam) |
|
HPROPSHEETPAGE WINAPI | CreateNetIDPropertyPage (VOID) |
|
BOOL WINAPI | DllMain (IN HINSTANCE hinstDLL, IN DWORD dwReason, IN LPVOID lpvReserved) |
|
◆ MAX_COMPUTERDESCRIPTION_LENGTH
#define MAX_COMPUTERDESCRIPTION_LENGTH 255 |
◆ MAX_DOMAINNAME_LENGTH
#define MAX_DOMAINNAME_LENGTH 255 |
◆ MAX_HOSTNAME_LENGTH
#define MAX_HOSTNAME_LENGTH 63 |
◆ WIN32_NO_STATUS
◆ NETIDDATA
◆ PNETIDDATA
◆ CheckForChangedNames()
Definition at line 410 of file netid.c.
413{
415
416 if ((
_wcsicmp(pNetIdData->szOldHostName, pNetIdData->szHostName) != 0) ||
417 (
_wcsicmp(pNetIdData->szOldDomainName, pNetIdData->szDomainName) != 0))
418 {
420 }
421
424}
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
Referenced by NetIDPageProc().
◆ CreateNetIDPropertyPage()
Definition at line 778 of file netid.c.
779{
781
782 psp.dwSize = sizeof(psp);
787
789}
#define IDD_PROPPAGECOMPUTER
static INT_PTR CALLBACK NetIDPageProc(IN HWND hwndDlg, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
static HINSTANCE hDllInstance
#define CreatePropertySheetPage
◆ DllMain()
@DllMain
Core routine of the Utility Manager's library.
- Parameters
-
[in] | hDllInstance | The entry point instance of the library. |
[in] | fdwReason | The reason argument to indicate the motive DllMain is being called. |
[in] | lpvReserved | Reserved. |
- Returns
- Returns TRUE when main call initialization has succeeded, FALSE otherwise.
Definition at line 792 of file netid.c.
795{
797 {
801 break;
802 }
803
805}
#define DLL_PROCESS_ATTACH
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
◆ DNSSuffixPropDlgProc()
Definition at line 228 of file netid.c.
229{
231
233
235 {
238 if (pNetIdData !=
NULL)
239 {
241
246 }
248
251 {
252 case 115:
254 {
257 }
258 break;
259
260 case 1011:
262 {
265 }
266 break;
267
270 {
272 break;
273 }
274
277
279 {
282 else
284 }
285
287 break;
288
293 break;
294 }
295 break;
296 }
297
299}
struct _NETIDDATA * PNETIDDATA
static BOOL IsValidDomainName(HWND hDlg, UINT uId)
BOOL bSyncDomainWithMembershipChanged
WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH+1]
BOOL bSyncDomainWithMembership
WCHAR szDomainName[MAX_DOMAINNAME_LENGTH+1]
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SendDlgItemMessage
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
Referenced by NetworkPropDlgProc().
◆ FormatMessageBox()
Definition at line 49 of file netid.c.
54{
57
59
61
64 szMessage,
65 0,
66 0,
67 szText,
71
73}
TCHAR szTitle[MAX_LOADSTRING]
#define FORMAT_MESSAGE_FROM_STRING
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
Referenced by IsValidComputerName(), and IsValidDomainName().
◆ GetComputerNames()
Definition at line 77 of file netid.c.
79{
83
85 L"SYSTEM\\CurrentControlSet\\Services\\TcpIp\\Parameters",
86 0,
90 {
94 0,
98
102 0,
106
110 0,
114
118 0,
122
125 L"SyncDomainWithMembership",
126 0,
131
133 }
134
136 L"SYSTEM\\CurrentControlSet\\Control\\ComputerName\\ComputerName",
137 0,
141 {
145 0,
149
151 }
152
154 {
157 }
158
160}
#define RegCloseKey(hKey)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
NETSETUP_JOIN_STATUS JoinStatus
WCHAR szOldHostName[MAX_HOSTNAME_LENGTH+1]
WCHAR szOldDomainName[MAX_DOMAINNAME_LENGTH+1]
WCHAR szHostName[MAX_HOSTNAME_LENGTH+1]
#define HKEY_LOCAL_MACHINE
NET_API_STATUS WINAPI NetGetJoinInformation(_In_ LPCWSTR lpServer, _Out_ LPWSTR *lpNameBuffer, _Out_ PNETSETUP_JOIN_STATUS BufferType)
Referenced by NetIDPageProc().
◆ IsUserAdmin()
Definition at line 163 of file netid.c.
164{
168
172 0, 0, 0, 0, 0, 0,
173 &pAdminsSid))
174 {
176 }
177
181
182 return bIsAdmin;
183}
BOOL WINAPI CheckTokenMembership(IN HANDLE ExistingTokenHandle, IN PSID SidToCheck, OUT PBOOL IsMember)
BOOL WINAPI AllocateAndInitializeSid(PSID_IDENTIFIER_AUTHORITY pIdentifierAuthority, BYTE nSubAuthorityCount, DWORD nSubAuthority0, DWORD nSubAuthority1, DWORD nSubAuthority2, DWORD nSubAuthority3, DWORD nSubAuthority4, DWORD nSubAuthority5, DWORD nSubAuthority6, DWORD nSubAuthority7, PSID *pSid)
PVOID WINAPI FreeSid(PSID pSid)
#define SECURITY_BUILTIN_DOMAIN_RID
#define SECURITY_NT_AUTHORITY
#define DOMAIN_ALIAS_RID_ADMINS
Referenced by Applet(), DevInstallW(), CNetConnection::GetProperties(), NetIDPage_OnInitDialog(), OnInitUserProfileDialog(), and test_mode_generic().
◆ IsValidComputerName()
Definition at line 323 of file netid.c.
326{
327 WCHAR szHostName[256];
329
331
334 {
335 switch (dwError)
336 {
340 break;
341
345
348 break;
349
352 break;
353 }
354
356 }
357
359}
#define ERROR_INVALID_NAME
DNS_STATUS WINAPI DnsValidateName_W(PCWSTR name, DNS_NAME_FORMAT format)
static INT FormatMessageBox(HWND hDlg, UINT uType, DWORD dwMessage,...)
#define DNS_ERROR_NUMERIC_NAME
#define DNS_ERROR_NON_RFC_NAME
#define DNS_ERROR_INVALID_NAME_CHAR
Referenced by NetworkDlg_OnOK().
◆ IsValidDomainName()
Definition at line 187 of file netid.c.
190{
191 WCHAR szDomainName[256];
193
196
199 {
200 switch (dwError)
201 {
205 break;
206
209 break;
210
213 break;
214
217 break;
218 }
219
221 }
222
224}
Referenced by DNSSuffixPropDlgProc().
◆ NetIDPage_OnApply()
static LONG NetIDPage_OnApply |
( |
HWND |
hwndDlg | ) |
|
|
static |
Definition at line 651 of file netid.c.
653{
659
661 L"SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters",
662 0,
666 return lError;
667
670 NewComputerDescription,
673 {
675 goto done;
676 }
677
678 dwSize =
sizeof(ComputerDescription);
681 0,
683 (
PBYTE)ComputerDescription,
686 goto done;
687
689 if (
wcscmp(ComputerDescription, NewComputerDescription) != 0)
690 {
693 0,
695 (
PBYTE)NewComputerDescription,
696 (
wcslen(NewComputerDescription) + 1) *
sizeof(
WCHAR));
697 }
698
699done:
702
703 return lError;
704}
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define ERROR_FILE_NOT_FOUND
#define MAX_COMPUTERDESCRIPTION_LENGTH
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
DWORD WINAPI GetLastError(void)
Referenced by NetIDPageProc().
◆ NetIDPage_OnInitDialog()
Definition at line 598 of file netid.c.
601{
603 DWORD RegSize =
sizeof(ComputerDescription);
607
608
610
612 L"SYSTEM\\CurrentControlSet\\Services\\LanmanServer\\Parameters",
613 0,
617 {
620 0,
622 (
LPBYTE)ComputerDescription,
623 &RegSize);
625 {
628 }
629
631 }
632
633
637
638
640 {
643
646 }
647}
#define IDC_NETWORK_PROPERTY
#define IDC_WORKGROUPDOMAIN
#define IDC_WORKGROUPDOMAIN_NAME
static BOOL IsUserAdmin(VOID)
Referenced by NetIDPageProc().
◆ NetIDPageProc()
Definition at line 707 of file netid.c.
711{
713
715
716 switch (uMsg)
717 {
720 if (pNetIdData !=
NULL)
721 {
728 }
730
733 {
736 break;
737 }
738 break;
739
742 {
746 break;
747
751 hwndDlg,
754 {
757 }
758 break;
759 }
760 break;
761
763 if (pNetIdData !=
NULL)
764 {
770 }
771 break;
772 }
773
775}
#define HeapFree(x, y, z)
NET_API_STATUS WINAPI NetApiBufferFree(LPVOID Buffer)
#define IDD_PROPPAGECOMPNAMECHENGE
static INT_PTR CALLBACK NetworkPropDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
static VOID UpdateFullComputerName(HWND hDlg, UINT uId, PNETIDDATA pNetIdData)
static LONG NetIDPage_OnApply(HWND hwndDlg)
static VOID SetFullComputerName(HWND hDlg, UINT uId, PNETIDDATA pNetIdData)
static BOOL GetComputerNames(PNETIDDATA pNetIdData)
static VOID NetIDPage_OnInitDialog(HWND hwndDlg, PNETIDDATA pNetIdData)
static VOID CheckForChangedNames(_In_ HWND hwndDlg, _In_ PNETIDDATA pNetIdData)
#define PropSheet_Changed(d, w)
HWND WINAPI GetParent(_In_ HWND)
Referenced by CreateNetIDPropertyPage().
◆ NetworkDlg_OnInitDialog()
Definition at line 428 of file netid.c.
431{
433
436
440
441
443 {
447 break;
448
452 break;
453
454 default:
455 break;
456 }
457}
static VOID SetRadioBtnState(HWND hDlg, BOOL IsDomain)
#define MAX_HOSTNAME_LENGTH
Referenced by NetworkPropDlgProc().
◆ NetworkDlg_OnOK()
Definition at line 461 of file netid.c.
464{
468
470 {
472 {
475 }
476
478
480 {
484 }
485
487 }
488
490 {
492 {
493
495 }
496
498 }
499
501 {
503 L"SYSTEM\\CurrentControlSet\\Services\\TcpIp\\Parameters",
504 0,
508 {
510 L"SyncDomainWithMembership",
511 0,
516 }
517
519 }
520
524
526}
BOOL WINAPI SetComputerNameExW(COMPUTER_NAME_FORMAT NameType, LPCWSTR lpBuffer)
static BOOL IsValidComputerName(HWND hDlg, UINT uId)
#define MB_ICONINFORMATION
Referenced by NetworkPropDlgProc().
◆ NetworkPropDlgProc()
Definition at line 530 of file netid.c.
531{
533
535
537 {
540 if (pNetIdData !=
NULL)
541 {
545 }
547
550 {
551 case 1002:
553 {
558 }
559 break;
560
561 case 1008:
562 case 1004:
565 else
567 break;
568
569 case 1003:
572 hDlg,
575 {
578 }
579 break;
580
584 break;
585
588 break;
589 }
590 break;
591 }
592
594}
#define IDD_PROPPAGEDNSANDNETBIOS
static VOID UpdateNetbiosName(HWND hDlg, UINT uId, PNETIDDATA pNetIdData)
static BOOL NetworkDlg_OnOK(HWND hDlg, PNETIDDATA pNetIdData)
static VOID NetworkDlg_OnInitDialog(HWND hDlg, PNETIDDATA pNetIdData)
static INT_PTR CALLBACK DNSSuffixPropDlgProc(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam)
Referenced by NetIDPageProc().
◆ SetFullComputerName()
◆ SetRadioBtnState()
◆ UpdateFullComputerName()
◆ UpdateNetbiosName()
Definition at line 392 of file netid.c.
396{
397 WCHAR szHostName[256];
399
401
406}
BOOL WINAPI DnsHostnameToComputerNameW(LPCWSTR hostname, LPWSTR computername, LPDWORD size)
Referenced by NetworkPropDlgProc().
◆ hDllInstance