Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetVolumeInformation
Message
 
To
03/11/1997 12:33:23
Razvan Alexandru
Soft Team Solutions Srl
Bucharest, Romania
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00058000
Message ID:
00058014
Views:
80
>What results you have if you run this?
>
>DECLARE GetVolumeInformation IN WIN32API ;
> STRING @lpRootPathName, ;
> INTEGER @lpVolumeNameBuffer, ;
> INTEGER @nVolumeNameSize, ;
> STRING @lpVolumeSerialNumber, ;
> DOUBLE @lpMaximumComponentLength, ;
> DOUBLE @lpFileSystemFlags, ;
> STRING @lpFileSystemNameBuffer, ;
> DOUBLE @nFileSystemNameSize
>
>lpRootPathName = "c:\"
>lpVolumeNameBuffer = 0
>nVolumeNameSize = 0
>lpVolumeSerialNumber = ""
>lpMaximumComponentLength = 0
>lpFileSystemFlags = 0
>lpFileSystemNameBuffer = ""
>nFileSystemNameSize = 0
>
>?GetVolumeInformationA(@lpRootPathName, @lpVolumeNameBuffer, @nVolumeNameSize, @lpVolumeSerialNumber, @lpMaximumComponentLength, @lpFileSystemFlags, @lpFileSystemNameBuffer, @nFileSystemNameSize)
>
>?"lpRootPathName=",lpRootPathName
>?"lpVolumeNameBuffer=",lpVolumeNameBuffer
>?"nVolumeNameSize=",nVolumeNameSize
>?"lpVolumeSerialNumber=",lpVolumeSerialNumber
>?"lpMaximumComponentLength=",lpMaximumComponentLength
>?"lpFileSystemFlags",lpFileSystemFlags
>?"lpFileSystemNameBuffer=",lpFileSystemNameBuffer
>?"nFileSystemNameSize=",nFileSystemNameSize

The problem is in the declaration and the variables. Here's the proper declaration:

DECLARE SHORT GetVolumeInformation IN Win32API;
STRING @lpRootPathName, STRING @lpVolumeNameBuffer,;
INTEGER nVolumeNameSize, INTEGER @lpVolumeSerialNumber,;
INTEGER @lpMaximumComponentLength, INTEGER @lpFileSystemFlags,;
STRING @lpFileSystemNameBuffer, INTEGER nFileSystemNameSize

Now try passing the following:
lcpath = "C:\"
lcvolbuff = SPACE(200)
lnvbuffsize = LEN(lcvolbuff)
lnserialno = 0
lncomplen = 0
lnsysflags = 0
lcsysbuff = SPACE(200)
lnsbuffsize = LEN(lcsysbuff)

lnresult = GetVolumeInformation(@lcpath, @lcvolbuff, lnvbuffsize, @lnserialno, @lncomplen, @lnsysflags, @lcsysbuff, lnsbuffsize)

If the function suceeds, lnresult will equal one, if it fails, zero.

hth,

George
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform