Hi guys,
How do you get the drives in a system, say for example, like C: and D: ?

Also I was wondering about Win32 API function SetCurrentDirectory, if I pass the string ".." , will it go up one level or do I have to manually edit the directory string?

Thanks
Posted on 2003-11-04 19:54:42 by x86asm
The function to get all of the current drive letters is documented here:

http://www.msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/getlogicaldrivestrings.asp

The MS docs say that SetCurrentDirectory will accept a relative path so ".." should work.
Posted on 2003-11-04 20:08:50 by Mecurius
Fasm syntax of listing the drives(assuming all drive names are one letter long).

the information is stored as such:

"c:\",0,"d:\",0, etc. and this is my code for accessing, and displaying.



drivelist: ;list all drives on the users computer
invoke wsprintf,wbuffer,fDriveList,buffer1+1
invoke lstrlen,wbuffer
invoke send,[shandle],wbuffer,eax,0
invoke GetLogicalDriveStrings,255,dbuffer
mov edi,dbuffer
sub edi,4
_lar:
add edi,4
cmp byte [edi],0
je seguir
invoke GetDriveType,edi
cmp eax,DRIVE_FIXED
jne _lar
invoke wsprintf,wbuffer,fDrive,buffer1+1,edi
invoke lstrlen,wbuffer
invoke send,[shandle],wbuffer,eax,0
jmp _lar


*cough*, this was for one of my more evil things a time ago, i just converted to fasm for the hell of it.
Posted on 2003-11-04 20:36:39 by Guy on ASM