| |
|
|
Jac de Lad | Hallöle, i will a worth in the Registry delete. by me working the following but not. Gibts there NEN Error??? CompileMarkSeparationdef @RegOpenKeyEx(5) !"ADVAPI32","RegOpenKeyExA"
def @RegDeleteValue(2) !"ADVAPI32","RegDeleteValueA"
def @RegCloseKey(1) !"ADVAPI32","RegCloseKey"
declare Handle#
dim handle#,4
declare Key#
dim Key#,100
string Key#,0="SoftwareMicrosoftWindowsCurrentVersionRun" Pfad des Zielschlüssels
declare name#
dim Name#,100
string Name#,0="Fraps" Name des zu löschenden Wertes
print @RegOpenKeyEx($80000001,Key#,0,1,Handle#) $80000001=HK_Current_User
print @RegDeleteValue(@Long(Handle#,0),Name#)
print @RegCloseKey(@Long(Handle#,0))
dispose Handle#
dispose Key#
dispose Name#
Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 12/10/05 ▲ | |
|
|
|
|
| You open whom Key with KEY_QUERRY_VALUE grabbed (reading), want but write. the is not! |
|
|
| |
|
|
|
Jac de Lad | Hm, ok, and How make ichs correctly.???
Jac |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 12/10/05 ▲ |
|
|
|
|
Jac de Lad | Ahh! I habs already found.
Jac |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 12/10/05 ▲ |
|
|
|
|
| short Statement, then come You soon Perhaps self zurecht it's about Parameter 4 of RegOpenKeyEx:
under NT/2000/XP are many Objects (Handles) with of/ one Zugriffskontrolle slip. one must at Öfffnen the Handles thereby a Hexadezimale number angegen (Flag), The angiebt, How to the lever open would like (write, reading, Vollzugriff...). this is here the Parameter 4 of RegOpenKeyEx. the OS screen then first, whether the aufrufende User at all the right moreover has, the lever in the angeforderten Nature and allocate open. which rights the jeweilige User geanau the lever own, standing in the Security-Descriptor the the jeweiligen Objekt zugeordnet is. has it The angeforderten rights not, proposes the Open the Handles fehl.
becomes later a function with the lever (Speicherbereich) carryed out (here RegDeleteValue), proposes these function then fehl, if the lever not entsprechender point opened watts.
types of Zugriffsflags: Microsoft divides these ? Happen?, The to determine, like a lever to open is, in three types ein=>
1.) specific rights each Objekt has different properties and can therefore in unterschiedlicher Nature and point opened go. specific rights for Registryschlüssel are: $1=KEY_QUERY_VALUE=Wert reading $2=KEY_SET_VALUE=Wert write $4=KEY_CREATE_SUB_KEY=Unterschlüssel create $8=KEY_ENUMERATE_SUB_KEYS=Unterschlüssel List $10=KEY_NOTIFY=Über Changes inform $20=KEY_CREATE_LINK=Symbolischen Link create
2.) Generic rights there it Zig types of zugriffsbeschränkten Handles gives, would hardly one Programmer in the site, itself the everything To remember and at all programs to develop. there's therefore yet The Generic ? Happen?, The for each lever same and quasi a Umsetzung the specific rights and Standardrechte are: $10000000=GENERIC_ALL=Vollzugriff $80000000=GENERIC_READ=Kompletter Lesezugriff $40000000=GENERIC_WRITE=Kompletter Schreibzugriff $20000000=GENERIC_EXECUTE=Ausführen
3.)Standardrechte naturally there too ? Happen?, The for all Handles same are: $40000=WRITE_DAC=Im Security-Descriptor Zugriffsrechte Change $80000=WRITE_OWNER=Eigentümer one Objektes Change (the proprietor has always erweiterte Zugriffsrechte). $20000=READ_CONTROL=Auslesen the existing Zugriffsrechte a Security-Descriptor $10000=_DELETE=Löschen $100000=SYNCHRONIZE=Warten, To a handle ready is
is everything in the principle integrally simply - and How You from your trouble well learnt have, is it too very very important the to know, if one on neueren Betriebssystemen programs write wants (under 95/98/ME can you the safely everything forget)...
here the geänderte code: CompileMarkSeparationDef @Regopenkeyex(5) !"ADVAPI32","RegOpenKeyExA"
Def @Regdeletevalue(2) !"ADVAPI32","RegDeleteValueA"
Def @Regclosekey(1) !"ADVAPI32","RegCloseKey"
Declare Handle#
Dim Handle#,4
Declare Key#
Dim Key#,100
String Key#,0="SoftwareMicrosoftWindowsCurrentVersionRun" Pfad des Zielschlüssels
Declare Name#
Dim Name#,100
String Name#,0="Fraps" Name des zu löschenden Wertes
Print @Regopenkeyex($80000001,Key#,0,$2,Handle#)$80000001=HK_Current_User
Print @Regdeletevalue(@Long(Handle#,0),Name#)
Print @Regclosekey(@Long(Handle#,0))
Dispose Handle#
Dispose Key#
Dispose Name#
| 12/10/05 ▲ | |
|
|
|
|
| I Have straight red, that You XProfan own. ex Profan² 7 can you with APIs instead of the reaches too Adressen of variables indicate (only, if somewhere one String zurückgeliefert becomes, should You the unterlassen): CompileMarkSeparationDef @Regopenkeyex(5) !"ADVAPI32","RegOpenKeyExA"
Def @Regdeletevalue(2) !"ADVAPI32","RegDeleteValueA"
Def @Regclosekey(1) !"ADVAPI32","RegCloseKey"
Declare Handle&,Key$,Name$
LET Key$="SoftwareMicrosoftWindowsCurrentVersionRun" Pfad des Zielschlüssels
LET Name$="Fraps" Name des zu löschenden Wertes
Print @Regopenkeyex($80000001,@ADDR(Key$),0,$2,@ADDR(HANDLE&))$80000001=HK_Current_User
Print @Regdeletevalue(Handle&,@ADDR(Name$))
Print @Regclosekey(HANDLE&)
Wa /a>
|
|
|
| |
|
|
|
| alas Yes, yet what to the Topic... The Eigenart a handle always with Vollzugriff (here KEY_ALL_ACCESS=$1F003F) to open, ought to one possible give up. operates one User not as Admin, takes one windows such faxen often very ill... |
|
|
| |
|
|
|
Jac de Lad | I see.
Hm, How said, I had the trouble already self found. but then same To of my next question: i am sure not the only with the trouble, Registry-values To reading, The possible No are, then Gibts NEN wicked Error. whom can Yes folgendermaßen bypass: CompileMarkSeparation the went yet integrally lovely. now have I but since today XProfan 9. there does it in the Interpreter too yet free from problems, but with the Runtime come at a single blow two angry Error. Can with the APis release? with RegKeyOpenEx and so...
Jac |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 12/10/05 ▲ |
|
|
|
|
Jac de Lad | @AH:
so, here has again some changed:
Related to the Einkürzen is clear. I machs but nevertheless always first with reaches and kürze it then one, ifs functions. nevertheless thanks. now have I but fixes, that the trouble on Set(Errorlevel... lying. But if You me say could, How with the APIs functions, would itself the trouble Yes erübrigen. Related to the Vollzugriff and so I will me To hearts take!
Jac |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 12/10/05 ▲ |
|
|
|
|
| so: CompileMarkSeparationBeispiel zu api_RegQueryValueExA,ADVAPI32
Declare Handle#,Fehler&,Key#,Name#,Wert#,Size#,Type#
Def @Regopenkeyex(5) !"ADVAPI32","RegOpenKeyExA"
Def @Regqueryvalueex(6) !"ADVAPI32","RegQueryValueExA"
Def @Regclosekey(1) !"ADVAPI32","RegCloseKey"
Windowstyle 31
Windowtitle "Aus Registry Startmenüname auslesen"
Window 0,0-640,440
Dim Key#,260
Dim Handle#,4
Dim Name#,250
Dim Size#,4
Dim Wert#,260
Dim Type#,4
String Key#,0="SoftwareMicrosoftWindowsCurrentVersionExplorerUser Shell Folders"
Let Fehler&=@Regopenkeyex($80000001,Key#,0,$F003f,Handle#)
Print "Fehlercode beim Öffenen des Schlüssels User Shell Folders: ";Fehler&
If Fehler&=0
String Name#,0="Start Menu"
Long Size#,0=260
Let Fehler&=@Regqueryvalueex(@Long(Handle#,0),Name#,0,Type#,Wert#,Size#)
Print "Fehlercode beim Auslesen des Schlüssels: ";Fehler&
Print ""
Print "Das Startmenü des aktuellen Users steht hier: "
Print @String$(Wert#,0)
Print "Typ des Schlüssels: ";@Long(Type#,0)
Print "Länge des Wertes: ";@Long(Size#,0);" Bytes"
Print ""
Print "Fehlercode RegCloseKey: ";@Regclosekey(@Long(Handle#,0))
Endif
If Fehler&<>0
String Key#,0="SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders"
Let Fehler&=@Regopenkeyex($80000001,Key#,0,$1,Handle#)
Print "Fehlercode beim Öffenen des Schlüssels Shell Folders: ";Fehler&
String Name#,0="Start Menu"
Long Size#,0=260
Let Fehler&=@Regqueryvalueex(@Long(Handle#,0),Name#,0,Type#,Wert#,Size#)
Print "Fehlercode beim Auslesen des Schlüssels: ";Fehler&
Print ""
Print "Das Startmenü des aktuellen Users steht hier: "
Print @String$(Wert#,0)
Print "Typ des Schlüssels: ";@Long(Type#,0)
Print "Länge des Wertes: ";@Long(Size#,0);" Bytes"
Print ""
Print "Fehlercode RegCloseKey: ";@Regclosekey(@Long(Handle#,0))
Endif
If Fehler&<>0
Print "Fehler!!!!!! Startmenü konnte nicht ausgelesen werden!!!"
Endif
Dispose Type#
Dispose Wert#
Dispose Key#
Dispose Handle#
Dispose Name#
Dispose Size#
While 0=0
Waitinput
ass=s4 href='./../../function-references/XProfan/wend/'>Wend
1.) with RegOpenKeyEx whom Key with the Flag $1 to that reading open. here on none drop whom Key with $F003F=Vollzugriff separate really only with $1=KEY_QUERY_VALUE open! Runs your Program in a User Account and not with Adminrechten, is otherwise the Reading of Schlüsseln under HKEY_LOCAL_MACHINE you don't say so!!!
2 with RegQueryValueEx worth read (alike which manner - String, Structure or Doubleword...). Parameter 4 receiving a Flag, the angibt which manner of worth read watts (String, Doubleword...). |
|
|
| |
|
|
|
| alas Yes...
some Registryschlüssel can you self as Administrator not without further read. moreover belong among other things in example the Key HKEY_LOCAL_MACHINESAMSAMDOMAINS and the particularly of me lover Key HKEY_LOCAL_MACHINESecurityPolicyAccounts. |
|
|
| |
|
|
|
Jac de Lad | Ah, I known, I on The count can. such special Key I will sure not need. nevertheless thanks for your trouble,
lovely sunday yet, Jac |
|
|
| Profan² 2.6 bis XProfan 11.1+XPSE+XPIA+XPRR (und irgendwann XIDE) Core2Duo E8500/T2250, 8192/1024 MB, Radeon HD4850/Radeon XPress 1250, Vista64/XP | 12/11/05 ▲ |
|
|
|