ReactOS 0.4.15-dev-5895-g2687c1b
find.c
Go to the documentation of this file.
1/*
2 * Regedit find dialog
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "regedit.h"
20
21#define RSF_WHOLESTRING 0x00000001
22#define RSF_LOOKATKEYS 0x00000002
23#define RSF_LOOKATVALUES 0x00000004
24#define RSF_LOOKATDATA 0x00000008
25#define RSF_MATCHCASE 0x00010000
26
27static WCHAR s_szFindWhat[256];
28static const WCHAR s_szFindFlags[] = L"FindFlags";
29static const WCHAR s_szFindFlagsR[] = L"FindFlagsReactOS";
32
36static const WCHAR s_empty[] = L"";
37static const WCHAR s_backslash[] = L"\\";
38
39extern VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName);
40
42{
43 MSG msg;
44 if (PeekMessageW(&msg, NULL, 0, 0, PM_REMOVE))
45 {
46 if (msg.message == WM_QUIT)
47 s_bAbort = TRUE;
49 {
52 }
53 }
54 return s_bAbort;
55}
56
57static LPWSTR lstrstri(LPCWSTR psz1, LPCWSTR psz2)
58{
59 INT i, cch1, cch2;
60
61 cch1 = wcslen(psz1);
62 cch2 = wcslen(psz2);
63 for(i = 0; i <= cch1 - cch2; i++)
64 {
66 psz1 + i, cch2, psz2, cch2) == 2)
67 return (LPWSTR) (psz1 + i);
68 }
69 return NULL;
70}
71
72static BOOL CompareName(LPCWSTR pszName1, LPCWSTR pszName2)
73{
75 {
77 return wcscmp(pszName1, pszName2) == 0;
78 else
79 return _wcsicmp(pszName1, pszName2) == 0;
80 }
81 else
82 {
84 return wcsstr(pszName1, pszName2) != NULL;
85 else
86 return lstrstri(pszName1, pszName2) != NULL;
87 }
88}
89
90static BOOL
92 DWORD dwType,
93 LPCWSTR psz1,
94 LPCWSTR psz2)
95{
96 INT i, cch1 = wcslen(psz1), cch2 = wcslen(psz2);
97 if (dwType == REG_SZ || dwType == REG_EXPAND_SZ)
98 {
100 {
103 psz1, cch1, psz2, cch2);
104 else
106 NORM_IGNORECASE, psz1, cch1, psz2, cch2);
107 }
108
109 for(i = 0; i <= cch1 - cch2; i++)
110 {
112 {
114 psz1 + i, cch2, psz2, cch2))
115 return TRUE;
116 }
117 else
118 {
120 NORM_IGNORECASE, psz1 + i, cch2, psz2, cch2))
121 return TRUE;
122 }
123 }
124 }
125 return FALSE;
126}
127
128int compare(const void *x, const void *y)
129{
130 const LPCWSTR *a = (const LPCWSTR *)x;
131 const LPCWSTR *b = (const LPCWSTR *)y;
132 return _wcsicmp(*a, *b);
133}
134
136 HKEY hKey,
137 LPCWSTR pszSubKey,
138 LPCWSTR pszValueName,
139 LPWSTR *ppszFoundSubKey,
140 LPWSTR *ppszFoundValueName)
141{
142 HKEY hSubKey;
143 LONG lResult;
144 WCHAR szSubKey[MAX_PATH];
145 DWORD i, c, cb, type;
146 BOOL fPast = FALSE;
147 LPWSTR *ppszNames = NULL;
148 LPBYTE pb = NULL;
149
150 if (DoEvents())
151 return FALSE;
152
153 if(wcslen(pszSubKey) >= _countof(szSubKey))
154 return FALSE;
155
156 wcscpy(szSubKey, pszSubKey);
157 hSubKey = NULL;
158
159 lResult = RegOpenKeyExW(hKey, szSubKey, 0, KEY_ALL_ACCESS, &hSubKey);
160 if (lResult != ERROR_SUCCESS)
161 return FALSE;
162
163 lResult = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, NULL, NULL, NULL,
164 &c, NULL, NULL, NULL, NULL);
165 if (lResult != ERROR_SUCCESS)
166 goto err;
167 ppszNames = (LPWSTR *) malloc(c * sizeof(LPWSTR));
168 if (ppszNames == NULL)
169 goto err;
170 ZeroMemory(ppszNames, c * sizeof(LPWSTR));
171
172 for(i = 0; i < c; i++)
173 {
174 if (DoEvents())
175 goto err;
176
178 lResult = RegEnumValueW(hSubKey, i, s_szName, &s_cchName, NULL, NULL,
179 NULL, &cb);
180 if (lResult == ERROR_NO_MORE_ITEMS)
181 {
182 c = i;
183 break;
184 }
185 if (lResult != ERROR_SUCCESS)
186 goto err;
188 continue;
189
190 ppszNames[i] = _wcsdup(s_szName);
191 }
192
193 qsort(ppszNames, c, sizeof(LPWSTR), compare);
194
195 if (pszValueName == NULL)
196 pszValueName = ppszNames[0];
197
198 for(i = 0; i < c; i++)
199 {
200 if (DoEvents())
201 goto err;
202
203 if (!fPast && _wcsicmp(ppszNames[i], pszValueName) == 0)
204 {
205 fPast = TRUE;
206 continue;
207 }
208 if (!fPast)
209 continue;
210
211 if ((s_dwFlags & RSF_LOOKATVALUES) &&
212 CompareName(ppszNames[i], s_szFindWhat))
213 {
214 *ppszFoundSubKey = _wcsdup(szSubKey);
215 if (ppszNames[i][0] == 0)
216 *ppszFoundValueName = NULL;
217 else
218 *ppszFoundValueName = _wcsdup(ppszNames[i]);
219 goto success;
220 }
221
222 lResult = RegQueryValueExW(hSubKey, ppszNames[i], NULL, &type,
223 NULL, &cb);
224 if (lResult != ERROR_SUCCESS)
225 goto err;
226 pb = malloc(cb + 3); /* To avoid buffer overrun, append 3 NULs */
227 if (pb == NULL)
228 goto err;
229 lResult = RegQueryValueExW(hSubKey, ppszNames[i], NULL, &type,
230 pb, &cb);
231 if (lResult != ERROR_SUCCESS)
232 goto err;
233
234 /* To avoid buffer overrun, append 3 NUL bytes.
235 NOTE: cb can be an odd number although UNICODE_NULL is two bytes.
236 Two bytes at odd position is not enough to avoid buffer overrun. */
237 pb[cb] = pb[cb + 1] = pb[cb + 2] = 0;
238
239 if ((s_dwFlags & RSF_LOOKATDATA) &&
241 {
242 *ppszFoundSubKey = _wcsdup(szSubKey);
243 if (ppszNames[i][0] == 0)
244 *ppszFoundValueName = NULL;
245 else
246 *ppszFoundValueName = _wcsdup(ppszNames[i]);
247 goto success;
248 }
249 free(pb);
250 pb = NULL;
251 }
252
253 if (ppszNames != NULL)
254 {
255 for(i = 0; i < c; i++)
256 free(ppszNames[i]);
257 free(ppszNames);
258 }
259 ppszNames = NULL;
260
261 lResult = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
262 NULL, NULL, NULL, NULL, NULL);
263 if (lResult != ERROR_SUCCESS)
264 goto err;
265 ppszNames = (LPWSTR *) malloc(c * sizeof(LPWSTR));
266 if (ppszNames == NULL)
267 goto err;
268 ZeroMemory(ppszNames, c * sizeof(LPWSTR));
269
270 for(i = 0; i < c; i++)
271 {
272 if (DoEvents())
273 goto err;
274
276 lResult = RegEnumKeyExW(hSubKey, i, s_szName, &s_cchName, NULL, NULL,
277 NULL, NULL);
278 if (lResult == ERROR_NO_MORE_ITEMS)
279 {
280 c = i;
281 break;
282 }
283 if (lResult != ERROR_SUCCESS)
284 goto err;
286 continue;
287
288 ppszNames[i] = _wcsdup(s_szName);
289 }
290
291 qsort(ppszNames, c, sizeof(LPWSTR), compare);
292
293 for(i = 0; i < c; i++)
294 {
295 if (DoEvents())
296 goto err;
297
298 if ((s_dwFlags & RSF_LOOKATKEYS) &&
299 CompareName(ppszNames[i], s_szFindWhat))
300 {
301 *ppszFoundSubKey = malloc(
302 (wcslen(szSubKey) + wcslen(ppszNames[i]) + 2) *
303 sizeof(WCHAR));
304 if (*ppszFoundSubKey == NULL)
305 goto err;
306 if (szSubKey[0])
307 {
308 wcscpy(*ppszFoundSubKey, szSubKey);
309 wcscat(*ppszFoundSubKey, s_backslash);
310 }
311 else
312 **ppszFoundSubKey = 0;
313 wcscat(*ppszFoundSubKey, ppszNames[i]);
314 *ppszFoundValueName = NULL;
315 goto success;
316 }
317
318 if (RegFindRecurse(hSubKey, ppszNames[i], NULL, ppszFoundSubKey,
319 ppszFoundValueName))
320 {
321 LPWSTR psz = *ppszFoundSubKey;
322 *ppszFoundSubKey = malloc(
323 (wcslen(szSubKey) + wcslen(psz) + 2) * sizeof(WCHAR));
324 if (*ppszFoundSubKey == NULL)
325 goto err;
326 if (szSubKey[0])
327 {
328 wcscpy(*ppszFoundSubKey, szSubKey);
329 wcscat(*ppszFoundSubKey, s_backslash);
330 }
331 else
332 **ppszFoundSubKey = 0;
333 wcscat(*ppszFoundSubKey, psz);
334 free(psz);
335 goto success;
336 }
337 }
338
339err:
340 if (ppszNames != NULL)
341 {
342 for(i = 0; i < c; i++)
343 free(ppszNames[i]);
344 free(ppszNames);
345 }
346 free(pb);
347 RegCloseKey(hSubKey);
348 return FALSE;
349
350success:
351 if (ppszNames != NULL)
352 {
353 for(i = 0; i < c; i++)
354 free(ppszNames[i]);
355 free(ppszNames);
356 }
357 RegCloseKey(hSubKey);
358 return TRUE;
359}
360
362 HKEY * phKey,
363 LPCWSTR pszSubKey,
364 LPCWSTR pszValueName,
365 LPWSTR *ppszFoundSubKey,
366 LPWSTR *ppszFoundValueName)
367{
368 LONG lResult;
369 DWORD i, c;
370 HKEY hBaseKey, hSubKey;
371 WCHAR szKeyName[MAX_PATH];
372 WCHAR szSubKey[MAX_PATH];
373 LPWSTR pch;
374 BOOL fPast;
375 LPWSTR *ppszNames = NULL;
376
377 hBaseKey = *phKey;
378
379 if (wcslen(pszSubKey) >= _countof(szSubKey))
380 return FALSE;
381
382 if (RegFindRecurse(hBaseKey, pszSubKey, pszValueName, ppszFoundSubKey,
383 ppszFoundValueName))
384 return TRUE;
385
386 wcscpy(szSubKey, pszSubKey);
387 while(szSubKey[0] != 0)
388 {
389 if (DoEvents())
390 return FALSE;
391
392 pch = wcsrchr(szSubKey, L'\\');
393 if (pch == NULL)
394 {
395 wcscpy(szKeyName, szSubKey);
396 szSubKey[0] = 0;
397 hSubKey = hBaseKey;
398 }
399 else
400 {
401 lstrcpynW(szKeyName, pch + 1, MAX_PATH);
402 *pch = 0;
403 lResult = RegOpenKeyExW(hBaseKey, szSubKey, 0, KEY_ALL_ACCESS,
404 &hSubKey);
405 if (lResult != ERROR_SUCCESS)
406 return FALSE;
407 }
408
409 lResult = RegQueryInfoKeyW(hSubKey, NULL, NULL, NULL, &c, NULL, NULL,
410 NULL, NULL, NULL, NULL, NULL);
411 if (lResult != ERROR_SUCCESS)
412 goto err;
413
414 ppszNames = (LPWSTR *) malloc(c * sizeof(LPWSTR));
415 if (ppszNames == NULL)
416 goto err;
417 ZeroMemory(ppszNames, c * sizeof(LPWSTR));
418
419 for(i = 0; i < c; i++)
420 {
421 if (DoEvents())
422 goto err;
423
425 lResult = RegEnumKeyExW(hSubKey, i, s_szName, &s_cchName,
426 NULL, NULL, NULL, NULL);
427 if (lResult == ERROR_NO_MORE_ITEMS)
428 {
429 c = i;
430 break;
431 }
432 if (lResult != ERROR_SUCCESS)
433 break;
434 ppszNames[i] = _wcsdup(s_szName);
435 }
436
437 qsort(ppszNames, c, sizeof(LPWSTR), compare);
438
439 fPast = FALSE;
440 for(i = 0; i < c; i++)
441 {
442 if (DoEvents())
443 goto err;
444
445 if (!fPast && _wcsicmp(ppszNames[i], szKeyName) == 0)
446 {
447 fPast = TRUE;
448 continue;
449 }
450 if (!fPast)
451 continue;
452
453 if ((s_dwFlags & RSF_LOOKATKEYS) &&
454 CompareName(ppszNames[i], s_szFindWhat))
455 {
456 *ppszFoundSubKey = malloc(
457 (wcslen(szSubKey) + wcslen(ppszNames[i]) + 2) *
458 sizeof(WCHAR));
459 if (*ppszFoundSubKey == NULL)
460 goto err;
461 if (szSubKey[0])
462 {
463 wcscpy(*ppszFoundSubKey, szSubKey);
464 wcscat(*ppszFoundSubKey, s_backslash);
465 }
466 else
467 **ppszFoundSubKey = 0;
468 wcscat(*ppszFoundSubKey, ppszNames[i]);
469 *ppszFoundValueName = NULL;
470 goto success;
471 }
472
473 if (RegFindRecurse(hSubKey, ppszNames[i], NULL,
474 ppszFoundSubKey, ppszFoundValueName))
475 {
476 LPWSTR psz = *ppszFoundSubKey;
477 *ppszFoundSubKey = malloc(
478 (wcslen(szSubKey) + wcslen(psz) + 2) *
479 sizeof(WCHAR));
480 if (*ppszFoundSubKey == NULL)
481 goto err;
482 if (szSubKey[0])
483 {
484 wcscpy(*ppszFoundSubKey, szSubKey);
485 wcscat(*ppszFoundSubKey, s_backslash);
486 }
487 else
488 **ppszFoundSubKey = 0;
489 wcscat(*ppszFoundSubKey, psz);
490 free(psz);
491 goto success;
492 }
493 }
494 if (ppszNames != NULL)
495 {
496 for(i = 0; i < c; i++)
497 free(ppszNames[i]);
498 free(ppszNames);
499 }
500 ppszNames = NULL;
501
502 if (hBaseKey != hSubKey)
503 RegCloseKey(hSubKey);
504 }
505
506 if (*phKey == HKEY_CLASSES_ROOT)
507 {
508 *phKey = HKEY_CURRENT_USER;
509 if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
510 ppszFoundValueName))
511 return TRUE;
512 }
513
514 if (*phKey == HKEY_CURRENT_USER)
515 {
516 *phKey = HKEY_LOCAL_MACHINE;
517 if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
518 ppszFoundValueName))
519 goto success;
520 }
521
522 if (*phKey == HKEY_LOCAL_MACHINE)
523 {
524 *phKey = HKEY_USERS;
525 if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
526 ppszFoundValueName))
527 goto success;
528 }
529
530 if (*phKey == HKEY_USERS)
531 {
532 *phKey = HKEY_CURRENT_CONFIG;
533 if (RegFindRecurse(*phKey, s_empty, NULL, ppszFoundSubKey,
534 ppszFoundValueName))
535 goto success;
536 }
537
538err:
539 if (ppszNames != NULL)
540 {
541 for(i = 0; i < c; i++)
542 free(ppszNames[i]);
543 free(ppszNames);
544 }
545 if (hBaseKey != hSubKey)
546 RegCloseKey(hSubKey);
547 return FALSE;
548
549success:
550 if (ppszNames != NULL)
551 {
552 for(i = 0; i < c; i++)
553 free(ppszNames[i]);
554 free(ppszNames);
555 }
556 if (hBaseKey != hSubKey)
557 RegCloseKey(hSubKey);
558 return TRUE;
559}
560
561
562static DWORD GetFindFlags(void)
563{
564 HKEY hKey;
565 DWORD dwType, dwValue, cbData;
567
569 {
570 /* Retrieve flags from registry key */
571 cbData = sizeof(dwValue);
572 if (RegQueryValueExW(hKey, s_szFindFlags, NULL, &dwType, (LPBYTE) &dwValue, &cbData) == ERROR_SUCCESS)
573 {
574 if (dwType == REG_DWORD)
575 dwFlags = (dwFlags & ~0x0000FFFF) | ((dwValue & 0x0000FFFF) << 0);
576 }
577
578 /* Retrieve ReactOS Regedit specific flags from registry key */
579 cbData = sizeof(dwValue);
580 if (RegQueryValueExW(hKey, s_szFindFlagsR, NULL, &dwType, (LPBYTE) &dwValue, &cbData) == ERROR_SUCCESS)
581 {
582 if (dwType == REG_DWORD)
583 dwFlags = (dwFlags & ~0xFFFF0000) | ((dwValue & 0x0000FFFF) << 16);
584 }
585
587 }
588 return dwFlags;
589}
590
592{
593 HKEY hKey;
594 DWORD dwDisposition;
596
598 {
599 dwData = (dwFlags >> 0) & 0x0000FFFF;
600 RegSetValueExW(hKey, s_szFindFlags, 0, REG_DWORD, (const BYTE *) &dwData, sizeof(dwData));
601
602 dwData = (dwFlags >> 16) & 0x0000FFFF;
603 RegSetValueExW(hKey, s_szFindFlagsR, 0, REG_DWORD, (const BYTE *) &dwData, sizeof(dwData));
604
606 }
607}
608
610{
613
614 switch(uMsg)
615 {
616 case WM_CLOSE:
617 s_bAbort = TRUE;
618 break;
619
620 case WM_COMMAND:
621 switch(HIWORD(wParam))
622 {
623 case BN_CLICKED:
624 switch(LOWORD(wParam))
625 {
626 case IDCANCEL:
627 s_bAbort = TRUE;
628 break;
629 }
630 break;
631 }
632 break;
633 }
634 return 0;
635}
636
638{
639 HKEY hKeyRoot;
640 LPCWSTR pszKeyPath;
641 BOOL fSuccess;
642 WCHAR szFullKey[512];
643 LPCWSTR pszValueName;
644 LPWSTR pszFoundSubKey, pszFoundValueName;
645
646 if (wcslen(s_szFindWhat) == 0)
647 {
649 return TRUE;
650 }
651
653
654 pszKeyPath = GetItemPath(g_pChildWnd->hTreeWnd, 0, &hKeyRoot);
655 if (pszKeyPath == NULL)
656 {
657 hKeyRoot = HKEY_CLASSES_ROOT;
658 pszKeyPath = s_empty;
659 }
660
661 /* Create abort find dialog */
665 {
668 }
669 s_bAbort = FALSE;
670
671 pszValueName = GetValueName(g_pChildWnd->hListWnd, -1);
672
677
678 fSuccess = RegFindWalk(&hKeyRoot, pszKeyPath, pszValueName,
679 &pszFoundSubKey, &pszFoundValueName);
680
685
687 {
690 }
691
692 if (fSuccess)
693 {
694 GetKeyName(szFullKey, ARRAY_SIZE(szFullKey), hKeyRoot, pszFoundSubKey);
695 SelectNode(g_pChildWnd->hTreeWnd, szFullKey);
696 free(pszFoundSubKey);
697
698 if (pszFoundValueName != NULL)
699 {
700 SetValueName(g_pChildWnd->hListWnd, pszFoundValueName);
701 free(pszFoundValueName);
703 }
704 else
705 {
707 }
708 }
709 return fSuccess || s_bAbort;
710}
711
713{
714 INT_PTR iResult = 0;
715 HWND hControl;
716 LONG lStyle;
718 static WCHAR s_szSavedFindValue[256];
719
720 switch(uMsg)
721 {
722 case WM_INITDIALOG:
724
725 hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
726 if (hControl)
728
729 hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
730 if (hControl)
732
733 hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
734 if (hControl)
736
737 /* Match whole string */
738 hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
739 if (hControl)
741
742 /* Case sensitivity */
743 hControl = GetDlgItem(hDlg, IDC_MATCHCASE);
744 if (hControl)
746
747 hControl = GetDlgItem(hDlg, IDC_FINDWHAT);
748 if (hControl)
749 {
750 SetWindowTextW(hControl, s_szSavedFindValue);
751 SetFocus(hControl);
752 SendMessageW(hControl, EM_SETSEL, 0, -1);
753 }
754 break;
755
756 case WM_CLOSE:
757 EndDialog(hDlg, 0);
758 break;
759
760 case WM_COMMAND:
761 switch(HIWORD(wParam))
762 {
763 case BN_CLICKED:
764 switch(LOWORD(wParam))
765 {
766 case IDOK:
767 dwFlags = 0;
768
769 hControl = GetDlgItem(hDlg, IDC_LOOKAT_KEYS);
770 if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
772
773 hControl = GetDlgItem(hDlg, IDC_LOOKAT_VALUES);
774 if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
776
777 hControl = GetDlgItem(hDlg, IDC_LOOKAT_DATA);
778 if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
780
781 hControl = GetDlgItem(hDlg, IDC_MATCHSTRING);
782 if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
784
785 hControl = GetDlgItem(hDlg, IDC_MATCHCASE);
786 if (hControl && (SendMessageW(hControl, BM_GETCHECK, 0, 0) == BST_CHECKED))
788
790
791 hControl = GetDlgItem(hDlg, IDC_FINDWHAT);
792 if (hControl)
794 EndDialog(hDlg, 1);
795 break;
796
797 case IDCANCEL:
798 EndDialog(hDlg, 0);
799 break;
800 }
801 break;
802
803 case EN_CHANGE:
804 switch(LOWORD(wParam))
805 {
806 case IDC_FINDWHAT:
807 GetWindowTextW((HWND) lParam, s_szSavedFindValue, ARRAY_SIZE(s_szSavedFindValue));
808 hControl = GetDlgItem(hDlg, IDOK);
809 if (hControl)
810 {
811 lStyle = GetWindowLongPtr(hControl, GWL_STYLE);
812 if (s_szSavedFindValue[0])
813 lStyle &= ~WS_DISABLED;
814 else
815 lStyle |= WS_DISABLED;
816 SetWindowLongPtr(hControl, GWL_STYLE, lStyle);
818 }
819 break;
820 }
821 }
822 break;
823 }
824 return iResult;
825}
826
828{
829 if (!FindNext(hWnd))
830 {
831 WCHAR msg[128], caption[128];
832
834 LoadStringW(hInst, IDS_APP_TITLE, caption, ARRAY_SIZE(caption));
836 }
837}
838
840{
842 hWnd, FindDialogProc, 0) != 0)
843 {
845 }
846}
#define compare
#define msg(x)
Definition: auth_time.c:54
const TCHAR g_szGeneralRegKey[]
Definition: settings.c:16
HWND hWnd
Definition: settings.c:17
#define IDS_APP_TITLE
Definition: resource.h:10
ChildWnd * g_pChildWnd
Definition: childwnd.c:23
BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey)
Definition: edit.c:1588
BOOL RegFindRecurse(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValueName, LPWSTR *ppszFoundSubKey, LPWSTR *ppszFoundValueName)
Definition: find.c:135
static WCHAR s_szName[MAX_PATH]
Definition: find.c:34
static BOOL CompareName(LPCWSTR pszName1, LPCWSTR pszName2)
Definition: find.c:72
void FindNextMessageBox(HWND hWnd)
Definition: find.c:827
VOID SetValueName(HWND hwndLV, LPCWSTR pszValueName)
Definition: listview.c:84
#define RSF_MATCHCASE
Definition: find.c:25
BOOL RegFindWalk(HKEY *phKey, LPCWSTR pszSubKey, LPCWSTR pszValueName, LPWSTR *ppszFoundSubKey, LPWSTR *ppszFoundValueName)
Definition: find.c:361
static BOOL s_bAbort
Definition: find.c:31
static INT_PTR CALLBACK FindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: find.c:712
static DWORD s_cchName
Definition: find.c:35
#define RSF_WHOLESTRING
Definition: find.c:21
static void SetFindFlags(DWORD dwFlags)
Definition: find.c:591
#define RSF_LOOKATVALUES
Definition: find.c:23
static BOOL CompareData(DWORD dwType, LPCWSTR psz1, LPCWSTR psz2)
Definition: find.c:91
static HWND s_hwndAbortDialog
Definition: find.c:30
#define RSF_LOOKATDATA
Definition: find.c:24
static const WCHAR s_szFindFlagsR[]
Definition: find.c:29
static const WCHAR s_empty[]
Definition: find.c:36
static INT_PTR CALLBACK AbortFindDialogProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: find.c:609
void FindDialog(HWND hWnd)
Definition: find.c:839
static LPWSTR lstrstri(LPCWSTR psz1, LPCWSTR psz2)
Definition: find.c:57
static DWORD GetFindFlags(void)
Definition: find.c:562
BOOL FindNext(HWND hWnd)
Definition: find.c:637
static WCHAR s_szFindWhat[256]
Definition: find.c:27
static const WCHAR s_szFindFlags[]
Definition: find.c:28
static DWORD s_dwFlags
Definition: find.c:33
BOOL DoEvents(VOID)
Definition: find.c:41
static const WCHAR s_backslash[]
Definition: find.c:37
#define RSF_LOOKATKEYS
Definition: find.c:22
WCHAR * GetValueName(HWND hwndLV, int iStartAt)
Definition: listview.c:55
HWND hFrameWnd
Definition: main.c:35
BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
Definition: treeview.c:773
#define ARRAY_SIZE(A)
Definition: main.h:33
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
Definition: treeview.c:88
#define IDC_LOOKAT_DATA
Definition: resource.h:270
#define IDS_FINISHEDFIND
Definition: resource.h:199
#define IDD_FINDING
Definition: resource.h:49
#define IDC_LOOKAT_VALUES
Definition: resource.h:269
#define IDC_FINDWHAT
Definition: resource.h:267
#define IDD_FIND
Definition: resource.h:48
#define IDC_MATCHSTRING
Definition: resource.h:271
#define IDC_LOOKAT_KEYS
Definition: resource.h:268
#define IDC_MATCHCASE
Definition: resource.h:272
#define RegCloseKey(hKey)
Definition: registry.h:47
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define ERROR_SUCCESS
Definition: deptool.c:10
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1091
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3356
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
Definition: reg.c:3291
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4900
LONG WINAPI 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:2853
LONG WINAPI RegQueryInfoKeyW(HKEY hKey, LPWSTR lpClass, LPDWORD lpcClass, LPDWORD lpReserved, LPDWORD lpcSubKeys, LPDWORD lpcMaxSubKeyLen, LPDWORD lpcMaxClassLen, LPDWORD lpcValues, LPDWORD lpcMaxValueNameLen, LPDWORD lpcMaxValueLen, LPDWORD lpcbSecurityDescriptor, PFILETIME lpftLastWriteTime)
Definition: reg.c:3690
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4121
#define wcsrchr
Definition: compat.h:16
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:105
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define lstrcpynW
Definition: compat.h:738
HINSTANCE hInst
Definition: dxdiag.c:13
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxAutoRegKey hKey
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
const GLubyte * c
Definition: glext.h:8905
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define c
Definition: ke_i.h:80
INT WINAPI CompareStringW(LCID lcid, DWORD flags, LPCWSTR str1, INT len1, LPCWSTR str2, INT len2)
Definition: lang.c:2314
#define REG_SZ
Definition: layer.c:22
#define pch(ap)
Definition: match.c:418
static HANDLE ULONG_PTR dwData
Definition: file.c:35
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
unsigned int UINT
Definition: ndis.h:50
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
#define REG_EXPAND_SZ
Definition: nt_native.h:1494
#define LOCALE_SYSTEM_DEFAULT
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define L(x)
Definition: ntvdm.h:50
#define LOWORD(l)
Definition: pedump.c:82
long LONG
Definition: pedump.c:60
#define WS_DISABLED
Definition: pedump.c:621
#define err(...)
#define REG_DWORD
Definition: sdbapi.c:596
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_Check_return_ _CRTIMP wchar_t *__cdecl _wcsdup(_In_z_ const wchar_t *_Str)
_CRTIMP wchar_t *__cdecl wcscat(_Inout_updates_z_(_String_length_(_Dest)+_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
void __cdecl qsort(_Inout_updates_bytes_(_NumOfElements *_SizeOfElements) void *_Base, _In_ size_t _NumOfElements, _In_ size_t _SizeOfElements, _In_ int(__cdecl *_PtFuncCompare)(const void *, const void *))
#define _countof(array)
Definition: sndvol32.h:68
HWND hTreeWnd
Definition: main.h:63
HWND hListWnd
Definition: main.h:64
HWND hAddressBarWnd
Definition: main.h:65
Definition: bug.cpp:8
#define GetWindowLongPtr
Definition: treelist.c:73
#define SetWindowLongPtr
Definition: treelist.c:70
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
int32_t INT_PTR
Definition: typedefs.h:64
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
#define HIWORD(l)
Definition: typedefs.h:247
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
Definition: window.c:1412
#define success(from, fromstr, to, tostr)
#define ZeroMemory
Definition: winbase.h:1670
#define GetModuleHandle
Definition: winbase.h:3698
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
LONG_PTR LPARAM
Definition: windef.h:208
UINT_PTR WPARAM
Definition: windef.h:207
#define NORM_IGNORECASE
Definition: winnls.h:176
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define HKEY_CURRENT_CONFIG
Definition: winreg.h:15
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
#define HKEY_USERS
Definition: winreg.h:13
#define WM_CLOSE
Definition: winuser.h:1611
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define WM_QUIT
Definition: winuser.h:1613
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)
#define IDCANCEL
Definition: winuser.h:825
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define WM_COMMAND
Definition: winuser.h:1730
#define WM_INITDIALOG
Definition: winuser.h:1729
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define IDOK
Definition: winuser.h:824
#define BM_SETCHECK
Definition: winuser.h:1911
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI PeekMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT, _In_ UINT)
#define PM_REMOVE
Definition: winuser.h:1186
BOOL WINAPI UpdateWindow(_In_ HWND)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define EM_SETSEL
Definition: winuser.h:2008
#define CreateDialogW(h, n, w, f)
Definition: winuser.h:4271
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define MB_ICONINFORMATION
Definition: winuser.h:796
#define BN_CLICKED
Definition: winuser.h:1915
#define SW_SHOW
Definition: winuser.h:769
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GWL_STYLE
Definition: winuser.h:846
BOOL WINAPI DestroyWindow(_In_ HWND)
#define RDW_INVALIDATE
Definition: winuser.h:1204
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define BM_GETCHECK
Definition: winuser.h:1908
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define EN_CHANGE
Definition: winuser.h:2012
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
unsigned char BYTE
Definition: xxhash.c:193