pretty rusty at this...
this code isn't putting a key in the reg...
iDisp is saying REG_OPENED_EXISTING_KEY...
but when I look with regeditthe key isn't there...
m2m sSA.nLength, sizeof SECURITY_ATTRIBUTES
m2m sSA.lpSecurityDescriptor,NULL
m2m sSA.bInheritHandle,TRUE
invoke RegCreateKeyEx, HKEY_LOCAL_MACHINE,addr szFakePath,0,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,addr sSA,addr hOpenKey,addr iDisp
8|
it should not be necessary to use a SECURITY_ATTRIBUTES structure
to use these functions, you must also...
INCLUDE \masm32\include\advapi32.inc
INCLUDELIB \masm32\lib\advapi32.lib
.DATA
szSubKey db 'SOFTWARE\TempKey',0
.DATA?
dwSize dd ?
.CODE
INVOKE RegCreateKeyEx,HKEY_CURRENT_USER,offset szSubKey,NULL,NULL,
NULL,KEY_CREATE_SUB_KEY or KEY_SET_VALUE,NULL,offset dwSize,NULL
thanx... that's working....
I was also looking in CURRENT_USER instead of LOCAL_MACHINE so I don't know if my other code was working or not...
the offset/addr thing has always been confusing to me... i'll experiment and see...
thanx again dedndave
p.s. it's also good to know I don't have to mess with those security structures.... reading about those almost made me throw away my computer...
well - that's why i stay in HKEY_CURRENT_USER :lol
under vista and/or win7, you may have to mess with security issues if using other keys
the simple solution is to have the user run the program as an administrator
but, that's not always desirable
hhhhmmmmmmmmm...
this is part of my registration for some PhotoShop filters...
is it possible that folks without admin privileges wouldn't be able to register via LOCAL_MACHINE but could via CURRENT_USER?
no - if your stuff has to go in HKLM, then it has to go in HKLM :P
i don't recall the different access levels for different keys
you can probably google it or search the forum
I apreciate your help...
have many good ones...
Quote from: DC on August 12, 2011, 04:35:40 AM
p.s. it's also good to know I don't have to mess with those security structures.... reading about those almost made me throw away my computer...
They're not that bad. I have a working example somewhere - I'll dig it out and post it.