31 #define FAVORITES_MENU_POSITION 3 75 DWORD dwIndex, cbValueName, cbValueData, dwType;
76 WCHAR szValueName[256];
77 BYTE abValueData[256];
78 static int s_nFavoriteMenuSubPos = -1;
86 if (s_nFavoriteMenuSubPos < 0)
102 cbValueName =
COUNT_OF(szValueName);
103 cbValueData =
sizeof(abValueData);
104 lResult =
RegEnumValueW(hKey, dwIndex, szValueName, &cbValueName,
NULL, &dwType, abValueData, &cbValueData);
110 bDisplayedAny =
TRUE;
152 if (nItemID == 2) nItemID = 5;
254 for(
i = 0;
i < PairCount;
i++)
295 #define LOADHIVE_KEYNAMELENGTH 128 332 tp.PrivilegeCount = 1;
337 &
tp.Privileges[0].Luid))
413 LONG regUnloadResult;
535 HWND hwndExportBranch;
536 HWND hwndExportBranchText;
555 if (hwndExportBranch)
559 if (hwndExportBranchText)
571 if (hwndExportBranch && hwndExportBranchText
578 pszSelectedKey[0] =
L'\0';
722 hResult = PrintDlgEx(&pd);
725 switch (pd.dwResultAction)
771 WCHAR szFavoritePath[512];
772 DWORD cbData, dwType;
777 cbData =
sizeof(szFavoritePath);
778 memset(szFavoritePath, 0,
sizeof(szFavoritePath));
800 bClipboardOpened =
TRUE;
820 if (bClipboardOpened)
827 WCHAR szNewValueFormat[128];
828 WCHAR szNewValue[128];
831 DWORD dwExistingType, cbData;
844 wsprintf(szNewValue, szNewValueFormat, iIndex++);
845 cbData =
sizeof(
data);
853 cbData =
sizeof(
DWORD);
857 cbData =
sizeof(
WCHAR);
869 cbData =
sizeof(
WCHAR);
889 memset(&lvfi, 0,
sizeof(lvfi));
891 lvfi.psz = szNewValue;
904 *pDsObjectPicker =
NULL;
908 CLSCTX_INPROC_SERVER,
909 &IID_IDsObjectPicker,
910 (
LPVOID*)pDsObjectPicker);
937 InitInfo.
cbSize =
sizeof(InitInfo);
945 hRet = (*pDsObjectPicker)->lpVtbl->Initialize(*pDsObjectPicker,
951 (*pDsObjectPicker)->lpVtbl->Release(*pDsObjectPicker);
967 hRet = pDsObjectPicker->lpVtbl->InvokeDialog(pDsObjectPicker,
977 fe.dwAspect = DVASPECT_CONTENT;
979 fe.tymed = TYMED_HGLOBAL;
981 hRet = pdo->lpVtbl->
GetData(pdo,
987 if (SelectionList !=
NULL)
989 if (SelectionList->
cItems == 1)
999 nlen *
sizeof(
WCHAR));
1019 pDsObjectPicker->lpVtbl->
Release(pDsObjectPicker);
1031 HKEY hKeyRoot = 0, hKey = 0;
1057 IDsObjectPicker *ObjectPicker;
1265 WCHAR szFavorite[512];
1269 memset(&mii, 0,
sizeof(mii));
1270 mii.
cbSize =
sizeof(mii);
#define ID_REGISTRY_IMPORTREGISTRYFILE
#define ListView_GetNextItem(hwnd, i, flags)
#define DSOP_SCOPE_TYPE_GLOBAL_CATALOG
#define WM_SYSCOLORCHANGE
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
void SetupStatusBar(HWND hWnd, BOOL bResize)
static void resize_frame_rect(HWND hWnd, PRECT prect)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
WCHAR FileTitleBuffer[_MAX_PATH]
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
int ErrorMessageBox(HWND hWnd, LPCWSTR lpTitle, DWORD dwErrorCode,...)
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
INT_PTR WINAPI DialogBoxParamW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_opt_ HWND, _In_opt_ DLGPROC, _In_ LPARAM)
#define ID_REGISTRY_LOADHIVE
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
BOOL ExportRegistryFile(HWND hWnd)
#define CDERR_LOADRESFAILURE
#define ID_EDIT_COPYKEYNAME
static void OnExitMenuLoop(HWND hWnd)
void ShowAboutBox(HWND hWnd)
void WINAPI ReleaseStgMedium(STGMEDIUM *pmedium)
struct _DS_SELECTION_LIST * PDS_SELECTION_LIST
_Check_return_ _CRTIMP FILE *__cdecl _wfopen(_In_z_ const wchar_t *_Filename, _In_z_ const wchar_t *_Mode)
#define ID_EDIT_NEW_EXPANDABLESTRINGVALUE
static void resize_frame_client(HWND hWnd)
#define UNREFERENCED_PARAMETER(P)
UINT WINAPI RegisterClipboardFormatW(_In_ LPCWSTR)
static struct netconfig_info ni
#define TreeView_EditLabel(hwnd, hitem)
#define HKEY_CURRENT_USER
static WCHAR s_szFavoritesRegKey[]
#define CDERR_NOHINSTANCE
#define IDS_QUERY_IMPORT_HIVE_MSG
static void OnMenuSelect(HWND hWnd, UINT nItemID, UINT nFlags, HMENU hSysMenu)
#define IDS_QUERY_IMPORT_HIVE_CAPTION
HRESULT GetData([in, unique] FORMATETC *pformatetcIn, [out] STGMEDIUM *pmedium)
DWORD WINAPI GetLastError(VOID)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
int InfoMessageBox(HWND hWnd, UINT uType, LPCWSTR lpTitle, LPCWSTR lpMessage,...)
PCWSTR * apwzAttributeNames
#define FNERR_SUBCLASSFAILURE
#define IDS_QUERY_DELETE_MORE
static HRESULT InitializeRemoteRegistryPicker(OUT IDsObjectPicker **pDsObjectPicker)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define ID_HELP_HELPTOPICS
LONG WINAPI RegFlushKey(HKEY hKey)
static void ChooseFavorite(LPCWSTR pszFavorite)
BOOL WINAPI DestroyWindow(_In_ HWND)
#define IDC_EXPORT_BRANCH
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)
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static BOOL LoadHive(HWND hWnd)
#define ID_EDIT_NEW_BINARYVALUE
#define CDERR_FINDRESFAILURE
#define SE_PRIVILEGE_ENABLED
#define CFSTR_DSOP_DS_SELECTION_LIST
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
static VOID FreeObjectPicker(IN IDsObjectPicker *pDsObjectPicker)
#define PD_USEDEVMODECOPIESANDCOLLATE
#define ID_VIEW_STATUSBAR
BOOL WINAPI EnableMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
LONG WINAPI RegCloseKey(HKEY hKey)
#define ListView_GetSelectedCount(hwndLV)
void UpdateStatusBar(void)
static const WCHAR szText[]
static BOOL UnloadHive(HWND hWnd)
#define IDS_IMPORT_REG_FILE
#define IDC_EXPORT_BRANCH_TEXT
#define IDS_EXPORT_REG_FILE
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
LONG WINAPI RegOpenKeyW(HKEY hKey, LPCWSTR lpSubKey, PHKEY phkResult)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
#define OFN_ENABLETEMPLATE
LPCWSTR GetValueName(HWND hwndLV, int iStartAt)
BOOL CopyKeyName(HWND hWnd, HKEY hRootKey, LPCWSTR keyName)
static UINT_PTR CALLBACK ExportRegistryFile_OFNHookProc(HWND hdlg, UINT uiMsg, WPARAM wParam, LPARAM lParam)
static BOOL EnablePrivilege(LPCWSTR lpszPrivilegeName, LPCWSTR lpszSystemName, BOOL bEnablePrivilege)
#define ID_REGISTRY_CONNECTNETWORKREGISTRY
#define ID_EDIT_PERMISSIONS
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)
struct _DSOP_SCOPE_INIT_INFO DSOP_SCOPE_INIT_INFO
#define CDERR_LOADSTRFAILURE
static HRESULT InvokeRemoteRegistryPickerDialog(IN IDsObjectPicker *pDsObjectPicker, IN HWND hwndParent OPTIONAL, OUT LPWSTR lpBuffer, IN UINT uSize)
#define IDS_QUERY_DELETE_ONE
BOOL DeleteNode(HWND hwndTV, HTREEITEM hItem)
LPCWSTR GetItemPath(HWND hwndTV, HTREEITEM hItem, HKEY *phRootKey)
OPENFILENAMEA OPENFILENAME
BOOL ModifyValue(HWND hwnd, HKEY hKey, LPCWSTR valueName, BOOL EditBin)
_In_ uint64_t _In_ uint64_t _In_ uint64_t _In_opt_ traverse_ptr * tp
#define CDERR_LOCKRESFAILURE
#define IDS_ERR_DELVAL_CAPTION
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
BOOL WINAPI EmptyClipboard(void)
LONG WINAPI RegSaveKeyW(HKEY hKey, LPCWSTR lpFile, LPSECURITY_ATTRIBUTES lpSecurityAttributes)
static INT_PTR CALLBACK LoadHive_KeyNameInHookProc(HWND hWndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
#define TreeView_GetSelection(hwnd)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
static BOOL ImportRegistryFile(HWND hWnd)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
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)
#define ID_REGISTRY_UNLOADHIVE
LONG WINAPI RegUnLoadKeyW(HKEY hKey, LPCWSTR lpSubKey)
#define CDERR_INITIALIZATION
HANDLE WINAPI GetCurrentProcess(VOID)
BOOL WINAPI SetCursorPos(_In_ int, _In_ int)
DWORD WINAPI CheckMenuItem(_In_ HMENU, _In_ UINT, _In_ UINT)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
unsigned __int3264 UINT_PTR
#define IDS_FLT_REGEDIT4_FLT
static BOOL _CmdWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
TCHAR szTitle[MAX_LOADSTRING]
BOOL WINAPI CloseClipboard(void)
#define ID_REGISTRY_DISCONNECTNETWORKREGISTRY
static BOOL CheckCommDlgError(HWND hWnd)
PDSOP_SCOPE_INIT_INFO aDsScopeInfos
static void OnInitMenu(HWND hWnd)
#define MB_ICONINFORMATION
#define DSOP_SCOPE_TYPE_EXTERNAL_UPLEVEL_DOMAIN
_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
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
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)
BOOL RefreshListView(HWND hwndLV, HKEY hKey, LPCWSTR keyPath)
#define ID_REGISTRY_OPENLOCAL
#define FAVORITES_MENU_POSITION
WCHAR szChildClass[MAX_LOADSTRING]
#define ID_REGISTRY_EXPORTREGISTRYFILE
#define memcpy(s1, s2, n)
#define CDERR_MEMLOCKFAILURE
DS_SELECTION aDsSelection[ANYSIZE_ARRAY]
void FindDialog(HWND hWnd)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
void BuildFilterStrings(WCHAR *Filter, PFILTERPAIR Pairs, int PairCount)
#define DSOP_SCOPE_TYPE_USER_ENTERED_DOWNLEVEL_SCOPE
#define IDS_FLT_ALLFILES_FLT
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define IDS_FLT_HIVFILES_FLT
#define ID_EDIT_NEW_DWORDVALUE
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
#define REG_FORCE_RESTORE
BOOL WINAPI MessageBeep(_In_ UINT)
#define MAX_COMPUTERNAME_LENGTH
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define ID_EDIT_NEW_STRINGVALUE
#define DSOP_SCOPE_TYPE_WORKGROUP
BOOL PrintRegistryHive(HWND hWnd, LPWSTR path)
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
int WINAPI GetWindowTextW(HWND hWnd, LPWSTR lpString, int nMaxCount)
BOOL WINAPI DeleteDC(_In_ HDC)
LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
#define ID_REGISTRY_PRINT
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define DSOP_SCOPE_TYPE_UPLEVEL_JOINED_DOMAIN
#define FNERR_BUFFERTOOSMALL
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
BOOL WINAPI RemoveMenu(_In_ HMENU, _In_ UINT, _In_ UINT)
#define ID_REGISTRY_PRINTERSETUP
static void toggle_child(HWND hWnd, UINT cmd, HWND hchild)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define OFN_OVERWRITEPROMPT
#define IDS_FLT_REGFILES_FLT
BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath)
#define IDS_ERR_DELETEVALUE
#define LOADHIVE_KEYNAMELENGTH
#define DSOP_SCOPE_TYPE_EXTERNAL_DOWNLEVEL_DOMAIN
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
BOOL export_registry_key(WCHAR *file_name, WCHAR *reg_key_name, DWORD format)
#define DSOP_FILTER_COMPUTERS
#define ERROR_NOT_ALL_ASSIGNED
BOOL CreateNewKey(HWND hwndTV, HTREEITEM hItem)
BOOL WINAPI WinHelpW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_ UINT, _In_ ULONG_PTR)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
HWND WINAPI GetFocus(void)
unsigned long long DWORDLONG
WCHAR FileNameBuffer[_MAX_PATH]
#define ListView_FindItem(hwnd, iStart, plvfi)
BOOL SelectNode(HWND hwndTV, LPCWSTR keyPath)
#define DSOP_DOWNLEVEL_FILTER_COMPUTERS
BOOL import_registry_file(FILE *reg_file)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define CDERR_MEMALLOCFAILURE
struct FILTERPAIR * PFILTERPAIR
BOOL RegKeyEditPermissions(HWND hWndOwner, HKEY hKey, LPCWSTR lpMachine, LPCWSTR lpKeyName)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI OpenClipboard(_In_opt_ HWND)
#define MAKEINTRESOURCEW(i)
#define ERROR_ALREADY_EXISTS
#define CDERR_DIALOGFAILURE
BOOL RefreshTreeView(HWND hWndTV)
DWORD WINAPI CommDlgExtendedError(void)
static BOOL InitOpenFileName(HWND hWnd, OPENFILENAME *pofn)
#define ID_EDIT_MODIFY_BIN
HMENU WINAPI GetMenu(_In_ HWND)
#define TOKEN_ADJUST_PRIVILEGES
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
static BOOL CreateNewValue(HKEY hRootKey, LPCWSTR pszKeyPath, DWORD dwType)
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
#define ID_EDIT_NEW_MULTISTRINGVALUE
#define ListView_EditLabel(hwndLV, i)
#define IDS_QUERY_DELETE_CONFIRM
LONG WINAPI RegLoadKeyW(HKEY hKey, LPCWSTR lpSubKey, LPCWSTR lpFile)
#define FNERR_INVALIDFILENAME
#define DSOP_SCOPE_TYPE_USER_ENTERED_UPLEVEL_SCOPE
PULONG MinorVersion OPTIONAL
BOOL GetKeyName(LPWSTR pszDest, size_t iDestLength, HKEY hRootKey, LPCWSTR lpSubKey)