Harddisk manufacturing information library
is there an update on this... or even better, has the source been released?
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
-
- PureBasic Expert
- Posts: 2812
- Joined: Fri Apr 25, 2003 4:51 pm
- Location: Portugal, Lisbon
- Contact:
Here's a quote from the original library, maybe it helps...
The source code for the DLL mentioned is freeware and available on the site, maybe someone can built an internal library for Purebasic, would be nice.
There has also been an update on the 25th November 2003
The source code for the DLL mentioned is freeware and available on the site, maybe someone can built an internal library for Purebasic, would be nice.
There has also been an update on the 25th November 2003

Included in this archive is an example of how to use these functions in PureBasic. This library was created in 100% C, and originated from the DiskId32 utility by WinSim Inc. (http://www.winsim.com/diskid32/diskid32.html). This library is freeware! This file must be included unaltered if you plan to redistribute the library.
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Revisiting This
Hi All,
I am posting on this topic because it is ALMOST what I need.
1) The links that Revolver for his library posted are no longer valid. Has/Can anyone mirror those if you downloaded them in 2003?
2) Revolver hasn't posted since 2003, so I don't even know if he is around anymore.
Here is what I am looking for:
This code works fine for finding HD Info/Serial number for Win98/Win2k/WinXP, however, you must be admin on Win2K/WinXP. I need this code for non-admins on Win2K/WinXP - does anyone have this?
More specifically, has anyone converted DISKID32 (see http://www.winsim.com/diskid32/diskid32.html) to PureBasic code?
Also, I am looking for this in PureBasic source code, no external DLLs as I need to compile it into my own EXE.
Anyone? Thanks in advance?
Here is the related link with similar code by Rings (again with the same issues regarding Admin on Win2K/WinXP):
viewtopic.php?p=28162#28162
I am posting on this topic because it is ALMOST what I need.
1) The links that Revolver for his library posted are no longer valid. Has/Can anyone mirror those if you downloaded them in 2003?
2) Revolver hasn't posted since 2003, so I don't even know if he is around anymore.
Here is what I am looking for:
This code works fine for finding HD Info/Serial number for Win98/Win2k/WinXP, however, you must be admin on Win2K/WinXP. I need this code for non-admins on Win2K/WinXP - does anyone have this?
More specifically, has anyone converted DISKID32 (see http://www.winsim.com/diskid32/diskid32.html) to PureBasic code?
Also, I am looking for this in PureBasic source code, no external DLLs as I need to compile it into my own EXE.
Anyone? Thanks in advance?
Here is the related link with similar code by Rings (again with the same issues regarding Admin on Win2K/WinXP):
viewtopic.php?p=28162#28162
Straker,
Found this in my folder of "Handy Files" (don't know who wrote it, but came from the forum).
(Works for me on Win XP Pro (I've got admin rights, but I don't see where it would stall, if you didn't)
Hope it helps,
--blueb
Found this in my folder of "Handy Files" (don't know who wrote it, but came from the forum).
Code: Select all
Structure IDEREGS
bFeaturesReg.b
bSectorCountReg.b
bSectorNumberReg.b
bCylLowReg.b
bCylHighReg.b
bDriveHeadReg.b
bCommandReg.b
bReserved.b
EndStructure
Structure SENDCMDINPARAMS
cBufferSize.l
irDriveRegs.IDEREGS
bDriveNumber.b
bReserved.b[3]
dwReserved.l[4]
EndStructure
Structure DRIVERSTATUS
bDriveError.b
bIDEStatus.b
bReserved.b[2]
dwReserved.l[2]
EndStructure
Structure SENDCMDOUTPARAMS
cBufferSize.l
DStatus.DRIVERSTATUS
bBuffer.b[512]
EndStructure
#DFP_RECEIVE_DRIVE_DATA = $7C088
bin.SENDCMDINPARAMS
bout.SENDCMDOUTPARAMS
Procedure.s ChangeHighLowByte(Instring.s)
;Change BIG-Little Endian
sdummy.s=""
L=Len(Instring)
For I=1 To L Step 2
If (I+1)<=L
sdummy.s=sdummy.s + Mid(Instring,I+1,1)+Mid(Instring,I,1)
EndIf
Next I
ProcedureReturn sdummy.s
EndProcedure
;*****************************************************************
mvarCurrentDrive=1 ;If you have more hard-disks change it here
;*****************************************************************
hdh = CreateFile_("\\.\PhysicalDrive" + Str(mvarCurrentDrive),#GENERIC_READ | #GENERIC_WRITE, #FILE_SHARE_READ | #FILE_SHARE_WRITE,0, #OPEN_EXISTING, 0, 0)
If hdh
bin\bDriveNumber = mvarCurrentDrive
bin\cBufferSize = 512
If (mvarCurrentDrive & 1)
bin\irDriveRegs\bDriveHeadReg = $B0
Else
bin\irDriveRegs\bDriveHeadReg = $A0
EndIf
bin\irDriveRegs\bCommandReg = $EC
bin\irDriveRegs\bSectorCountReg = 1
bin\irDriveRegs\bSectorNumberReg = 1
br=0
Result=DeviceIoControl_( hdh, #DFP_RECEIVE_DRIVE_DATA, bin, SizeOf(SENDCMDINPARAMS), bout, SizeOf(SENDCMDOUTPARAMS), @br, 0)
If br>0
hddfr = 55:hddln = 40 :
Modell.s=ChangeHighLowByte(PeekS(@bout\bBuffer[0]+hddfr-1 ,hddln ) )
hddfr = 21:hddln = 20 :
Serial.s=Trim(ChangeHighLowByte(PeekS(@bout\bBuffer[0]+hddfr-1 ,hddln ) ))
hddfr = 47:hddln = 8
Firmware.s=ChangeHighLowByte(PeekS(@bout\bBuffer[0]+hddfr-1 ,hddln ) )
MessageRequester("Info about your harddisk","Vendor & Model Number = "+Modell.s + Chr(13) +"Serial Number = "+Serial.s+ Chr(13)+"Firmware Version = "+Firmware ,0)
EndIf
Else
Beep_(100,100)
EndIf
Hope it helps,
--blueb