SMBIOS info from kernel mode

Discussion in 'Windows Vista Drivers' started by Dibyendu Nandy, Nov 20, 2003.

  1. Hi,

    I am looking for information oh how to read SMBIOS
    information using kernel mode code. Specially, I am
    interested in getting OEM information like Manufacturer
    and model. The OEM information is the persistent OEM
    information obtained from the System Tools program group
    application System Information.

    From my search on the web, this information is from the
    SMBIOS . Check http://www.dmtf.org/standards/smbios . The
    information appears to be stored as a table which is
    memory mapped to the physical memory. However, its
    location is not specified. WMI also gets handles to this
    information somehow.

    I would appreciate pointers on how to retrieve this
    information using kernel mode code in XP.

    Thanks
    Dibyendu
     
    Dibyendu Nandy, Nov 20, 2003
    #1
    1. Advertisements

  2. You can use IoWMI APIs to get SMBIOS info in kernel-mode. It's not very
    hard. Here is a small code snippet that shows how to get a WMI data block in
    kernel-mode. It is much easier than mucking with COM in usermode.



    NTSTATUS status;
    GUID smbiosGUID = SMBIOS_DATA_GUID; // defined in wmiguid.h
    PVOID wmiObject = NULL;
    PWNODE_ALL_DATA dataBuffer;

    //
    // Get a WMI block handle to the SMBIOS_DATA_GUID
    //
    status = IoWMIOpenBlock( (GUID *) &smbiosGUID, WMIGUID_QUERY,
    &wmiObject );
    if (!NT_SUCCESS(status)) {

    return status;

    }

    //
    // Determine how much space is required for the data
    //
    status = IoWMIQueryAllData( wmiObject, &bufferSize, NULL );
    if (status != STATUS_BUFFER_TOO_SMALL) {

    ObDereferenceObject( wmiObject );
    return status;

    }

    //
    // Allocate the necessary storage. This space must come out of NP-pool
    //
    dataBuffer = ExAllocatePoolWithTag(
    NonPagedPool,
    bufferSize,
    TAG_SMBIOS
    );
    if (dataBuffer == NULL) {

    ObDereferenceObject( wmiObject );
    return STATUS_INSUFFICIENT_RESOURCES;

    }
     
    Eliyas Yakub [MSFT], Nov 21, 2003
    #2
    1. Advertisements

  3. Thanks. Much appreciated!
    Dibyendu
    .... snip....
     
    Dibyendu Nandy, Nov 21, 2003
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.