Yet another "old-skool" ASM coder dips his feet into the Win32 pool, and finds the waters different... I've checked M$'s docs, and find the following:

DWORD GetFullPathName(
  LPCTSTR lpFileName,  // file name
  DWORD nBufferLength, // size of path buffer
  LPTSTR lpBuffer,     // path buffer
  LPTSTR *lpFilePart   // address of file name in path
Can't seem to make the call work, tho'. And I'm not entirely sure I understand what is meant by this:
 Pointer to a buffer that receives the address (in lpBuffer)
of the final file name component in the path. 
Now, maybe my presumption is wrong to begin with, and I hope someone will correct me if I misunderstand... What I am trying to do is determine the FULL drive/path/file name of a file whose name was passed as a command-line argument to my prog. Whether that filename was passed as "name-only" (current-dir), relative to current-dir, or as a full pathname to begin with. I'm pretty sure that's what this function is for, but no luck so far. My GetCommandLine works fine, My routines for parsing the command-line work fine (multiple arguments), and all the other API calls work no problem, just NOT this one. Am I on the completely wrong track ? Any help would be appreciated This message was edited by Q, on 2/7/2001 1:52:38 PM
Posted on 2001-02-07 13:38:00 by Q
GetFullPathName is what you need. However, you misinterpret the last parameter. It's a pointer to a dword that will be filled with the address of the filename part of the full pathname. For example, if you pass "myprog.exe" to GetFullPathName: .data InputName db "myprog.exe",0 .data? FullPathName db 512 dup(?) pName dd ? .code call GetFullPathName, offset InputName, 512, offset FullPathName,offset pName When GetFullPathName returns, suppose it returns "c:\tasm50\project\myprog.exe" in FullPathName, pName will contain the address of the first byte of "myprog.exe" in FullPathName. This message was edited by Iczelion, on 2/7/2001 2:37:23 PM
Posted on 2001-02-07 14:36:00 by Iczelion
Ah.. Thank you kindly. Working in TASM beautifully:

	push	offset pName
	push	offset FullPathName
	push	200h
	push	offset CmdStr
	call	GetFullPathName
Hmmm... Now to find an equivalent to DOS's "TRUENAME" which would resolve mapped and SUBSTed drives to a \\UNC path... Ah, that's a project for later on.... Thanks again!
Posted on 2001-02-07 16:10:00 by Q