here's the code I'm grabbing the drives serial number.
var
serial : pdword;
s : string;
begin
GetMem(serial, 100);
GetVolumeInformation(pChar('c:\'), nil, 0, serial, DWord(nil^), DWord(nil^) , nil, 0);
s:=hexstr(serial^,8);
FreeMem(serial, 100);
edit1.text:=copy(s,1,4) + '-' + copy(s,5,8);
end;
ok I got it working but still not sure how it actually works.
pdword? memory address one word in length being pointed to? so it 2 bytes but already reserved as soon as I define it right
now i need to define how much memory to use from where the pointer points to. The delphi page used getmem to allocate 260 bytes I lowered it to 100 but if I say getmem(serial,0) the program still works.
it seems to me the drives serial number is a double word xxxx-xxxx so it seems
getmem(serial,4) would be sufficient. Does any of this sound right?