Get smbios structure

Hi..

I wanna get the smbios structure in Win32 environment (95-Xp)
I heard four methods to do this:

1. Use direct memory access. Smbios information stores from 0x0000f000, we can parse this area into useful data. But it can't be implemented with 32bits application in NT+ envirnoment because of OS's access protection.

2. Use driver in NT+ or vxd in 95/98

3. Run 16bits application

4. Use WMI

I wanna make a application to get smbios structure without driver, and it can be used at every platform. I can't use WMI because some OS have no WMI support (95/98/NT)

Can someone give me a little advice?

I have some source codes to dump bios written in assembly and dephi, but I can't use those resources in C/C++/VC++..
[810 byte] By [AbinLee] at [2007-11-18 1:40:47]
# 1 Re: Get smbios structure
You don't need to write a driver to access physical memory (this question has been asked multiple times on this forum):

http://www.dev-archive.com/forum/showthread.php?s=&threadid=224868

http://www.sysinternals.com/ntw2k/info/tips.shtml#KMem

Dan
DanM at 2007-11-9 13:02:49 >
# 2 Re: Get smbios structure
Thanks, Dan ..

I had tried the url you mentioned.
One is invalid and I had tested another link's sample code.

#include <windows.h>
namespace NT {extern "C" {
#include <ntddk.h>
}}
using NT::NTSTATUS;
int main(int argc, char* argv[])
{
HANDLE hSect;
WCHAR s[] = L"\\Device\\PhysicalMemory";
NT::UNICODE_STRING name = {sizeof s - sizeof (WCHAR), sizeof s, s};
NT::OBJECT_ATTRIBUTES oa = {sizeof oa, 0, &name, OBJ_CASE_INSENSITIVE, 0, 0};
NT::ZwOpenSection(&hSect, SECTION_MAP_READ, &oa);
PVOID p = MapViewOfFile(hSect, FILE_MAP_READ, 0, 0, 0x400);
return 0;
}

I could build and link successfully, but the binary can't be executed because of normal initialization error (0xc0000005)

What's wrong?

My programming envirnemnt is Win2k + VC6 + PlatformSDK + NTDDK.

Could you show me the sample codes of your own if you have?
AbinLee at 2007-11-9 13:03:49 >
# 3 Re: Get smbios structure
Both URLs worked OK for me.
I remember I used physmem long time ago and didn't encounter any problems. It comes with full source code:

http://www.sysinternals.com/files/physmem.zip

Dan
DanM at 2007-11-9 13:04:54 >
# 4 Re: Get smbios structure
The sample project works smoothly.

The url is ok, that was my ISP's problem.

Thanks for your help, the code encourages me a lot.
AbinLee at 2007-11-9 13:05:59 >