Only in dmidecode: .project diff -ur dmidecode/CHANGELOG dmidecode-2.8/CHANGELOG --- dmidecode/CHANGELOG 2006-04-24 08:50:52.000000000 -0300 +++ dmidecode-2.8/CHANGELOG 2006-02-04 14:23:04.000000000 -0200 @@ -1,11 +1,3 @@ -2006-04-20 Hugo Weber - Written the code to compile under windows NT, 2k, XP - - * dmidecode.dev: DevC++ project. Used to compile dmidecode. - get DevC++ on http://www.bloodshed.net/devcpp.html - * util.c: written mem_chunck to work on winnt, 2k, xp - * native.h: added in order to work on winnt, 2k, xp - 2006-02-04 Jean Delvare * vpddecode.c: Update lookup table from revision 2006-01-31 of IBM Only in dmidecode: CVS diff -ur dmidecode/README dmidecode-2.8/README --- dmidecode/README 2006-04-24 08:50:52.000000000 -0300 +++ dmidecode-2.8/README 2006-01-21 21:02:57.000000000 -0200 @@ -20,7 +20,7 @@ to. -** GETTING THE SOFTWARE ** +** INSTALLATION ** The home web page for dmidecode is hosted on Savannah: http://www.nongnu.org/dmidecode/ @@ -29,20 +29,7 @@ articles. This program was first written for Linux, and has since been reported to work -on FreeBSD, NetBSD, WindowsNT, Windows2000, WindowsXP, BeOS and Cygwin as well. -So far there's no suport on Windows95/98/Me and Windows 2003. - -** INSTALATION ON WINDOWS ** - -First you'll need to get the Dev-C++ on http://www.bloodshed.net/devcpp.html. -Dev-C++ uses Mingw port of GCC (GNU Compiler Collection) as it's compiler and -it's all open source. - -After installed, double click on dmidecode.dev to open the project and then -click on project -> compile. That's it, you'll get dmidecode.exe to work on -WindowsNT, Windows2000 and WindowsXP. - -** INSTALATION ON LINUX ** +on FreeBSD, NetBSD, BeOS and Cygwin as well. There's no configure script, so simply run "make" to build dmidecode, and "make install" to install it. You also can use "make uninstall" to remove Only in dmidecode-2.8: biosdecode.c Only in dmidecode: dmidecode.dev Only in dmidecode-2.8: man Only in dmidecode: native.h Only in dmidecode-2.8: ownership.c diff -ur dmidecode/util.c dmidecode-2.8/util.c --- dmidecode/util.c 2006-04-24 08:50:52.000000000 -0300 +++ dmidecode-2.8/util.c 2005-02-12 14:53:19.000000000 -0200 @@ -30,19 +30,12 @@ #include "config.h" -#ifdef __WIN32__ - #include - #include "native.h" -#else - #ifdef USE_MMAP - #include - #ifndef MAP_FAILED - #define MAP_FAILED ((void *) -1) - #endif /* !MAP_FAILED */ - #endif /* USE MMAP */ -#endif /* __WIN32__ */ - - +#ifdef USE_MMAP +#include +#ifndef MAP_FAILED +#define MAP_FAILED ((void *) -1) +#endif /* !MAP_FAILED */ +#endif /* USE MMAP */ #include #include @@ -97,250 +90,10 @@ return (sum==0); } - -#ifdef __WIN32__ -// -// Functions in NTDLL that we dynamically locate -// - -NTSTATUS (__stdcall *NtUnmapViewOfSection)( - IN HANDLE ProcessHandle, - IN PVOID BaseAddress - ); - -NTSTATUS (__stdcall *NtOpenSection)( - OUT PHANDLE SectionHandle, - IN ACCESS_MASK DesiredAccess, - IN POBJECT_ATTRIBUTES ObjectAttributes - ); - -NTSTATUS (__stdcall *NtMapViewOfSection)( - IN HANDLE SectionHandle, - IN HANDLE ProcessHandle, - IN OUT PVOID *BaseAddress, - IN ULONG ZeroBits, - IN ULONG CommitSize, - IN OUT PLARGE_INTEGER SectionOffset, /* optional */ - IN OUT PULONG ViewSize, - IN SECTION_INHERIT InheritDisposition, - IN ULONG AllocationType, - IN ULONG Protect - ); - -VOID (__stdcall *RtlInitUnicodeString)( - IN OUT PUNICODE_STRING DestinationString, - IN PCWSTR SourceString - ); - -ULONG (__stdcall *RtlNtStatusToDosError) ( - IN NTSTATUS Status - ); - -//-------------------------------------------------------- -// -// LocateNtdllEntryPoints -// -// Finds the entry points for all the functions we -// need within NTDLL.DLL. -// -//-------------------------------------------------------- -BOOLEAN LocateNtdllEntryPoints() -{ - if( !(RtlInitUnicodeString = (void *) GetProcAddress( GetModuleHandle("ntdll.dll"), - "RtlInitUnicodeString" )) ) { - - return FALSE; - } - if( !(NtUnmapViewOfSection = (void *) GetProcAddress( GetModuleHandle("ntdll.dll"), - "NtUnmapViewOfSection" )) ) { - - return FALSE; - } - if( !(NtOpenSection = (void *) GetProcAddress( GetModuleHandle("ntdll.dll"), - "NtOpenSection" )) ) { - - return FALSE; - } - if( !(NtMapViewOfSection = (void *) GetProcAddress( GetModuleHandle("ntdll.dll"), - "NtMapViewOfSection" )) ) { - - return FALSE; - } - if( !(RtlNtStatusToDosError = (void *) GetProcAddress( GetModuleHandle("ntdll.dll"), - "RtlNtStatusToDosError" )) ) { - - return FALSE; - } - return TRUE; -} - -//---------------------------------------------------------------------- -// -// PrintError -// -// Formats an error message for the last error -// -//---------------------------------------------------------------------- -void PrintError( char *message, NTSTATUS status ) -{ - char *errMsg; - - FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, RtlNtStatusToDosError( status ), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &errMsg, 0, NULL ); - printf("%s: %s\n", message, errMsg ); - LocalFree( errMsg ); -} - -//-------------------------------------------------------- -// -// UnmapPhysicalMemory -// -// Maps a view of a section. -// -//-------------------------------------------------------- -static VOID UnmapPhysicalMemory( DWORD Address ) -{ - NTSTATUS status; - - status = NtUnmapViewOfSection( (HANDLE) -1, (PVOID) Address ); - if( !NT_SUCCESS(status)) { - - PrintError("Unable to unmap view", status ); - } -} - - -//-------------------------------------------------------- -// -// MapPhysicalMemory -// -// Maps a view of a section. -// -//-------------------------------------------------------- -static BOOLEAN MapPhysicalMemory( HANDLE PhysicalMemory, - PDWORD Address, PDWORD Length, - PDWORD VirtualAddress ) -{ - NTSTATUS ntStatus; - PHYSICAL_ADDRESS viewBase; - char error[256]; - - *VirtualAddress = 0; - viewBase.QuadPart = (ULONGLONG) (*Address); - ntStatus = NtMapViewOfSection (PhysicalMemory, - (HANDLE) -1, - (PVOID) VirtualAddress, - 0L, - *Length, - &viewBase, - Length, - ViewShare, - 0, - PAGE_READONLY ); - - if( !NT_SUCCESS( ntStatus )) { - - sprintf( error, "Could not map view of %X length %X", - *Address, *Length ); - PrintError( error, ntStatus ); - return FALSE; - } - - *Address = viewBase.LowPart; - return TRUE; -} - - -//-------------------------------------------------------- -// -// OpensPhysicalMemory -// -// This function opens the physical memory device. It -// uses the native API since -// -//-------------------------------------------------------- -static HANDLE OpenPhysicalMemory() -{ - NTSTATUS status; - HANDLE physmem; - UNICODE_STRING physmemString; - OBJECT_ATTRIBUTES attributes; - WCHAR physmemName[] = L"\\device\\physicalmemory"; - - RtlInitUnicodeString( &physmemString, physmemName ); - - InitializeObjectAttributes( &attributes, &physmemString, - OBJ_CASE_INSENSITIVE, NULL, NULL ); - status = NtOpenSection( &physmem, SECTION_MAP_READ, &attributes ); - - if( !NT_SUCCESS( status )) { - - PrintError( "Could not open \\device\\physicalmemory", status ); - return NULL; - } - - return physmem; -} - /* * Copy a physical memory chunk into a memory buffer. * This function allocates memory. */ -void *mem_chunk(size_t base, size_t len, const char *devmem){ - void *p; - size_t mmoffset; - SYSTEM_INFO sysinfo; - HANDLE physmem; - DWORD paddress, vaddress, length; - - // - // Load NTDLL entry points - // - if( !LocateNtdllEntryPoints() ) { - - printf("Unable to locate NTDLL entry points.\n\n"); - return NULL; - } - - // - // Open physical memory - // - if( !(physmem = OpenPhysicalMemory())) { - return NULL; - } - - GetSystemInfo(&sysinfo); - mmoffset = base%sysinfo.dwPageSize; - len += mmoffset; - - paddress = (DWORD)base; - length = (DWORD)len; - if(!MapPhysicalMemory( physmem, &paddress, &length, &vaddress )){ - free(p); - return NULL; - } - - if((p=malloc(length))==NULL){ - return NULL; - } - - memcpy(p, (u8 *)vaddress + mmoffset, length - mmoffset); - - // - // Unmap the view - // - UnmapPhysicalMemory( vaddress ); - - // - // Close physical memory section - // - CloseHandle( physmem ); - - return p; -} -#else void *mem_chunk(size_t base, size_t len, const char *devmem) { void *p; @@ -410,4 +163,3 @@ return p; } -#endif /* __WIN32__ */ diff -ur dmidecode/util.h dmidecode-2.8/util.h --- dmidecode/util.h 2006-04-24 08:50:52.000000000 -0300 +++ dmidecode-2.8/util.h 2005-02-11 21:52:40.000000000 -0200 @@ -4,4 +4,3 @@ int checksum(const u8 *buf, size_t len); void *mem_chunk(size_t base, size_t len, const char *devmem); - Only in dmidecode-2.8: vpddecode.c Only in dmidecode-2.8: vpdopt.c Only in dmidecode-2.8: vpdopt.h