News:

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

GetVolumeInformation

Started by Force, May 06, 2012, 06:56:22 PM

Previous topic - Next topic

Force

.386
include \masm32\include\masm32rt.inc
.data
PathName db"F:\",0
VolumeName db 16 dup(?)
nameSize dd 50
volumeSerial dd 0
result db 50 dup(?)
.data?


.code
start:
invoke GetVolumeInformation,addr PathName,addr VolumeName,addr nameSize,addr volumeSerial,NULL,NULL,NULL,NULL
invoke wsprintf,addr result,addr VolumeName,addr volumeSerial

invoke MessageBox,NULL,addr result,0,0
invoke ExitProcess,NULL
end start



In this code
i get volume name of usb drive but no serial number

what is my mistake in this code ?
Never Stop Until You Are Better Than The Best

shlomok

There is a full example here:
http://www.quickersoft.com/donkey/files/DriveProps.zip

(look for "offset szVolSerNum" in the code)

S.

xandaz

    I just made this for you Force. Looks good. I counldnt really figure out what you did wrong. All Seems Good.

xandaz

    forgot to inc lvi.iItem. Items are backwards. ty and nite

Force

Thanks shlomok and xandaz for helping
those example codes are nice for me learning system
Never Stop Until You Are Better Than The Best

Force

At Last  I made my simple project

.386
.model flat,stdcall
option casemap:none

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
include \masm32\include\user32.inc

includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib

.data
AppName db "VolumeInformation of C:\",0
PathName db"C:\",0
VolumeName db 16 dup(?)
NameSize dd 50
volumeSerial dd 0
VolumeSize dd 50
VolSer db 50 dup(?)
DiskDataHex DB "%lX",NULL
Buffer db 100 dup(?)
drvName db"Drive Name     :  ",0
srNum db"Serial Number :   ",0
NL db 13,10
.data?


.code
start:
invoke GetVolumeInformation,addr PathName,addr VolumeName,addr NameSize,addr volumeSerial,addr VolumeSize,NULL,NULL,NULL
INVOKE wsprintf,ADDR VolSer,ADDR DiskDataHex,volumeSerial
invoke lstrcat,addr Buffer,addr drvName
invoke lstrcat,addr Buffer,addr VolumeName
invoke lstrcat,addr Buffer,addr NL
invoke lstrcat,addr Buffer,addr srNum
invoke lstrcat,addr Buffer,addr VolSer

invoke MessageBox,NULL,addr Buffer,addr AppName,0
invoke ExitProcess,NULL
end start   




http://turkiyem.jimdo.com/force-s-masm32-codes/
Never Stop Until You Are Better Than The Best