Skip to content

Commit

Permalink
Use HKCU for settings to avoid admin requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
notr1ch committed Apr 24, 2022
1 parent b89f907 commit 0982c48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/_libs/registry/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ char szBuf[1024], *p;
// key not found
if (p - szBuf >= Rc || *p==0)
{
if (RegOpenKeyEx (HKEY_LOCAL_MACHINE, // Key handle at root level.
if (RegOpenKeyEx (HKEY_CURRENT_USER, // Key handle at root level.
szRegPath, // Path name of child key.
0, // Reserved.
KEY_READ, // Requesting read access.
Expand Down Expand Up @@ -128,7 +128,7 @@ HANDLE hINIFile;
else // do not use INI File, use Registry
{
//MessageBox (NULL, szKey, "Tftpd32", MB_OK);
if (RegCreateKeyEx (HKEY_LOCAL_MACHINE,
if (RegCreateKeyEx (HKEY_CURRENT_USER,
szRegPath,
0,
NULL,
Expand Down
4 changes: 2 additions & 2 deletions src/_services/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ BOOL Tftpd32DestroySettings (void)
int Rc;
FILE *f;
// destroy keys
RegDeleteKey (HKEY_LOCAL_MACHINE, TFTPD32_DHCP_KEY);
Rc = RegDeleteKey (HKEY_LOCAL_MACHINE, TFTPD32_MAIN_KEY);
RegDeleteKey (HKEY_CURRENT_USER, TFTPD32_DHCP_KEY);
Rc = RegDeleteKey (HKEY_CURRENT_USER, TFTPD32_MAIN_KEY);

// delete ini file
/* if (szTftpd32IniFile[0]!=0)
Expand Down

0 comments on commit 0982c48

Please sign in to comment.