I have been running this program in my ASUS A716 PPC for checking the
serial number of the SD card. It is interesting that HP/DELL/ACER with
PPC2003 report both Manufacturer ID and Serial ID in hexidecimal
format, while Asus A716 report only the Serial ID (Manafacturer ID
reported as not available), and the Serial ID is in decimal format.

What's more strange is that the serial ID reported is not correct.

Any body has any idea? (attached with my testing program)

Best regards,
John(john@sky-power.com.hk)
==================================================================
#include "stdafx.h"
#include <winioctl.h>
#include <storemgr.h>

extern "C" __declspec(dllimport)
#define IOCTL_DISK_GET_STORAGEID
CTL_CODE(FILE_DEVICE_DISK,0x709,METHOD_BUFFERED,FILE_ANY_ACCESS)
BOOL KernelIoControl(DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD);

typedef struct _STORAGE_IDENTIFICATION
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwManufactureIDOffset;
DWORD dwSerialNumOffset;
} STORAGE_IDENTIFICATION;

typedef struct _PPC_STOAGEID
{
STORAGE_IDENTIFICATION StorageID;
unsigned char Data[64];
} PPC_STORAGE_ID;

int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR
lpCmdLine,int nCmdShow)
{
PPC_STORAGE_ID idSD;
HANDLE hSD;
DWORD dwLength;
DWORD dwError;
BOOL bResult;
// I have checked the registry profile that the SD card is DSK1:
TCHAR sDeviceName[10]=_T("DSK1:");

memset(&idSD,0,sizeof(PPC_STORAGE_ID));
idSD.StorageID.dwSize=sizeof(PPC_STORAGE_ID);
hSD=CreateFile(sDeviceName,GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);
if(hSD)
{
bResult=DeviceIoControl(hSD,IOCTL_DISK_GET_STORAGEID,NULL,0,&idSD,sizeof(PPC_STORAGE_ID),&dwLength,NULL);
// Most HP, Dell and Acer with PPC2003 return both manufacturer ID
and serial ID
// Asus A716 only return a serial ID, but the serial ID is not
correct
// Asus reported "2014249026" (which is 780F0042 in HEX)
// but the correct ID should be 780F662D in HEX

if(bResult==FALSE)
dwError=GetLastError();
CloseHandle(hSD);
}
return 0;
}

Re: Asus A716 report incorrect SD card Serial Number by David

David
Wed Apr 06 14:15:18 CDT 2005

IOCTL_DISK_GET_STORAGEID is implemented by the OEM, so perhaps ASUS is
simply not returning the correct information.

David
------
This posting is provided "AS IS" with no warranties, and confers no rights.

<john@sky-power.com.hk> wrote in message
news:d3e0995a.0504040326.21931103@posting.google.com...
>I have been running this program in my ASUS A716 PPC for checking the
> serial number of the SD card. It is interesting that HP/DELL/ACER with
> PPC2003 report both Manufacturer ID and Serial ID in hexidecimal
> format, while Asus A716 report only the Serial ID (Manafacturer ID
> reported as not available), and the Serial ID is in decimal format.
>
> What's more strange is that the serial ID reported is not correct.
>
> Any body has any idea? (attached with my testing program)
>
> Best regards,
> John(john@sky-power.com.hk)
> ==================================================================
> #include "stdafx.h"
> #include <winioctl.h>
> #include <storemgr.h>
>
> extern "C" __declspec(dllimport)
> #define IOCTL_DISK_GET_STORAGEID
> CTL_CODE(FILE_DEVICE_DISK,0x709,METHOD_BUFFERED,FILE_ANY_ACCESS)
> BOOL KernelIoControl(DWORD,LPVOID,DWORD,LPVOID,DWORD,LPDWORD);
>
> typedef struct _STORAGE_IDENTIFICATION
> {
> DWORD dwSize;
> DWORD dwFlags;
> DWORD dwManufactureIDOffset;
> DWORD dwSerialNumOffset;
> } STORAGE_IDENTIFICATION;
>
> typedef struct _PPC_STOAGEID
> {
> STORAGE_IDENTIFICATION StorageID;
> unsigned char Data[64];
> } PPC_STORAGE_ID;
>
> int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPTSTR
> lpCmdLine,int nCmdShow)
> {
> PPC_STORAGE_ID idSD;
> HANDLE hSD;
> DWORD dwLength;
> DWORD dwError;
> BOOL bResult;
> // I have checked the registry profile that the SD card is DSK1:
> TCHAR sDeviceName[10]=_T("DSK1:");
>
> memset(&idSD,0,sizeof(PPC_STORAGE_ID));
> idSD.StorageID.dwSize=sizeof(PPC_STORAGE_ID);
> hSD=CreateFile(sDeviceName,GENERIC_READ,0,NULL,OPEN_EXISTING,0,NULL);
> if(hSD)
> {
> bResult=DeviceIoControl(hSD,IOCTL_DISK_GET_STORAGEID,NULL,0,&idSD,sizeof(PPC_STORAGE_ID),&dwLength,NULL);
> // Most HP, Dell and Acer with PPC2003 return both manufacturer ID
> and serial ID
> // Asus A716 only return a serial ID, but the serial ID is not
> correct
> // Asus reported "2014249026" (which is 780F0042 in HEX)
> // but the correct ID should be 780F662D in HEX
>
> if(bResult==FALSE)
> dwError=GetLastError();
> CloseHandle(hSD);
> }
> return 0;
> }