News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

strings andd procedures -> problem

Started by patryk_z_wawy, July 25, 2009, 01:09:02 AM

Previous topic - Next topic

dedndave

sure would like to see what value GetLastError returns
it boils down to:
1) there is a problem with the parameters that are passed
2) there is a problem with the invoke, itself

GetLastError could help us isolate it, if it has meaningful information

again, i mention the Sharing mode that you are using
if you open the file with it set to 0, any attempt to open it a second time will fail unless the handle is closed, first
GetLastError should return ERROR_SHARING_VIOLATION (20h)
that is one reason i suggested using FILE_SHARE_READ
really, there is no need to use anything other than FILE_SHARE_READ for this type of file

if there is a problem with the file string when opening in this mode, GetLastError will likely return
ERROR_FILE_NOT_FOUND (2) or ERROR_PATH_NOT_FOUND (3) if the file string is good, but the file isn't there
or possibly ERROR_INVALID_DATA (0Dh) if the string contains garbage characters

if there is some sort of problem with the call, it may return something else like ERROR_INVALID_FUNCTION (1)

if CreateFile returns anything other than -1, it is a valid handle
if it returns -1, GetLastError holds the error information
maybe you want the "hide" function to return 2 vars, temporarily
1) the original value of eax after the CreateFile
2) if that value is -1, also return eax after GetLastError
   if it is not -1, it won't matter what value is returned in this variable

patryk_z_wawy

#16
Problem solved.  THANKS