String can't be built
Posted: Sun Jan 13, 2008 6:14 am
Check this out... it's supposed to get a hard drive serial number and then
show it raw, and with a dash in the middle. But the dash never appears.
In fact, depending on which drive letter I give it, the dash is replaced by
either null, one character, or many characters.
It seems the GetVolumeInformation API is corrupting the strings, including
the second string which is in no way related to the API call in any way.
And it's not just dashes, it can be any character(s) in the middle.
Here's the Debug Output results that I get when I use different drive letters.
As you can see, no dash anywhere to be seen in any output. Weird!
show it raw, and with a dash in the middle. But the dash never appears.
In fact, depending on which drive letter I give it, the dash is replaced by
either null, one character, or many characters.
It seems the GetVolumeInformation API is corrupting the strings, including
the second string which is in no way related to the API call in any way.
And it's not just dashes, it can be any character(s) in the middle.
Code: Select all
GetVolumeInformation_("C:\","",255,@s,0,0,"",255)
s$=Hex(s)
Debug s$ ; Raw.
Debug Left(s$,4)+"-"+Right(s$,4) ; Where's the dash?
t$="ABCDEFGH"
Debug Left(t$,4)+"-"+Right(t$,4) ; Also no dash with this different string!
As you can see, no dash anywhere to be seen in any output. Weird!
Code: Select all
C:
A488DF69
A488DF69
ABCDEFGH
Code: Select all
D:
F006ED99
F006sED99
ABCDsEFGH
Code: Select all
E:
50714F26
5071ams4F26
samss