ReactOS  0.4.12-dev-18-gf469aca
framewnd.c
Go to the documentation of this file.
1 /*
2  * Regedit frame window
3  *
4  * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
5  *
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.
10  *
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.
15  *
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 Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "regedit.h"
22 
23 #include <commdlg.h>
24 #include <cderr.h>
25 #include <objsel.h>
26 
27 /********************************************************************************
28  * Global and Local Variables:
29  */
30 
31 #define FAVORITES_MENU_POSITION 3
32 
33 static WCHAR s_szFavoritesRegKey[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Favorites";
34 
35 static BOOL bInMenuLoop = FALSE; /* Tells us if we are in the menu loop */
36 
37 /*******************************************************************************
38  * Local module support methods
39  */
40 
41 static void resize_frame_rect(HWND hWnd, PRECT prect)
42 {
43  RECT rt;
44  /*
45  if (IsWindowVisible(hToolBar)) {
46  SendMessageW(hToolBar, WM_SIZE, 0, 0);
47  GetClientRect(hToolBar, &rt);
48  prect->top = rt.bottom+3;
49  prect->bottom -= rt.bottom+3;
50  }
51  */
53  {
54  SetupStatusBar(hWnd, TRUE);
56  prect->bottom -= rt.bottom - rt.top;
57  }
58  MoveWindow(g_pChildWnd->hWnd, prect->left, prect->top, prect->right, prect->bottom, TRUE);
59 }
60 
62 {
63  RECT rect;
64 
65  GetClientRect(hWnd, &rect);
66  resize_frame_rect(hWnd, &rect);
67 }
68 
69 /********************************************************************************/
70 
71 static void OnInitMenu(HWND hWnd)
72 {
73  LONG lResult;
74  HKEY hKey = NULL;
75  DWORD dwIndex, cbValueName, cbValueData, dwType;
76  WCHAR szValueName[256];
77  BYTE abValueData[256];
78  static int s_nFavoriteMenuSubPos = -1;
79  HMENU hMenu;
80  BOOL bDisplayedAny = FALSE;
81 
82  /* Find Favorites menu and clear it out */
84  if (!hMenu)
85  goto done;
86  if (s_nFavoriteMenuSubPos < 0)
87  {
88  s_nFavoriteMenuSubPos = GetMenuItemCount(hMenu);
89  }
90  else
91  {
92  while(RemoveMenu(hMenu, s_nFavoriteMenuSubPos, MF_BYPOSITION)) ;
93  }
94 
96  if (lResult != ERROR_SUCCESS)
97  goto done;
98 
99  dwIndex = 0;
100  do
101  {
102  cbValueName = COUNT_OF(szValueName);
103  cbValueData = sizeof(abValueData);
104  lResult = RegEnumValueW(hKey, dwIndex, szValueName, &cbValueName, NULL, &dwType, abValueData, &cbValueData);
105  if ((lResult == ERROR_SUCCESS) && (dwType == REG_SZ))
106  {
107  if (!bDisplayedAny)
108  {
109  AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
110  bDisplayedAny = TRUE;
111  }
112  AppendMenu(hMenu, 0, ID_FAVORITES_MIN + GetMenuItemCount(hMenu), szValueName);
113  }
114  dwIndex++;
115  }
116  while(lResult == ERROR_SUCCESS);
117 
118 done:
119  if (hKey)
120  RegCloseKey(hKey);
121 }
122 
124 {
125  int nParts;
127 
128  /* Update the status bar pane sizes */
129  nParts = -1;
130  SendMessageW(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
131  bInMenuLoop = TRUE;
133 }
134 
136 {
137  bInMenuLoop = FALSE;
138  /* Update the status bar pane sizes*/
139  SetupStatusBar(hWnd, TRUE);
140  UpdateStatusBar();
141 }
142 
143 static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
144 {
145  WCHAR str[100];
146 
147  wcscpy(str, L"");
148  if (nFlags & MF_POPUP)
149  {
150  if (hSysMenu != GetMenu(hWnd))
151  {
152  if (nItemID == 2) nItemID = 5;
153  }
154  }
155  if (LoadStringW(hInst, nItemID, str, 100))
156  {
157  /* load appropriate string*/
158  LPWSTR lpsz = str;
159  /* first newline terminates actual string*/
160  lpsz = wcschr(lpsz, L'\n');
161  if (lpsz != NULL)
162  *lpsz = L'\0';
163  }
165 }
166 
167 void SetupStatusBar(HWND hWnd, BOOL bResize)
168 {
169  RECT rc;
170  int nParts;
171  GetClientRect(hWnd, &rc);
172  nParts = rc.right;
173  /* nParts = -1;*/
174  if (bResize)
176  SendMessageW(hStatusBar, SB_SETPARTS, 1, (LPARAM)&nParts);
177 }
178 
179 void UpdateStatusBar(void)
180 {
181  HKEY hKeyRoot;
182  LPCWSTR pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
183 
184  SendMessageW(hStatusBar, SB_SETTEXTW, 0, (LPARAM)pszKeyPath);
185 }
186 
187 static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
188 {
189  BOOL vis = IsWindowVisible(hchild);
190  HMENU hMenuView = GetSubMenu(hMenuFrame, ID_VIEW_MENU);
191 
192  CheckMenuItem(hMenuView, cmd, vis?MF_BYCOMMAND:MF_BYCOMMAND|MF_CHECKED);
193  ShowWindow(hchild, vis?SW_HIDE:SW_SHOW);
194  resize_frame_client(hWnd);
195 }
196 
198 {
199  DWORD dwErrorCode = CommDlgExtendedError();
201  switch (dwErrorCode)
202  {
203  case CDERR_DIALOGFAILURE:
204  break;
206  break;
207  case CDERR_NOHINSTANCE:
208  break;
210  break;
211  case CDERR_NOHOOK:
212  break;
214  break;
215  case CDERR_NOTEMPLATE:
216  break;
218  break;
219  case CDERR_STRUCTSIZE:
220  break;
222  break;
224  break;
226  break;
228  break;
230  break;
232  break;
233  default:
234  break;
235  }
236  return TRUE;
237 }
238 
241 
242 typedef struct
243 {
247 
248 void
249 BuildFilterStrings(WCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
250 {
251  int i, c;
252 
253  c = 0;
254  for(i = 0; i < PairCount; i++)
255  {
256  c += LoadStringW(hInst, Pairs[i].DisplayID, &Filter[c], 255);
257  Filter[++c] = L'\0';
258  c += LoadStringW(hInst, Pairs[i].FilterID, &Filter[c], 255);
259  Filter[++c] = L'\0';
260  }
261  Filter[++c] = L'\0';
262 }
263 
265 {
266  FILTERPAIR FilterPairs[4];
267  static WCHAR Filter[1024];
268 
269  memset(pofn, 0, sizeof(OPENFILENAME));
270  pofn->lStructSize = sizeof(OPENFILENAME);
271  pofn->hwndOwner = hWnd;
272  pofn->hInstance = hInst;
273 
274  /* create filter string */
275  FilterPairs[0].DisplayID = IDS_FLT_REGFILES;
276  FilterPairs[0].FilterID = IDS_FLT_REGFILES_FLT;
277  FilterPairs[1].DisplayID = IDS_FLT_HIVFILES;
278  FilterPairs[1].FilterID = IDS_FLT_HIVFILES_FLT;
279  FilterPairs[2].DisplayID = IDS_FLT_REGEDIT4;
280  FilterPairs[2].FilterID = IDS_FLT_REGEDIT4_FLT;
281  FilterPairs[3].DisplayID = IDS_FLT_ALLFILES;
282  FilterPairs[3].FilterID = IDS_FLT_ALLFILES_FLT;
283  BuildFilterStrings(Filter, FilterPairs, COUNT_OF(FilterPairs));
284 
285  pofn->lpstrFilter = Filter;
286  pofn->lpstrFile = FileNameBuffer;
287  pofn->nMaxFile = _MAX_PATH;
289  pofn->nMaxFileTitle = _MAX_PATH;
290  pofn->Flags = OFN_HIDEREADONLY;
291  pofn->lpstrDefExt = L"reg";
292  return TRUE;
293 }
294 
295 #define LOADHIVE_KEYNAMELENGTH 128
296 
298 {
299  static LPWSTR sKey = NULL;
300  switch(uMsg)
301  {
302  case WM_INITDIALOG:
303  sKey = (LPWSTR)lParam;
304  break;
305  case WM_COMMAND:
306  switch(LOWORD(wParam))
307  {
308  case IDOK:
310  return EndDialog(hWndDlg, -1);
311  else
312  return EndDialog(hWndDlg, 0);
313  case IDCANCEL:
314  return EndDialog(hWndDlg, 0);
315  }
316  break;
317  }
318  return FALSE;
319 }
320 
321 static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, LPCWSTR lpszSystemName, BOOL bEnablePrivilege)
322 {
323  BOOL bRet = FALSE;
324  HANDLE hToken = NULL;
325 
328  &hToken))
329  {
331 
332  tp.PrivilegeCount = 1;
333  tp.Privileges[0].Attributes = (bEnablePrivilege ? SE_PRIVILEGE_ENABLED : 0);
334 
335  if (LookupPrivilegeValueW(lpszSystemName,
336  lpszPrivilegeName,
337  &tp.Privileges[0].Luid))
338  {
339  bRet = AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, NULL);
340 
342  bRet = FALSE;
343  }
344 
345  CloseHandle(hToken);
346  }
347 
348  return bRet;
349 }
350 
352 {
354  WCHAR Caption[128];
355  LPCWSTR pszKeyPath;
357  HKEY hRootKey;
358  WCHAR Filter[1024];
360  /* get the item key to load the hive in */
361  pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
362  /* initialize the "open file" dialog */
363  InitOpenFileName(hWnd, &ofn);
364  /* build the "All Files" filter up */
365  filter.DisplayID = IDS_FLT_ALLFILES;
367  BuildFilterStrings(Filter, &filter, 1);
368  ofn.lpstrFilter = Filter;
369  /* load and set the caption and flags for dialog */
370  LoadStringW(hInst, IDS_LOAD_HIVE, Caption, COUNT_OF(Caption));
371  ofn.lpstrTitle = Caption;
372  ofn.Flags |= OFN_ENABLESIZING;
373  /* ofn.lCustData = ;*/
374  /* now load the hive */
375  if (GetOpenFileName(&ofn))
376  {
379  {
380  LONG regLoadResult;
381 
382  /* Enable the 'restore' privilege, load the hive, disable the privilege */
384  regLoadResult = RegLoadKeyW(hRootKey, xPath, ofn.lpstrFile);
386 
387  if(regLoadResult == ERROR_SUCCESS)
388  {
389  /* refresh tree and list views */
391  pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
392  RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
393  }
394  else
395  {
396  ErrorMessageBox(hWnd, Caption, regLoadResult);
397  return FALSE;
398  }
399  }
400  }
401  else
402  {
403  CheckCommDlgError(hWnd);
404  }
405  return TRUE;
406 }
407 
409 {
410  WCHAR Caption[128];
411  LPCWSTR pszKeyPath;
412  HKEY hRootKey;
413  LONG regUnloadResult;
414 
415  /* get the item key to unload */
416  pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
417  /* load and set the caption and flags for dialog */
418  LoadStringW(hInst, IDS_UNLOAD_HIVE, Caption, COUNT_OF(Caption));
419 
420  /* Enable the 'restore' privilege, unload the hive, disable the privilege */
422  regUnloadResult = RegUnLoadKeyW(hRootKey, pszKeyPath);
424 
425  if(regUnloadResult == ERROR_SUCCESS)
426  {
427  /* refresh tree and list views */
429  pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hRootKey);
430  RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
431  }
432  else
433  {
434  ErrorMessageBox(hWnd, Caption, regUnloadResult);
435  return FALSE;
436  }
437  return TRUE;
438 }
439 
441 {
442  BOOL bRet = FALSE;
444  WCHAR Caption[128], szTitle[512], szText[512];
445  HKEY hKeyRoot;
446  LPCWSTR pszKeyPath;
447 
448  /* Figure out in which key path we are importing */
449  pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
450 
451  InitOpenFileName(hWnd, &ofn);
452  LoadStringW(hInst, IDS_IMPORT_REG_FILE, Caption, COUNT_OF(Caption));
453  ofn.lpstrTitle = Caption;
454  ofn.Flags |= OFN_ENABLESIZING;
455  /* ofn.lCustData = ;*/
456  if (GetOpenFileName(&ofn))
457  {
458  /* Look at the extension of the file to determine its type */
459  if (ofn.nFileExtension >= 1 &&
460  _wcsicmp(ofn.lpstrFile + ofn.nFileExtension, L"reg") == 0) /* REGEDIT4 or Windows Registry Editor Version 5.00 */
461  {
462  /* Open the file */
463  FILE* fp = _wfopen(ofn.lpstrFile, L"r");
464 
465  /* Import it */
466  if (fp == NULL || !import_registry_file(fp))
467  {
468  /* Error opening the file */
469  LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
470  LoadStringW(hInst, IDS_IMPORT_ERROR, szText, COUNT_OF(szText));
471  InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile);
472  bRet = FALSE;
473  }
474  else
475  {
476  /* Show successful import */
477  LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
478  LoadStringW(hInst, IDS_IMPORT_OK, szText, COUNT_OF(szText));
479  InfoMessageBox(hWnd, MB_OK | MB_ICONINFORMATION, szTitle, szText, ofn.lpstrFile);
480  bRet = TRUE;
481  }
482 
483  /* Close the file */
484  if (fp) fclose(fp);
485  }
486  else /* Registry Hive Files */
487  {
490 
491  /* Display a confirmation message */
492  if (MessageBoxW(g_pChildWnd->hWnd, szText, szTitle, MB_ICONWARNING | MB_YESNO) == IDYES)
493  {
494  LONG lResult;
495  HKEY hSubKey;
496 
497  /* Open the subkey */
498  lResult = RegOpenKeyExW(hKeyRoot, pszKeyPath, 0, KEY_WRITE, &hSubKey);
499  if (lResult == ERROR_SUCCESS)
500  {
501  /* Enable the 'restore' privilege, restore the hive then disable the privilege */
503  lResult = RegRestoreKey(hSubKey, ofn.lpstrFile, REG_FORCE_RESTORE);
505 
506  /* Flush the subkey and close it */
507  RegFlushKey(hSubKey);
508  RegCloseKey(hSubKey);
509  }
510 
511  /* Set the return value */
512  bRet = (lResult == ERROR_SUCCESS);
513 
514  /* Display error, if any */
515  if (!bRet) ErrorMessageBox(hWnd, Caption, lResult);
516  }
517  }
518  }
519  else
520  {
521  CheckCommDlgError(hWnd);
522  }
523 
524  /* refresh tree and list views */
526  pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
527  RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, pszKeyPath);
528 
529  return bRet;
530 }
531 
533 {
534  HWND hwndExportAll;
535  HWND hwndExportBranch;
536  HWND hwndExportBranchText;
537  UINT_PTR iResult = 0;
538  OPENFILENAME *pOfn;
539  LPWSTR pszSelectedKey;
540  OFNOTIFY *pOfnNotify;
541 
542  UNREFERENCED_PARAMETER(wParam);
543 
544  switch(uiMsg)
545  {
546  case WM_INITDIALOG:
547  pOfn = (OPENFILENAME *) lParam;
548  pszSelectedKey = (LPWSTR) pOfn->lCustData;
549 
550  hwndExportAll = GetDlgItem(hdlg, IDC_EXPORT_ALL);
551  if (hwndExportAll)
552  SendMessageW(hwndExportAll, BM_SETCHECK, pszSelectedKey ? BST_UNCHECKED : BST_CHECKED, 0);
553 
554  hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
555  if (hwndExportBranch)
556  SendMessageW(hwndExportBranch, BM_SETCHECK, pszSelectedKey ? BST_CHECKED : BST_UNCHECKED, 0);
557 
558  hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
559  if (hwndExportBranchText)
560  SetWindowTextW(hwndExportBranchText, pszSelectedKey);
561  break;
562 
563  case WM_NOTIFY:
564  if (((NMHDR *) lParam)->code == CDN_FILEOK)
565  {
566  pOfnNotify = (OFNOTIFY *) lParam;
567  pszSelectedKey = (LPWSTR) pOfnNotify->lpOFN->lCustData;
568 
569  hwndExportBranch = GetDlgItem(hdlg, IDC_EXPORT_BRANCH);
570  hwndExportBranchText = GetDlgItem(hdlg, IDC_EXPORT_BRANCH_TEXT);
571  if (hwndExportBranch && hwndExportBranchText
572  && (SendMessageW(hwndExportBranch, BM_GETCHECK, 0, 0) == BST_CHECKED))
573  {
574  GetWindowTextW(hwndExportBranchText, pszSelectedKey, _MAX_PATH);
575  }
576  else
577  {
578  pszSelectedKey[0] = L'\0';
579  }
580  }
581  break;
582  }
583  return iResult;
584 }
585 
587 {
588  BOOL bRet = FALSE;
590  WCHAR ExportKeyPath[_MAX_PATH] = {0};
591  WCHAR Caption[128], szTitle[512], szText[512];
592  HKEY hKeyRoot;
593  LPCWSTR pszKeyPath;
594 
595  /* Figure out which key path we are exporting */
596  pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
597  GetKeyName(ExportKeyPath, COUNT_OF(ExportKeyPath), hKeyRoot, pszKeyPath);
598 
599  InitOpenFileName(hWnd, &ofn);
600  LoadStringW(hInst, IDS_EXPORT_REG_FILE, Caption, COUNT_OF(Caption));
601  ofn.lpstrTitle = Caption;
602 
603  /* Only set the path if a key (not the root node) is selected */
604  if (hKeyRoot != 0)
605  {
606  ofn.lCustData = (LPARAM) ExportKeyPath;
607  }
611  if (GetSaveFileName(&ofn))
612  {
613  switch (ofn.nFilterIndex)
614  {
615  case 2: /* Registry Hive Files */
616  {
617  LONG lResult;
618  HKEY hSubKey;
619 
620  /* Open the subkey */
621  lResult = RegOpenKeyExW(hKeyRoot, pszKeyPath, 0, KEY_READ, &hSubKey);
622  if (lResult == ERROR_SUCCESS)
623  {
624  /* Enable the 'backup' privilege, save the hive then disable the privilege */
626  lResult = RegSaveKeyW(hSubKey, ofn.lpstrFile, NULL);
627  if (lResult == ERROR_ALREADY_EXISTS)
628  {
629  /*
630  * We are here, that means that we already said "yes" to the confirmation dialog.
631  * So we absolutely want to replace the hive file.
632  */
633  if (DeleteFileW(ofn.lpstrFile))
634  {
635  /* Try again */
636  lResult = RegSaveKeyW(hSubKey, ofn.lpstrFile, NULL);
637  }
638  }
640 
641  if (lResult != ERROR_SUCCESS)
642  {
643  /*
644  * If we are here, it's because RegSaveKeyW has failed for any reason.
645  * The problem is that even if it has failed, it has created or
646  * replaced the exported hive file with a new empty file. We don't
647  * want to keep this file, so we delete it.
648  */
649  DeleteFileW(ofn.lpstrFile);
650  }
651 
652  /* Close the subkey */
653  RegCloseKey(hSubKey);
654  }
655 
656  /* Set the return value */
657  bRet = (lResult == ERROR_SUCCESS);
658 
659  /* Display error, if any */
660  if (!bRet) ErrorMessageBox(hWnd, Caption, lResult);
661 
662  break;
663  }
664 
665  case 1: /* Windows Registry Editor Version 5.00 */
666  case 3: /* REGEDIT4 */
667  default: /* All files ==> use Windows Registry Editor Version 5.00 */
668  {
669  if (!export_registry_key(ofn.lpstrFile, ExportKeyPath,
670  (ofn.nFilterIndex == 3 ? REG_FORMAT_4
671  : REG_FORMAT_5)))
672  {
673  /* Error creating the file */
674  LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle));
675  LoadStringW(hInst, IDS_EXPORT_ERROR, szText, COUNT_OF(szText));
676  InfoMessageBox(hWnd, MB_OK | MB_ICONERROR, szTitle, szText, ofn.lpstrFile);
677  bRet = FALSE;
678  }
679  else
680  {
681  bRet = TRUE;
682  }
683 
684  break;
685  }
686  }
687  }
688  else
689  {
690  CheckCommDlgError(hWnd);
691  }
692 
693  return bRet;
694 }
695 
697 {
698 #if 1
699  PRINTDLG pd;
701 
702  ZeroMemory(&pd, sizeof(PRINTDLG));
703  pd.lStructSize = sizeof(PRINTDLG);
704  pd.hwndOwner = hWnd;
705  pd.hDevMode = NULL; /* Don't forget to free or store hDevMode*/
706  pd.hDevNames = NULL; /* Don't forget to free or store hDevNames*/
708  pd.nCopies = 1;
709  pd.nFromPage = 0xFFFF;
710  pd.nToPage = 0xFFFF;
711  pd.nMinPage = 1;
712  pd.nMaxPage = 0xFFFF;
713  if (PrintDlg(&pd))
714  {
715  /* GDI calls to render output. */
716  DeleteDC(pd.hDC); /* Delete DC when done.*/
717  }
718 #else
719  HRESULT hResult;
720  PRINTDLGEX pd;
721 
722  hResult = PrintDlgEx(&pd);
723  if (hResult == S_OK)
724  {
725  switch (pd.dwResultAction)
726  {
727  case PD_RESULT_APPLY:
728  /*The user clicked the Apply button and later clicked the Cancel button. This indicates that the user wants to apply the changes made in the property sheet, but does not yet want to print. The PRINTDLGEX structure contains the information specified by the user at the time the Apply button was clicked. */
729  break;
730  case PD_RESULT_CANCEL:
731  /*The user clicked the Cancel button. The information in the PRINTDLGEX structure is unchanged. */
732  break;
733  case PD_RESULT_PRINT:
734  /*The user clicked the Print button. The PRINTDLGEX structure contains the information specified by the user. */
735  break;
736  default:
737  break;
738  }
739  }
740  else
741  {
742  switch (hResult)
743  {
744  case E_OUTOFMEMORY:
745  /*Insufficient memory. */
746  break;
747  case E_INVALIDARG:
748  /* One or more arguments are invalid. */
749  break;
750  case E_POINTER:
751  /*Invalid pointer. */
752  break;
753  case E_HANDLE:
754  /*Invalid handle. */
755  break;
756  case E_FAIL:
757  /*Unspecified error. */
758  break;
759  default:
760  break;
761  }
762  return FALSE;
763  }
764 #endif
765  return TRUE;
766 }
767 
768 static void ChooseFavorite(LPCWSTR pszFavorite)
769 {
770  HKEY hKey = NULL;
771  WCHAR szFavoritePath[512];
772  DWORD cbData, dwType;
773 
775  goto done;
776 
777  cbData = sizeof(szFavoritePath);
778  memset(szFavoritePath, 0, sizeof(szFavoritePath));
779  if (RegQueryValueExW(hKey, pszFavorite, NULL, &dwType, (LPBYTE) szFavoritePath, &cbData) != ERROR_SUCCESS)
780  goto done;
781 
782  if (dwType == REG_SZ)
783  SelectNode(g_pChildWnd->hTreeWnd, szFavoritePath);
784 
785 done:
786  if (hKey)
787  RegCloseKey(hKey);
788 }
789 
790 BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName)
791 {
792  BOOL bClipboardOpened = FALSE;
793  BOOL bSuccess = FALSE;
794  WCHAR szBuffer[512];
795  HGLOBAL hGlobal;
796  LPWSTR s;
797 
798  if (!OpenClipboard(hWnd))
799  goto done;
800  bClipboardOpened = TRUE;
801 
802  if (!EmptyClipboard())
803  goto done;
804 
805  if (!GetKeyName(szBuffer, COUNT_OF(szBuffer), hRootKey, keyName))
806  goto done;
807 
808  hGlobal = GlobalAlloc(GMEM_MOVEABLE, (wcslen(szBuffer) + 1) * sizeof(WCHAR));
809  if (!hGlobal)
810  goto done;
811 
812  s = GlobalLock(hGlobal);
813  wcscpy(s, szBuffer);
814  GlobalUnlock(hGlobal);
815 
817  bSuccess = TRUE;
818 
819 done:
820  if (bClipboardOpened)
821  CloseClipboard();
822  return bSuccess;
823 }
824 
825 static BOOL CreateNewValue(HKEY hRootKey, LPCWSTR pszKeyPath, DWORD dwType)
826 {
827  WCHAR szNewValueFormat[128];
828  WCHAR szNewValue[128];
829  int iIndex = 1;
830  BYTE data[128];
831  DWORD dwExistingType, cbData;
832  LONG lResult;
833  HKEY hKey;
834  LVFINDINFO lvfi;
835 
836  if (RegOpenKeyExW(hRootKey, pszKeyPath, 0, KEY_QUERY_VALUE | KEY_SET_VALUE,
837  &hKey) != ERROR_SUCCESS)
838  return FALSE;
839 
840  LoadStringW(hInst, IDS_NEW_VALUE, szNewValueFormat, COUNT_OF(szNewValueFormat));
841 
842  do
843  {
844  wsprintf(szNewValue, szNewValueFormat, iIndex++);
845  cbData = sizeof(data);
846  lResult = RegQueryValueExW(hKey, szNewValue, NULL, &dwExistingType, data, &cbData);
847  }
848  while(lResult == ERROR_SUCCESS);
849 
850  switch(dwType)
851  {
852  case REG_DWORD:
853  cbData = sizeof(DWORD);
854  break;
855  case REG_SZ:
856  case REG_EXPAND_SZ:
857  cbData = sizeof(WCHAR);
858  break;
859  case REG_MULTI_SZ:
860  /*
861  * WARNING: An empty multi-string has only one null char.
862  * Indeed, multi-strings are built in the following form:
863  * str1\0str2\0...strN\0\0
864  * where each strI\0 is a null-terminated string, and it
865  * ends with a terminating empty string.
866  * Therefore an empty multi-string contains only the terminating
867  * empty string, that is, one null char.
868  */
869  cbData = sizeof(WCHAR);
870  break;
871  case REG_QWORD: /* REG_QWORD_LITTLE_ENDIAN */
872  cbData = sizeof(DWORDLONG); // == sizeof(DWORD) * 2;
873  break;
874  default:
875  cbData = 0;
876  break;
877  }
878  memset(data, 0, cbData);
879  lResult = RegSetValueExW(hKey, szNewValue, 0, dwType, data, cbData);
880  RegCloseKey(hKey);
881  if (lResult != ERROR_SUCCESS)
882  {
883  return FALSE;
884  }
885 
886  RefreshListView(g_pChildWnd->hListWnd, hRootKey, pszKeyPath);
887 
888  /* locate the newly added value, and get ready to rename it */
889  memset(&lvfi, 0, sizeof(lvfi));
890  lvfi.flags = LVFI_STRING;
891  lvfi.psz = szNewValue;
892  iIndex = ListView_FindItem(g_pChildWnd->hListWnd, -1, &lvfi);
893  if (iIndex >= 0)
895 
896  return TRUE;
897 }
898 
899 static HRESULT
900 InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
901 {
902  HRESULT hRet;
903 
904  *pDsObjectPicker = NULL;
905 
906  hRet = CoCreateInstance(&CLSID_DsObjectPicker,
907  NULL,
908  CLSCTX_INPROC_SERVER,
909  &IID_IDsObjectPicker,
910  (LPVOID*)pDsObjectPicker);
911  if (SUCCEEDED(hRet))
912  {
913  DSOP_INIT_INFO InitInfo;
914  static DSOP_SCOPE_INIT_INFO Scopes[] =
915  {
916  {
917  sizeof(DSOP_SCOPE_INIT_INFO),
922  0,
923  {
924  {
926  0,
927  0
928  },
930  },
931  NULL,
932  NULL,
933  S_OK
934  },
935  };
936 
937  InitInfo.cbSize = sizeof(InitInfo);
938  InitInfo.pwzTargetComputer = NULL;
939  InitInfo.cDsScopeInfos = COUNT_OF(Scopes);
940  InitInfo.aDsScopeInfos = Scopes;
941  InitInfo.flOptions = 0;
942  InitInfo.cAttributesToFetch = 0;
943  InitInfo.apwzAttributeNames = NULL;
944 
945  hRet = (*pDsObjectPicker)->lpVtbl->Initialize(*pDsObjectPicker,
946  &InitInfo);
947 
948  if (FAILED(hRet))
949  {
950  /* delete the object picker in case initialization failed! */
951  (*pDsObjectPicker)->lpVtbl->Release(*pDsObjectPicker);
952  }
953  }
954 
955  return hRet;
956 }
957 
958 static HRESULT
959 InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker,
962  IN UINT uSize)
963 {
964  IDataObject *pdo = NULL;
965  HRESULT hRet;
966 
967  hRet = pDsObjectPicker->lpVtbl->InvokeDialog(pDsObjectPicker,
968  hwndParent,
969  &pdo);
970  if (hRet == S_OK)
971  {
972  STGMEDIUM stm;
973  FORMATETC fe;
974 
975  fe.cfFormat = (CLIPFORMAT) RegisterClipboardFormatW(CFSTR_DSOP_DS_SELECTION_LIST);
976  fe.ptd = NULL;
977  fe.dwAspect = DVASPECT_CONTENT;
978  fe.lindex = -1;
979  fe.tymed = TYMED_HGLOBAL;
980 
981  hRet = pdo->lpVtbl->GetData(pdo,
982  &fe,
983  &stm);
984  if (SUCCEEDED(hRet))
985  {
986  PDS_SELECTION_LIST SelectionList = (PDS_SELECTION_LIST)GlobalLock(stm.hGlobal);
987  if (SelectionList != NULL)
988  {
989  if (SelectionList->cItems == 1)
990  {
991  size_t nlen = wcslen(SelectionList->aDsSelection[0].pwzName);
992  if (nlen >= uSize)
993  {
994  nlen = uSize - 1;
995  }
996 
997  memcpy(lpBuffer,
998  SelectionList->aDsSelection[0].pwzName,
999  nlen * sizeof(WCHAR));
1000 
1001  lpBuffer[nlen] = L'\0';
1002  }
1003 
1004  GlobalUnlock(stm.hGlobal);
1005  }
1006 
1007  ReleaseStgMedium(&stm);
1008  }
1009 
1010  pdo->lpVtbl->Release(pdo);
1011  }
1012 
1013  return hRet;
1014 }
1015 
1016 static VOID
1017 FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker)
1018 {
1019  pDsObjectPicker->lpVtbl->Release(pDsObjectPicker);
1020 }
1021 
1022 /*******************************************************************************
1023  *
1024  * FUNCTION: _CmdWndProc(HWND, unsigned, WORD, LONG)
1025  *
1026  * PURPOSE: Processes WM_COMMAND messages for the main frame window.
1027  *
1028  */
1030 {
1031  HKEY hKeyRoot = 0, hKey = 0;
1032  LPCWSTR keyPath;
1033  LPCWSTR valueName;
1034  BOOL result = TRUE;
1035  REGSAM regsam = KEY_READ;
1036  int item;
1037 
1038  UNREFERENCED_PARAMETER(lParam);
1039  UNREFERENCED_PARAMETER(message);
1040 
1041  switch (LOWORD(wParam))
1042  {
1043  case ID_REGISTRY_LOADHIVE:
1044  LoadHive(hWnd);
1045  return TRUE;
1047  UnloadHive(hWnd);
1048  return TRUE;
1050  ImportRegistryFile(hWnd);
1051  return TRUE;
1053  ExportRegistryFile(hWnd);
1054  return TRUE;
1056  {
1057  IDsObjectPicker *ObjectPicker;
1058  WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1059  HRESULT hRet;
1060 
1061  hRet = CoInitialize(NULL);
1062  if (SUCCEEDED(hRet))
1063  {
1064  hRet = InitializeRemoteRegistryPicker(&ObjectPicker);
1065  if (SUCCEEDED(hRet))
1066  {
1067  hRet = InvokeRemoteRegistryPickerDialog(ObjectPicker,
1068  hWnd,
1069  szComputerName,
1070  COUNT_OF(szComputerName));
1071  if (hRet == S_OK)
1072  {
1073  /* FIXME - connect to the registry */
1074  }
1075 
1076  FreeObjectPicker(ObjectPicker);
1077  }
1078 
1079  CoUninitialize();
1080  }
1081 
1082  return TRUE;
1083  }
1085  return TRUE;
1086  case ID_REGISTRY_PRINT:
1087  PrintRegistryHive(hWnd, L"");
1088  return TRUE;
1089  case ID_REGISTRY_EXIT:
1090  DestroyWindow(hWnd);
1091  return TRUE;
1092  case ID_VIEW_STATUSBAR:
1093  toggle_child(hWnd, LOWORD(wParam), hStatusBar);
1094  return TRUE;
1095  case ID_HELP_HELPTOPICS:
1096  WinHelpW(hWnd, getAppName(), HELP_FINDER, 0);
1097  return TRUE;
1098  case ID_HELP_ABOUT:
1099  ShowAboutBox(hWnd);
1100  return TRUE;
1101  case ID_VIEW_SPLIT:
1102  {
1103  RECT rt;
1104  POINT pt, pts;
1106  pt.x = rt.left + g_pChildWnd->nSplitPos;
1107  pt.y = (rt.bottom / 2);
1108  pts = pt;
1109  if(ClientToScreen(g_pChildWnd->hWnd, &pts))
1110  {
1111  SetCursorPos(pts.x, pts.y);
1114  }
1115  return TRUE;
1116  }
1117  case ID_EDIT_RENAME:
1118  case ID_EDIT_MODIFY:
1119  case ID_EDIT_MODIFY_BIN:
1120  case ID_EDIT_DELETE:
1121  regsam |= KEY_WRITE;
1122  break;
1123  }
1124 
1125  keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
1126  valueName = GetValueName(g_pChildWnd->hListWnd, -1);
1127  if (keyPath)
1128  {
1129  if (RegOpenKeyExW(hKeyRoot, keyPath, 0, regsam, &hKey) != ERROR_SUCCESS)
1130  hKey = 0;
1131  }
1132 
1133  switch (LOWORD(wParam))
1134  {
1135  case ID_EDIT_MODIFY:
1136  if (valueName && ModifyValue(hWnd, hKey, valueName, FALSE))
1137  RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
1138  break;
1139  case ID_EDIT_MODIFY_BIN:
1140  if (valueName && ModifyValue(hWnd, hKey, valueName, TRUE))
1141  RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
1142  break;
1143  case ID_EDIT_RENAME:
1144  if (GetFocus() == g_pChildWnd->hListWnd)
1145  {
1147  {
1149  if(item > -1)
1150  {
1152  }
1153  }
1154  }
1155  else if (GetFocus() == g_pChildWnd->hTreeWnd)
1156  {
1157  /* Get focused entry of treeview (if any) */
1159  if (hItem != NULL)
1161  }
1162  break;
1163  case ID_EDIT_DELETE:
1164  {
1165  if (GetFocus() == g_pChildWnd->hListWnd && hKey)
1166  {
1168  if(nSelected >= 1)
1169  {
1170  WCHAR msg[128], caption[128];
1171  LoadStringW(hInst, IDS_QUERY_DELETE_CONFIRM, caption, COUNT_OF(caption));
1172  LoadStringW(hInst, (nSelected == 1 ? IDS_QUERY_DELETE_ONE : IDS_QUERY_DELETE_MORE), msg, COUNT_OF(msg));
1173  if(MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONQUESTION | MB_YESNO) == IDYES)
1174  {
1175  int ni, errs;
1176 
1177  item = -1;
1178  errs = 0;
1179  while((ni = ListView_GetNextItem(g_pChildWnd->hListWnd, item, LVNI_SELECTED)) > -1)
1180  {
1181  valueName = GetValueName(g_pChildWnd->hListWnd, item);
1182  if(RegDeleteValueW(hKey, valueName) != ERROR_SUCCESS)
1183  {
1184  errs++;
1185  }
1186  item = ni;
1187  }
1188 
1189  RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
1190  if(errs > 0)
1191  {
1192  LoadStringW(hInst, IDS_ERR_DELVAL_CAPTION, caption, COUNT_OF(caption));
1194  MessageBoxW(g_pChildWnd->hWnd, msg, caption, MB_ICONSTOP);
1195  }
1196  }
1197  }
1198  }
1199  else if (GetFocus() == g_pChildWnd->hTreeWnd)
1200  {
1201  if (keyPath == NULL || *keyPath == UNICODE_NULL)
1202  {
1204  }
1205  else if (DeleteKey(hWnd, hKeyRoot, keyPath))
1206  {
1209  }
1210  }
1211  break;
1212  }
1214  CreateNewValue(hKeyRoot, keyPath, REG_SZ);
1215  break;
1217  CreateNewValue(hKeyRoot, keyPath, REG_BINARY);
1218  break;
1220  CreateNewValue(hKeyRoot, keyPath, REG_DWORD);
1221  break;
1223  CreateNewValue(hKeyRoot, keyPath, REG_MULTI_SZ);
1224  break;
1226  CreateNewValue(hKeyRoot, keyPath, REG_EXPAND_SZ);
1227  break;
1228  case ID_EDIT_FIND:
1229  FindDialog(hWnd);
1230  break;
1231  case ID_EDIT_FINDNEXT:
1232  FindNext(hWnd);
1233  break;
1234  case ID_EDIT_COPYKEYNAME:
1235  CopyKeyName(hWnd, hKeyRoot, keyPath);
1236  break;
1237  case ID_EDIT_PERMISSIONS:
1238  RegKeyEditPermissions(hWnd, hKeyRoot, NULL, keyPath);
1239  break;
1241  /*PRINTDLG pd;*/
1242  /*PrintDlg(&pd);*/
1243  /*PAGESETUPDLG psd;*/
1244  /*PageSetupDlg(&psd);*/
1245  break;
1246  case ID_REGISTRY_OPENLOCAL:
1247  break;
1248 
1249  case ID_VIEW_REFRESH:
1251  keyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
1252  RefreshListView(g_pChildWnd->hListWnd, hKeyRoot, keyPath);
1253  break;
1254  /*case ID_OPTIONS_TOOLBAR:*/
1255  /* toggle_child(hWnd, LOWORD(wParam), hToolBar);*/
1256  /* break;*/
1257  case ID_EDIT_NEW_KEY:
1259  break;
1260  default:
1261  if ((LOWORD(wParam) >= ID_FAVORITES_MIN) && (LOWORD(wParam) <= ID_FAVORITES_MAX))
1262  {
1263  HMENU hMenu;
1264  MENUITEMINFOW mii;
1265  WCHAR szFavorite[512];
1266 
1267  hMenu = GetSubMenu(GetMenu(hWnd), FAVORITES_MENU_POSITION);
1268 
1269  memset(&mii, 0, sizeof(mii));
1270  mii.cbSize = sizeof(mii);
1271  mii.fMask = MIIM_TYPE;
1272  mii.fType = MFT_STRING;
1273  mii.dwTypeData = szFavorite;
1274  mii.cch = COUNT_OF(szFavorite);
1275 
1276  if (GetMenuItemInfo(hMenu, LOWORD(wParam) - ID_FAVORITES_MIN, TRUE, &mii))
1277  {
1278  ChooseFavorite(szFavorite);
1279  }
1280  }
1281  else
1282  {
1283  result = FALSE;
1284  }
1285  break;
1286  }
1287 
1288  if(hKey)
1289  RegCloseKey(hKey);
1290  return result;
1291 }
1292 
1293 /********************************************************************************
1294  *
1295  * FUNCTION: FrameWndProc(HWND, unsigned, WORD, LONG)
1296  *
1297  * PURPOSE: Processes messages for the main frame window.
1298  *
1299  * WM_COMMAND - process the application menu
1300  * WM_DESTROY - post a quit message and return
1301  *
1302  */
1303 
1305 {
1306  switch (message)
1307  {
1308  case WM_CREATE:
1309  // For now, the Help dialog item is disabled because of lacking of HTML Help support
1313  hWnd, (HMENU)0, hInst, 0);
1314  break;
1315  case WM_COMMAND:
1316  if (!_CmdWndProc(hWnd, message, wParam, lParam))
1317  return DefWindowProcW(hWnd, message, wParam, lParam);
1318  break;
1319  case WM_ACTIVATE:
1320  if (LOWORD(hWnd) && g_pChildWnd)
1322  break;
1323  case WM_SIZE:
1324  resize_frame_client(hWnd);
1325  break;
1326  case WM_TIMER:
1327  break;
1328  case WM_INITMENU:
1329  OnInitMenu(hWnd);
1330  break;
1331  case WM_ENTERMENULOOP:
1332  OnEnterMenuLoop(hWnd);
1333  break;
1334  case WM_EXITMENULOOP:
1335  OnExitMenuLoop(hWnd);
1336  break;
1337  case WM_MENUSELECT:
1338  OnMenuSelect(hWnd, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam);
1339  break;
1340  case WM_SYSCOLORCHANGE:
1341  /* Forward WM_SYSCOLORCHANGE to common controls */
1344  break;
1345  case WM_DESTROY:
1346  WinHelpW(hWnd, getAppName(), HELP_QUIT, 0);
1347  SaveSettings();
1348  PostQuitMessage(0);
1349  default:
1350  return DefWindowProcW(hWnd, message, wParam, lParam);
1351  }
1352  return 0;
1353 }
#define IDC_SIZEWE
Definition: winuser.h:689
#define MB_ICONHAND
Definition: winuser.h:782
#define OFN_EXPLORER
Definition: commdlg.h:104
#define ID_REGISTRY_IMPORTREGISTRYFILE
Definition: resource.h:70
#define ListView_GetNextItem(hwnd, i, flags)
Definition: commctrl.h:2404
#define IN
Definition: typedefs.h:38
#define DSOP_SCOPE_TYPE_GLOBAL_CATALOG
Definition: objsel.h:125
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1608
Definition: tftpd.h:59
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2195
#define MFT_STRING
Definition: winuser.h:741
void SetupStatusBar(HWND hWnd, BOOL bResize)
Definition: framewnd.c:167
#define TRUE
Definition: types.h:120
static void resize_frame_rect(HWND hWnd, PRECT prect)
Definition: framewnd.c:41
#define RegRestoreKey
Definition: winreg.h:526
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define IDOK
Definition: winuser.h:824
#define CloseHandle
Definition: compat.h:398
WORD nFileExtension
Definition: commdlg.h:344
WCHAR FileTitleBuffer[_MAX_PATH]
Definition: framewnd.c:240
WORD nMaxPage
Definition: commdlg.h:474
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode,...)
Definition: error.c:24
ChildWnd * g_pChildWnd
Definition: childwnd.c:23
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:47
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define MF_BYCOMMAND
Definition: winuser.h:202
#define E_HANDLE
Definition: winerror.h:2850
long y
Definition: polytest.cpp:48
#define ID_REGISTRY_LOADHIVE
Definition: resource.h:106
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
#define IDS_FLT_HIVFILES
Definition: resource.h:166
UINT FilterID
Definition: framewnd.c:245
BOOL ExportRegistryFile(HWND hWnd)
Definition: framewnd.c:586
#define IDYES
Definition: winuser.h:829
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define CDERR_LOADRESFAILURE
Definition: cderr.h:12
#define ID_EDIT_COPYKEYNAME
Definition: resource.h:61
#define IDC_EDIT_KEY
Definition: resource.h:264
LPSTR lpstrFileTitle
Definition: commdlg.h:338
static void OnExitMenuLoop(HWND hWnd)
Definition: framewnd.c:135
void ShowAboutBox(HWND hWnd)
Definition: about.c:25
long x
Definition: polytest.cpp:48
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
Definition: ole2.c:2024
LPARAM lCustData
Definition: commdlg.h:346
struct _DS_SELECTION_LIST * PDS_SELECTION_LIST
HWND hwndOwner
Definition: commdlg.h:330
#define REG_BINARY
Definition: nt_native.h:1496
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
Definition: ftp_var.h:139
#define ID_EDIT_NEW_EXPANDABLESTRINGVALUE
Definition: resource.h:149
#define ID_FAVORITES_MAX
Definition: resource.h:296
static void resize_frame_client(HWND hWnd)
Definition: framewnd.c:61
#define KEY_READ
Definition: nt_native.h:1023
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
#define pt(x, y)
Definition: drawing.c:79
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define SW_HIDE
Definition: winuser.h:762
#define SE_BACKUP_NAME
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
#define DWORD
Definition: msvc.h:34
static struct netconfig_info ni
Definition: getnetconfig.c:158
#define TreeView_EditLabel(hwnd, hitem)
Definition: commctrl.h:3471
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HELP_QUIT
Definition: winuser.h:2368
HWND hTreeWnd
Definition: main.h:60
#define MAKELPARAM(l, h)
Definition: winuser.h:3915
#define ID_EDIT_FIND
Definition: resource.h:62
static WCHAR s_szFavoritesRegKey[]
Definition: framewnd.c:33
#define CDERR_NOHINSTANCE
Definition: cderr.h:9
#define IDS_QUERY_IMPORT_HIVE_MSG
Definition: resource.h:143
HWND hListWnd
Definition: main.h:61
#define CALLBACK
Definition: compat.h:27
HWND hWnd
Definition: settings.c:17
LONG top
Definition: windef.h:297
static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
Definition: framewnd.c:143
OPENFILENAME ofn
Definition: main.cpp:37
#define IDS_QUERY_IMPORT_HIVE_CAPTION
Definition: resource.h:142
$ULONG PrivilegeCount
Definition: setypes.h:969
ULONG cAttributesToFetch
Definition: objsel.h:114
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
#define ZeroMemory
Definition: winbase.h:1635
LPCSTR lpstrDefExt
Definition: commdlg.h:345
HWND WINAPI SetFocus(_In_opt_ HWND)
LPWSTR dwTypeData
Definition: winuser.h:3211
WORD nCopies
Definition: commdlg.h:475
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
#define ID_EDIT_FINDNEXT
Definition: resource.h:63
#define LVNI_SELECTED
Definition: commctrl.h:2394
int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage,...)
Definition: error.c:51
_In_ UINT64 _In_ UINT64 _In_ UINT64 _In_opt_ traverse_ptr * tp
Definition: btrfs.c:2630
#define WS_CHILD
Definition: pedump.c:617
PCWSTR * apwzAttributeNames
Definition: objsel.h:115
#define MB_ICONSTOP
Definition: winuser.h:797
#define FNERR_SUBCLASSFAILURE
Definition: cderr.h:35
LPCSTR lpTemplateName
Definition: commdlg.h:348
BOOL FindNext(HWND hWnd)
Definition: find.c:631
LONG left
Definition: windef.h:296
#define IDS_QUERY_DELETE_MORE
Definition: resource.h:136
static HRESULT InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
Definition: framewnd.c:900
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define ID_HELP_HELPTOPICS
Definition: resource.h:76
int32_t INT_PTR
Definition: typedefs.h:62
LONG WINAPI RegFlushKey(HKEY hKey)
Definition: reg.c:2988
static void ChooseFavorite(LPCWSTR pszFavorite)
Definition: framewnd.c:768
#define WCHAR
Definition: msvc.h:43
LONG right
Definition: windef.h:298
#define IDC_EXPORT_ALL
Definition: resource.h:259
#define E_FAIL
Definition: ddrawi.h:102
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IDC_EXPORT_BRANCH
Definition: resource.h:260
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
HANDLE WINAPI SetClipboardData(_In_ UINT, _In_opt_ HANDLE)
static BOOLEAN bSuccess
Definition: drive.cpp:419
#define GetOpenFileName
Definition: commdlg.h:665
PCWSTR pwzTargetComputer
Definition: objsel.h:110
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define MB_ICONWARNING
Definition: winuser.h:780
WORD nMinPage
Definition: commdlg.h:473
static BOOL LoadHive(HWND hWnd)
Definition: framewnd.c:351
DWORD nMaxFile
Definition: commdlg.h:337
UINT_PTR WPARAM
Definition: windef.h:207
ULONG cDsScopeInfos
Definition: objsel.h:111
#define CDERR_STRUCTSIZE
Definition: cderr.h:6
UINT DisplayID
Definition: framewnd.c:244
HANDLE hDevNames
Definition: commdlg.h:468
#define ID_EDIT_NEW_BINARYVALUE
Definition: resource.h:67
#define IDS_FLT_ALLFILES
Definition: resource.h:170
#define CDERR_FINDRESFAILURE
Definition: cderr.h:11
void SaveSettings(void)
Definition: settings.c:113
#define HELP_FINDER
Definition: winuser.h:2373
#define GetSaveFileName
Definition: commdlg.h:666
#define PrintDlg
Definition: commdlg.h:668
int nSplitPos
Definition: main.h:65
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63
#define CFSTR_DSOP_DS_SELECTION_LIST
Definition: objsel.h:27
GLenum GLclampf GLint i
Definition: glfuncs.h:14
static VOID FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker)
Definition: framewnd.c:1017
#define ID_REGISTRY_EXIT
Definition: resource.h:53
#define PD_USEDEVMODECOPIESANDCOLLATE
Definition: commdlg.h:166
#define ID_VIEW_STATUSBAR
Definition: resource.h:56
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define ListView_GetSelectedCount(hwndLV)
Definition: commctrl.h:2679
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
LPOFNHOOKPROC lpfnHook
Definition: commdlg.h:347
void UpdateStatusBar(void)
Definition: framewnd.c:179
#define MB_YESNO
Definition: winuser.h:811
#define UNICODE_NULL
static const WCHAR szText[]
Definition: dialog.c:139
static BOOL UnloadHive(HWND hWnd)
Definition: framewnd.c:408
#define IDS_IMPORT_REG_FILE
Definition: resource.h:132
long LONG
Definition: pedump.c:60
#define ID_EDIT_DELETE
Definition: resource.h:59
#define IDC_EXPORT_BRANCH_TEXT
Definition: resource.h:261
LONG_PTR LPARAM
Definition: windef.h:208
#define IDS_EXPORT_REG_FILE
Definition: resource.h:133
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1802
#define WM_ENTERMENULOOP
Definition: winuser.h:1780
#define MF_BYPOSITION
Definition: winuser.h:203
#define _MAX_PATH
Definition: utility.h:77
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3311
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define WM_MENUSELECT
Definition: winuser.h:1723
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
Definition: db.cpp:163
#define OFN_ENABLEHOOK
Definition: commdlg.h:99
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
ULONG cbSize
Definition: objsel.h:109
#define OFN_ENABLETEMPLATE
Definition: commdlg.h:102
LPCWSTR GetValueName(HWND hwndLV, int iStartAt)
Definition: listview.c:55
ULONG Release()
#define CW_USEDEFAULT
Definition: winuser.h:225
BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName)
Definition: framewnd.c:790
static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:532
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, LPCWSTR lpszSystemName, BOOL bEnablePrivilege)
Definition: framewnd.c:321
#define ID_HELP_ABOUT
Definition: resource.h:77
#define ID_REGISTRY_CONNECTNETWORKREGISTRY
Definition: resource.h:72
#define ID_EDIT_PERMISSIONS
Definition: resource.h:152
#define E_INVALIDARG
Definition: ddrawi.h:101
#define CF_UNICODETEXT
Definition: constants.h:408
#define IDS_UNLOAD_HIVE
Definition: resource.h:146
const WCHAR * str
LONG WINAPI RegEnumValueW(_In_ HKEY hKey, _In_ DWORD index, _Out_ LPWSTR value, _Inout_ PDWORD val_count, _Reserved_ PDWORD reserved, _Out_opt_ PDWORD type, _Out_opt_ LPBYTE data, _Inout_opt_ PDWORD count)
Definition: reg.c:2867
#define WM_EXITMENULOOP
Definition: winuser.h:1781
UINT msg
Definition: msvc.h:92
WORD nFromPage
Definition: commdlg.h:471
smooth NULL
Definition: ftsmooth.c:416
struct _DSOP_SCOPE_INIT_INFO DSOP_SCOPE_INIT_INFO
static HWND hwndParent
Definition: cryptui.c:300
#define MB_ICONQUESTION
Definition: winuser.h:783
#define CDERR_LOADSTRFAILURE
Definition: cderr.h:10
#define MF_SEPARATOR
Definition: winuser.h:137
#define IDD_EXPORTRANGE
Definition: resource.h:41
#define PD_RETURNDC
Definition: commdlg.h:155
static HRESULT InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker, IN HWND hwndParent OPTIONAL, OUT LPWSTR lpBuffer, IN UINT uSize)
Definition: framewnd.c:959
#define BM_GETCHECK
Definition: winuser.h:1879
#define IDS_QUERY_DELETE_ONE
Definition: resource.h:135
#define ID_EDIT_RENAME
Definition: resource.h:60
BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem)
Definition: treeview.c:102
HINSTANCE hInstance
Definition: commdlg.h:331
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
Definition: treeview.c:83
OPENFILENAMEA OPENFILENAME
Definition: commdlg.h:657
#define SW_SHOW
Definition: winuser.h:769
BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin)
Definition: edit.c:1072
#define IDD_LOADHIVE
Definition: resource.h:263
#define WM_DESTROY
Definition: winuser.h:1591
#define CDERR_LOCKRESFAILURE
Definition: cderr.h:13
#define IDS_ERR_DELVAL_CAPTION
Definition: resource.h:138
#define GetMenuItemInfo
Definition: winuser.h:5654
#define MF_CHECKED
Definition: winuser.h:132
#define KEY_WRITE
Definition: nt_native.h:1031
LPOPENFILENAMEA lpOFN
Definition: commdlg.h:407
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:4917
#define ID_VIEW_REFRESH
Definition: resource.h:58
#define BM_SETCHECK
Definition: winuser.h:1882
#define COUNT_OF(a)
Definition: main.h:33
BOOL WINAPI EmptyClipboard(void)
Definition: ntwrapper.h:190
LONG WINAPI RegSaveKeyW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
Definition: reg.c:4649
static INT_PTR CALLBACK LoadHive_KeyNameInHookProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:297
#define TreeView_GetSelection(hwnd)
Definition: commctrl.h:3440
unsigned int BOOL
Definition: ntddk_ex.h:94
#define AppendMenu
Definition: winuser.h:5597
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
static BOOL ImportRegistryFile(HWND hWnd)
Definition: framewnd.c:440
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4134
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
static void OnEnterMenuLoop(HWND hWnd)
Definition: framewnd.c:123
#define WM_SIZE
Definition: winuser.h:1593
LONG HRESULT
Definition: typedefs.h:77
#define PD_RESULT_PRINT
Definition: commdlg.h:202
#define ID_REGISTRY_UNLOADHIVE
Definition: resource.h:107
LONG WINAPI RegUnLoadKeyW(HKEY hKey, LPCWSTR lpSubKey)
Definition: reg.c:5114
#define CDN_FILEOK
Definition: commdlg.h:38
#define CDERR_INITIALIZATION
Definition: cderr.h:7
HWND hWnd
Definition: main.h:59
#define WM_TIMER
Definition: winuser.h:1718
HANDLE WINAPI GetCurrentProcess(VOID)
Definition: proc.c:1168
DWORD lStructSize
Definition: commdlg.h:329
unsigned int UINT
Definition: ndis.h:50
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
Definition: cursoricon.c:2627
nsrefcnt Release()
unsigned long DWORD
Definition: ntddk_ex.h:95
HWND hStatusBar
Definition: main.cpp:35
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2074
#define SB_SETTEXTW
Definition: commctrl.h:1912
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define IDS_FLT_REGEDIT4_FLT
Definition: resource.h:169
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:1029
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define REG_FORMAT_5
Definition: regproc.h:24
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:36
BOOL WINAPI CloseClipboard(void)
Definition: ntwrapper.h:178
#define ID_REGISTRY_DISCONNECTNETWORKREGISTRY
Definition: resource.h:73
static BOOL CheckCommDlgError(HWND hWnd)
Definition: framewnd.c:197
PDSOP_SCOPE_INIT_INFO aDsScopeInfos
Definition: objsel.h:112
#define CDERR_NOHOOK
Definition: cderr.h:16
static void OnInitMenu(HWND hWnd)
Definition: framewnd.c:71
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define ID_FAVORITES_MIN
Definition: resource.h:295
#define CDERR_NOTEMPLATE
Definition: cderr.h:8
#define IDS_LOAD_HIVE
Definition: resource.h:145
#define ID_EDIT_NEW_KEY
Definition: resource.h:65
#define MF_POPUP
Definition: winuser.h:136
#define DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN
Definition: objsel.h:126
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define DSOP_SCOPE_TYPE_DOWNLEVEL_JOINED_DOMAIN
Definition: objsel.h:123
static const WCHAR L[]
Definition: oid.c:1087
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
#define SE_RESTORE_NAME
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath)
Definition: listview.c:670
#define ID_REGISTRY_OPENLOCAL
Definition: resource.h:104
#define ID_VIEW_MENU
Definition: resource.h:25
#define MIIM_TYPE
Definition: winuser.h:720
#define FAVORITES_MENU_POSITION
Definition: framewnd.c:31
#define MB_ICONERROR
Definition: winuser.h:781
WCHAR szChildClass[MAX_LOADSTRING]
Definition: main.c:40
#define ID_REGISTRY_EXPORTREGISTRYFILE
Definition: resource.h:71
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
#define CDERR_MEMLOCKFAILURE
Definition: cderr.h:15
GLdouble s
Definition: gl.h:2039
DS_SELECTION aDsSelection[ANYSIZE_ARRAY]
Definition: objsel.h:146
void FindDialog(HWND hWnd)
Definition: find.c:813
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define WM_COMMAND
Definition: winuser.h:1716
#define PD_RESULT_APPLY
Definition: commdlg.h:203
void BuildFilterStrings(WCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
Definition: framewnd.c:249
#define DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE
Definition: objsel.h:130
#define IDS_FLT_ALLFILES_FLT
Definition: resource.h:171
#define IDS_IMPORT_ERROR
Definition: resource.h:197
#define BST_UNCHECKED
Definition: winuser.h:199
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define IDS_FLT_HIVFILES_FLT
Definition: resource.h:167
unsigned char BYTE
Definition: ntddk_ex.h:96
#define ID_EDIT_NEW_DWORDVALUE
Definition: resource.h:68
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:372
ULONG flOptions
Definition: objsel.h:113
HWND hwndOwner
Definition: commdlg.h:466
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3237
#define REG_FORCE_RESTORE
Definition: cmtypes.h:109
BOOL WINAPI MessageBeep(_In_ UINT)
static BOOL bInMenuLoop
Definition: framewnd.c:35
#define ID_EDIT_MODIFY
Definition: resource.h:64
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ID_EDIT_NEW_STRINGVALUE
Definition: resource.h:66
#define DSOP_SCOPE_TYPE_WORKGROUP
Definition: objsel.h:128
#define S_OK
Definition: intsafe.h:59
HINSTANCE hInst
Definition: dxdiag.c:13
BOOL PrintRegistryHive(HWND hWnd, LPWSTR path)
Definition: framewnd.c:696
HMENU hMenuFrame
Definition: main.c:32
#define WM_INITMENU
Definition: winuser.h:1721
static ATOM item
Definition: dde.c:856
#define IDS_FLT_REGEDIT4
Definition: resource.h:168
#define WM_ACTIVATE
Definition: winuser.h:1594
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2368
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1378
BOOL WINAPI DeleteDC(_In_ HDC)
LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: framewnd.c:1304
#define ID_VIEW_SPLIT
Definition: resource.h:57
LPSTR lpstrFile
Definition: commdlg.h:336
#define ID_REGISTRY_PRINT
Definition: resource.h:74
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN
Definition: objsel.h:122
#define FNERR_BUFFERTOOSMALL
Definition: cderr.h:37
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:1994
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define ID_REGISTRY_PRINTERSETUP
Definition: resource.h:112
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
Definition: framewnd.c:187
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define REG_FORMAT_4
Definition: regproc.h:25
Definition: services.c:325
#define IDS_IMPORT_OK
Definition: resource.h:196
#define IDS_FLT_REGFILES_FLT
Definition: resource.h:165
BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
Definition: edit.c:1456
#define IDS_ERR_DELETEVALUE
Definition: resource.h:139
ACCESS_MASK REGSAM
Definition: winreg.h:69
#define LOADHIVE_KEYNAMELENGTH
Definition: framewnd.c:295
LPCSTR lpstrFilter
Definition: commdlg.h:332
#define DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN
Definition: objsel.h:127
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:292
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define MB_OK
Definition: winuser.h:784
BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name, DWORD format)
Definition: regproc.c:1310
#define LVFINDINFO
Definition: commctrl.h:2433
#define IDS_APP_TITLE
Definition: resource.h:10
#define SB_SETPARTS
Definition: commctrl.h:1924
#define DSOP_FILTER_COMPUTERS
Definition: objsel.h:41
#define PD_RESULT_CANCEL
Definition: commdlg.h:201
#define BST_CHECKED
Definition: winuser.h:197
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:970
LPCWSTR getAppName(void)
Definition: regedit.c:61
#define ERROR_NOT_ALL_ASSIGNED
Definition: winerror.h:782
BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
Definition: treeview.c:571
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
DWORD lStructSize
Definition: commdlg.h:465
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
Definition: compobj.c:1900
HWND WINAPI GetFocus(void)
Definition: window.c:1860
unsigned long long DWORDLONG
Definition: intsafe.h:99
WORD nToPage
Definition: commdlg.h:472
WCHAR FileNameBuffer[_MAX_PATH]
Definition: framewnd.c:239
#define LVFI_STRING
Definition: commctrl.h:2407
LPCSTR lpstrTitle
Definition: commdlg.h:341
#define ListView_FindItem(hwnd, iStart, plvfi)
Definition: commctrl.h:2440
#define OUT
Definition: typedefs.h:39
#define WM_CREATE
Definition: winuser.h:1590
#define IDS_EXPORT_ERROR
Definition: resource.h:198
#define c
Definition: ke_i.h:80
BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
Definition: treeview.c:665
#define HIWORD(l)
Definition: typedefs.h:246
#define DSOP_DOWNLEVEL_FILTER_COMPUTERS
Definition: objsel.h:54
#define REG_QWORD
Definition: sdbapi.c:540
BOOL import_registry_file(FILE *reg_file)
Definition: regproc.c:1405
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3381
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define CDERR_MEMALLOCFAILURE
Definition: cderr.h:14
LONG bottom
Definition: windef.h:299
struct FILTERPAIR * PFILTERPAIR
BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName)
Definition: security.c:839
PRINTDLGA PRINTDLG
Definition: commdlg.h:660
DWORD Flags
Definition: commdlg.h:470
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define IDS_NEW_VALUE
Definition: resource.h:192
#define ERROR_ALREADY_EXISTS
Definition: disk.h:80
#define MF_GRAYED
Definition: winuser.h:129
#define CDERR_DIALOGFAILURE
Definition: cderr.h:4
DWORD nFilterIndex
Definition: commdlg.h:335
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDCANCEL
Definition: winuser.h:825
LONG_PTR LRESULT
Definition: windef.h:209
#define wsprintf
Definition: winuser.h:5731
#define E_POINTER
Definition: winerror.h:2365
#define OFN_ENABLESIZING
Definition: commdlg.h:101
BOOL RefreshTreeView(HWND hWndTV)
Definition: treeview.c:306
DWORD WINAPI CommDlgExtendedError(void)
Definition: cdlg32.c:139
#define WS_VISIBLE
Definition: pedump.c:620
static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME *pofn)
Definition: framewnd.c:264
#define ID_EDIT_MODIFY_BIN
Definition: resource.h:124
GLuint64EXT * result
Definition: glext.h:11304
#define memset(x, y, z)
Definition: compat.h:39
#define REG_DWORD
Definition: sdbapi.c:539
HMENU WINAPI GetMenu(_In_ HWND)
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:876
HDC hDC
Definition: commdlg.h:469
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
static BOOL CreateNewValue(HKEY hRootKey, LPCWSTR pszKeyPath, DWORD dwType)
Definition: framewnd.c:825
#define LOWORD(l)
Definition: pedump.c:82
HANDLE hDevMode
Definition: commdlg.h:467
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define GMEM_MOVEABLE
Definition: winbase.h:291
PWSTR pwzName
Definition: objsel.h:134
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define WM_NOTIFY
Definition: richedit.h:61
#define ID_EDIT_NEW_MULTISTRINGVALUE
Definition: resource.h:148
#define ListView_EditLabel(hwndLV, i)
Definition: commctrl.h:2510
#define IDS_QUERY_DELETE_CONFIRM
Definition: resource.h:137
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define LPARAM
Definition: msvc.h:38
LONG WINAPI RegLoadKeyW(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile)
Definition: reg.c:3116
#define FNERR_INVALIDFILENAME
Definition: cderr.h:36
DWORD nMaxFileTitle
Definition: commdlg.h:339
#define DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE
Definition: objsel.h:129
DWORD Flags
Definition: commdlg.h:342
#define IDS_FLT_REGFILES
Definition: resource.h:164
#define REG_SZ
Definition: layer.c:22
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey)
Definition: edit.c:1588