Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CreateFileA with TASM

Status
Not open for further replies.

tedmurray

Programmer
Aug 25, 2006
1
0
0
CA
Hey,

I've just started programming Assembly with TASM and started to try win32 programming. Since TASM doesn't have invoke like MASM does...i'm having trouble using the CreateFileA API function. Here's my code:

.386
.model flat, stdcall

mb_ok equ 0
hWnd equ 0


extrn ExitProcess :pROC
extrn MessageBoxA :pROC
extrn CreateFileA :pROC

.data
caption db "My Problem", 0
msg db "Trying to use CreateFileA", 0

.code
start:
push mb_ok
push offset caption
push offset msg
push hWnd
call MessageBoxA

;push my parameters for CreateFileA here
;call CreateFileA here

call ExitProcess

end start

Now my problem is getting the parameters like dwDesiredAcess into the stack. This is the API reference i'm using:

It describes all of the parameters needed, but i need to get them into the stack so i can call CreateFileA. I found _masta_'s tutorial to be a little bit confusing. In his tutorial all of the DWORD values he has converted into numbers such as OPEN_EXISTING = 3 and i have no idea where he gets these numbers from.
Any help would be appreciated,

Murray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top