diff --git a/Source/exehead/exec.c b/Source/exehead/exec.c index 86968374..f129956b 100644 --- a/Source/exehead/exec.c +++ b/Source/exehead/exec.c @@ -132,14 +132,8 @@ static char * NSISCALL GetStringFromParm(int id_) } #ifdef NSIS_SUPPORT_REGISTRYFUNCTIONS -REGSAM NSISCALL AlterRegistrySAM(REGSAM sam) -{ - if (g_exec_flags.alter_reg_view) - { - return sam | KEY_WOW64_64KEY; - } - return sam; -} + +#define AlterRegistrySAM(sam) (sam | g_exec_flags.alter_reg_view) // based loosely on code from Tim Kosse // in win9x this isn't necessary (RegDeleteKey() can delete a tree of keys), diff --git a/Source/exehead/util.c b/Source/exehead/util.c index dbf9ec5d..04b180ed 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -904,9 +904,10 @@ struct MGA_FUNC MGA_FUNCS[] = { void * NSISCALL myGetProcAddress(const enum myGetProcAddressFunctions func) { - HMODULE hModule = GetModuleHandle(MGA_FUNCS[func].dll); + const char *dll = MGA_FUNCS[func].dll; + HMODULE hModule = GetModuleHandle(dll); if (!hModule) - hModule = LoadLibrary(MGA_FUNCS[func].dll); + hModule = LoadLibrary(dll); if (!hModule) return NULL; diff --git a/Source/script.cpp b/Source/script.cpp index b0b53478..b3a9c14c 100644 --- a/Source/script.cpp +++ b/Source/script.cpp @@ -3566,7 +3566,10 @@ int CEXEBuild::doCommand(int which_token, LineParser &line) // "64" results in setting the flag to 1 which alters the view int k=line.gettoken_enum(1,"32\0" "64\0"); if (k<0) PRINTHELP() - ent.offsets[1]=add_intstring(k); + if (k == 0) // 32 + ent.offsets[1]=add_intstring(0); + else if (k == 1) // 64 + ent.offsets[1]=add_intstring(KEY_WOW64_64KEY); SCRIPT_MSG("SetRegView: %s\n",line.gettoken_str(1)); } return add_entry(&ent);