The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: stanley on October 13, 2009, 12:59:15 AM

Title: how to pass argumenst in it
Post by: stanley on October 13, 2009, 12:59:15 AM
.386
.model flat,stdcall
option casemap: none
include \masm32\include\windows.inc
include \masm32\include\advapi32.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\advapi32.lib
includelib \masm32\lib\kernel32.lib
.data
.code
start:
SetRegString proto :dword,:dword,:dword,:dword
SetRegString proc hkey:dword,lpszkeyname:dword,lpszvaluename:dword,lpszstringname:dword
local disp:dword
local pkey:dword
local dwsize:dword
invoke RegCreateKeyEx,HKEY_LOCAL_MACHINE,lpszvaluename,NULL,NULL,REG_OPTION_NON_VOLATILE,KEY_ALL_ACCESS,NULL,addr pkey,addr disp
.if eax== ERROR_SUCCESS
invoke lstrlen,lpszstringname
mov dwsize,eax
invoke RegSetValueEx, pkey,lpszvaluename,NULL,REG_SZ,lpszstringname, dwsize
push eax
invoke RegCloseKey,pkey
pop eax
.endif
ret
SetRegString endp
end start



help me to pass arguments to it to access registry