#include <windows.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <ntddk.h>
#include <pshpack1.h>
#include <poppack.h>
Go to the source code of this file.
◆ CM_PNP_BIOS_DEVICE_NODE
◆ CM_PNP_BIOS_INSTALLATION_CHECK
◆ PCM_PNP_BIOS_DEVICE_NODE
◆ PCM_PNP_BIOS_INSTALLATION_CHECK
◆ PNP_ID_NAME
◆ PPNP_ID_NAME
◆ GetDeviceName()
static char* GetDeviceName |
( |
char * |
PnpId | ) |
|
|
static |
Definition at line 240 of file pnpdump.c.
253 return "Unknown Device";
int strcmp(const char *String1, const char *String2)
static PNP_ID_NAME PnpName[]
Referenced by PrintDeviceData().
◆ GetPnpKey()
Definition at line 258 of file pnpdump.c.
271 "HARDWARE\\DESCRIPTION\\System\\MultifunctionAdapter",
277 for (dwBus = 0; ; dwBus++)
279 sprintf(szBuffer,
"%lu", dwBus);
#define sprintf(buf, format,...)
LONG WINAPI RegCloseKey(HKEY hKey)
_Check_return_ _CRTIMP int __cdecl stricmp(_In_z_ const char *_Str1, _In_z_ const char *_Str2)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
#define HKEY_LOCAL_MACHINE
Referenced by main().
◆ main()
hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com
Definition at line 670 of file pnpdump.c.
681 DWORD dwResourceSize;
693 printf(
"This utility prints the PnP-nodes from the registry\n");
694 printf(
"\"/s\" prevents the \"Press any key\"\n\n");
701 printf(
"Failed to get PnP-BIOS key\n");
707 printf(
"Found PnP-BIOS key\n");
715 printf(
"Error: malloc() failed\n");
723 "Configuration Data",
733 printf(
"Error: realloc() of %u bytes failed\n", (
unsigned)
dwSize);
742 printf(
"Failed to read 'Configuration Data' value\n");
754 if (
lpBuffer->PartialResourceList.Count == 0)
756 printf(
"Invalid resource count!\n");
763 dwResourceSize =
lpBuffer->PartialResourceList.PartialDescriptors[0].u.DeviceSpecificData.DataSize;
775 printf(
"Error: Invalid PnP signature\n");
785 if (lpDevNode->
Size == 0)
787 printf(
"Error: Device node size is zero!\n");
792 printf(
"Node: %x Size %hu (0x%hx)\n",
802 while (dwDataSize < dwResourceSize)
804 if (lpDevNode->
Size == 0)
807 printf(
"Node: %x Size %hu (0x%hx)\n",
812 dwDataSize += lpDevNode->
Size;
818 printf(
"\n Press any key...\n");
829 while (dwDataSize < dwResourceSize)
831 if (lpDevNode->
Size == 0)
838 printf(
"\n Press any key...\n");
846 dwDataSize += lpDevNode->
Size;
struct _CM_PNP_BIOS_INSTALLATION_CHECK * PCM_PNP_BIOS_INSTALLATION_CHECK
LONG GetPnpKey(PHKEY PnpKey)
struct _CM_PNP_BIOS_DEVICE_NODE * PCM_PNP_BIOS_DEVICE_NODE
LONG WINAPI RegCloseKey(HKEY hKey)
static TAGREF LPCWSTR LPDWORD LPVOID lpBuffer
struct _CM_PNP_BIOS_INSTALLATION_CHECK CM_PNP_BIOS_INSTALLATION_CHECK
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
_Check_return_ _CRTIMP int __cdecl getch(void)
void PrintDeviceData(PCM_PNP_BIOS_DEVICE_NODE DeviceNode)
int strcmp(const char *String1, const char *String2)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
◆ PnpDecodeDma()
Definition at line 343 of file pnpdump.c.
345 unsigned char DmaChannel;
346 unsigned char DmaStatus;
355 for (
i = 0;
i < 8;
i++)
357 if (DmaChannel & (1 <<
i))
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by PrintDeviceData().
◆ PnpDecodeFixedIoPort()
Definition at line 396 of file pnpdump.c.
403 IoPort += (*
Ptr << 8);
407 printf(
" Fixed I/O Port descriptor\n");
408 printf(
" PortBase 0x%hx Length 0x%x\n",
414 printf(
" Fixed location I/O Port descriptor: 0x%x\n",
419 printf(
" Fixed location I/O Port descriptor: 0x%x - 0x%x\n",
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Referenced by PrintDeviceData().
◆ PnpDecodeFixedMemory()
Definition at line 518 of file pnpdump.c.
544 printf(
" 32-Bit fixed location memory range descriptor\n");
545 printf(
" Base 0x%lx Length 0x%lx Flags 0x%02x\n",
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Referenced by PrintDeviceData().
◆ PnpDecodeIoPort()
Definition at line 368 of file pnpdump.c.
379 MinBase += (*
Ptr << 8);
383 MaxBase += (*
Ptr << 8);
389 printf(
" I/O Port descriptor\n");
390 printf(
" MinBase 0x%x MaxBase 0x%x Align %u Length %u\n",
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
Referenced by PrintDeviceData().
◆ PnpDecodeIrq()
Definition at line 319 of file pnpdump.c.
326 IrqMask |= (*
Ptr << 8);
330 for (
i = 0;
i < 16;
i++)
332 if (IrqMask & (1 <<
i))
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by PrintDeviceData().
◆ PnpDecodeMemory16()
Definition at line 428 of file pnpdump.c.
441 MinBase += (*
Ptr << 8);
446 MaxBase += (*
Ptr << 8);
458 printf(
" 16-Bit memory range descriptor\n");
459 printf(
" MinBase 0x%hx MaxBase 0x%hx Align 0x%hx Length 0x%hx Flags 0x%02x\n",
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Referenced by PrintDeviceData().
◆ PnpDecodeMemory32()
Definition at line 465 of file pnpdump.c.
478 MinBase += (*
Ptr << 8);
480 MinBase += (*
Ptr << 16);
482 MinBase += (*
Ptr << 24);
487 MaxBase += (*
Ptr << 8);
489 MaxBase += (*
Ptr << 16);
491 MaxBase += (*
Ptr << 24);
511 printf(
" 32-Bit memory range descriptor\n");
512 printf(
" MinBase 0x%lx MaxBase 0x%lx Align 0x%lx Length 0x%lx Flags 0x%02x\n",
_In_ ULONG _In_ ULONG _In_ ULONG Length
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Referenced by PrintDeviceData().
◆ PrintDeviceData()
Definition at line 550 of file pnpdump.c.
554 unsigned int TagSize;
555 unsigned int TagType;
559 printf (
"Node: %x Size %hu (0x%hx)\n",
566 PnpId[0] = ((
Id[0] >> 2) & 0x1F) + 0x40;
567 PnpId[1] = ((
Id[0] << 3) & 0x18) +
568 ((
Id[1] >> 5) & 0x07) + 0x40;
569 PnpId[2] = (
Id[1] & 0x1F) + 0x40;
571 PnpId[3] =
Hex[(
Id[2] >> 4) & 0xF];
572 PnpId[4] =
Hex[
Id[2] & 0x0F];
574 PnpId[5] =
Hex[(
Id[3] >> 4) & 0x0F];
575 PnpId[6] =
Hex[
Id[3] & 0x0F];
588 TagType = *
Ptr & 0x7F;
592 TagSize += (*
Ptr << 16);
611 printf(
" Large tag: type %u size %u\n",
619 TagType = (*
Ptr >> 3) & 0x0F;
620 TagSize = *
Ptr & 0x07;
626 printf(
" Logical device ID\n");
630 printf(
" Compatible device ID\n");
653 printf(
" Small tag: type %u size %u\n",
static VOID PnpDecodeIoPort(unsigned char *Ptr)
static VOID PnpDecodeMemory16(unsigned char *Ptr)
static VOID PnpDecodeFixedMemory(unsigned char *Ptr)
_Must_inspect_result_ _In_ PFSRTL_PER_STREAM_CONTEXT Ptr
static VOID PnpDecodeDma(unsigned char *Ptr)
static char * GetDeviceName(char *PnpId)
static VOID PnpDecodeIrq(unsigned char *Ptr)
#define memcpy(s1, s2, n)
static VOID PnpDecodeFixedIoPort(unsigned char *Ptr)
static VOID PnpDecodeMemory32(unsigned char *Ptr)
Referenced by main().
◆ Hex
char Hex[] = "0123456789ABCDEF" |
|
static |
◆ PnpName