problem in usin registry api

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Sep 2007
Posts: 4
Reputation: BlZbB is an unknown quantity at this point 
Solved Threads: 1
BlZbB BlZbB is offline Offline
Newbie Poster

problem in usin registry api

 
0
  #1
Nov 19th, 2007
hi

i write a program to add a value in windows registry but it didn't work
and doesn't add anything in registry, what's a problem?
my assembler is masm32.

and here is my code:

  1.  
  2. .386
  3. .model flat, stdcall
  4. option casemap:none
  5.  
  6. include windows.inc
  7. include kernel32.inc
  8. include advapi32.inc
  9.  
  10. includelib kernel32.lib
  11. includelib advapi32.lib
  12.  
  13. .data
  14. szRegSubKey db "Software\Microsoft\Windows\CurrentVersion\Policies\System", 0
  15. szValue db "DisableTaskMgr", 0
  16.  
  17. .data?
  18. hKey PHKEY ?
  19.  
  20. .code
  21. start:
  22.  
  23. invoke RegOpenKeyEx, RegOpenKeyEx, ADDR szRegSubKey, NULL, KEY_ALL_ACCESS, ADDR hKey
  24.  
  25. OR EAX, EAX
  26. JNE _error
  27. invoke RegSetValueEx, hKey, ADDR szValue, NULL, REG_DWORD, 1, DWORD
  28.  
  29. _error:
  30.  
  31. invoke RegCloseKey, hKey
  32. invoke ExitProcess, NULL
  33.  
  34. end start
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 199
Reputation: Tight_Coder_Ex is an unknown quantity at this point 
Solved Threads: 14
Tight_Coder_Ex's Avatar
Tight_Coder_Ex Tight_Coder_Ex is offline Offline
Junior Poster

Re: problem in usin registry api

 
0
  #2
Nov 19th, 2007
try
  1. invoke RegOpenKeyEx HKEY_LOCAL_MACHINE, ADDR szRegSubKey, NULL, KEY_ALL_ACCESS, ADDR hKey)
Last edited by Tight_Coder_Ex; Nov 19th, 2007 at 3:58 pm. Reason: Typo
Reply With Quote Quick reply to this message  
Join Date: Sep 2007
Posts: 4
Reputation: BlZbB is an unknown quantity at this point 
Solved Threads: 1
BlZbB BlZbB is offline Offline
Newbie Poster

Re: problem in usin registry api

 
0
  #3
Nov 19th, 2007
thanks Tight_Coder_Ex it's work.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Assembly Forum
Thread Tools Search this Thread



Tag cloud for Assembly
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC