Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GetVolumeInformation returns 0 with NTFS
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00272024
Message ID:
00272148
Views:
48
>>AFAIK, NTFS shouldn't be a problem. However, tracking down what the problem is is difficult without seeing two things. First, the declaration and call. Second, the value returned by the GetLastError() API function. If you'll post these, maybe we can figure out what's going on.
>
>Hi George, thanks for your answer, here you have the code:
>
>FUNCTION DISKSERIAL
>
>LPARAMETERS lpRootPathName
>LOCAL lpVolumeNameBuffer, nVolumeNameSize, lpVolumeSerialNumber
>LOCAL lpMaximumComponentLength, lpFileSystemFlags
>LOCAL lpFileSystemNameBuffer, nFileSystemNameSize
>
>IF PCOUNT() = 0
> lpRootPathName = SYS(5)
>ENDIF
>
>lpVolumeNameBuffer = SPACE(256) && lpVolumeName return buffer
>nVolumeNameSize = 256 && Size of/lpVolumeNameBuffer
>lpVolumeSerialNumber = 0 && lpVolumeSerialNumber buffer
>lpMaximumComponentLength = 256
>lpFileSystemFlags = 0
>lpFileSystemNameBuffer = SPACE(256)
>nFileSystemNameSize = 256
>
>DECLARE INTEGER GetVolumeInformation IN Win32API AS GetVolInfo ;
> STRING @lpRootPathName, ;
> STRING @lpVolumeNameBuffer, ;
> INTEGER nVolumeNameSize, ;
> INTEGER @lpVolumeSerialNumber, ;
> INTEGER @lpMaximumComponentLength, ;
> INTEGER @lpFileSystemFlags, ;
> STRING @lpFileSystemNameBuffer, ;
> INTEGER nFileSystemNameSize
>
>RetVal=GetVolInfo(@lpRootPathName, @lpVolumeNameBuffer, ;
> nVolumeNameSize, @lpVolumeSerialNumber, ;
> @lpMaximumComponentLength, @lpFileSystemFlags, ;
> @lpFileSystemNameBuffer, nFileSystemNameSize)
>
>RETURN lpVolumeSerialNumber
>
>Yes, I tested again and you're right, there is no problem with NTFS, the problem is with net volumes (if I map a volume of other user or the WinNT Server)
>
>Do you have any solution?
>
>Thanks in advance.

Hi Pablo,

If you would, please try the following:
DECLARE INTEGER GetLastError IN Win32API
* If the call fails, issue...
lnerror = GetLastError()
I won't be able to look at this until the morning (EDT), but I'll look at the codde and try to figure out what's going on.
George

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

Click here to load this message in the networking platform