Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

OSR is Hiring! Click here to find out more.

Upcoming OSR Seminars:
Writing WDF Drivers for Windows Lab, Palo Alto, CA 28 April-2 May, 2014
Advanced WDF Driver Lab, Palo Alto, CA 5-8 May, 2014
Developing File Systems for Windows, Boston/Waltham, MA 13-16 May, 2014
Windows Internals & Software Drivers Lab, Dulles/Sterling, VA, CA 23-27 June, 2014


Go Back   OSR Online Lists > ntdev
Welcome, Guest
You must login to post to this list
  Message 1 of 7  
02 Jul 12 03:49
ntdev member 131533
xxxxxx@gmail.com
Join Date:
Posts To This List: 6
WPP's Custom Enumeration Type

Hello, I want to define custom enumeration types for pre-defined enumerations in WDK's header files (e.g. PROCESSINFOCLASS in ntddk.h, NDIS_MEDIUM in ntddndis.h). I added following codes to tracedrv.h in WDK's tracedrv sample : #include <ntddk.h> #include <ntddndis.h> ... // begin_wpp config // CUSTOM_TYPE(ProcessInfoClass, ItemEnum(PROCESSINFOCLASS)); // CUSTOM_TYPE(NdisMedium, ItemEnum(NDIS_MEDIUM)); // end_wpp I then used this, like so : PROCESSINFOCLASS processInfoClass = ProcessConsoleHostProcess; NDIS_MEDIUM ndisMedium = NdisPhysicalMediumWirelessWan; DoTraceMessage(FLAG_ONE, "%!ProcessInfoClass!", processInfoClass); DoTraceMessage(FLAG_ONE, "%!NdisMedium!", ndisMedium); But, TraceView displays integer values, instead of textual names of enumerations above. So, I tried to add -scan parameters to RUN_WPP macro in sources file. RUN_WPP = ... -scan:ntddk.h -scan:ntddndis.h ... As a result, I've got following errors messages. 1>1>d:\testprojects\tracing\tracedrv\wpp : error : (WppCreateFile)Cannot open file ntddk.h, error 2 1>1>d:\testprojects\tracing\tracedrv\wpp : error : (WppCreateFile)Cannot open file ntddndis.h, error 2 Can WPP find header files which isn't in local directory? Any help would be appreciated. Thanks in advance.
  Message 2 of 7  
02 Jul 12 10:05
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 8858
RE: WPP's Custom Enumeration Type

Use a fully qualified path, RUN_WPP = ... -scan:$(ddk_inc_path)\ntddk.h d debt from my phone ________________________________ From: xxxxx@gmail.com Sent: 7/2/2012 12:48 AM To: Windows System Software Devs Interest List Subject: [ntdev] WPP's Custom Enumeration Type Hello, I want to define custom enumeration types for pre-defined enumerations in WDK's header files (e.g. PROCESSINFOCLASS in ntddk.h, NDIS_MEDIUM in ntddndis.h). I added following codes to tracedrv.h in WDK's tracedrv sample : #include <ntddk.h> #include <ntddndis.h> ... // begin_wpp config // CUSTOM_TYPE(ProcessInfoClass, ItemEnum(PROCESSINFOCLASS)); // CUSTOM_TYPE(NdisMedium, ItemEnum(NDIS_MEDIUM)); // end_wpp I then used this, like so : PROCESSINFOCLASS processInfoClass = ProcessConsoleHostProcess; NDIS_MEDIUM ndisMedium = NdisPhysicalMediumWirelessWan; DoTraceMessage(FLAG_ONE, "%!ProcessInfoClass!", processInfoClass); DoTraceMessage(FLAG_ONE, "%!NdisMedium!", ndisMedium); But, TraceView displays integer values, instead of textual names of enumerations above. So, I tried to add -scan parameters to RUN_WPP macro in sources file. RUN_WPP = ... -scan:ntddk.h -scan:ntddndis.h ... As a result, I've got following errors messages. 1>1>d:\testprojects\tracing\tracedrv\wpp : error : (WppCreateFile)Cannot open file ntddk.h, error 2 1>1>d:\testprojects\tracing\tracedrv\wpp : error : (WppCreateFile)Cannot open file ntddndis.h, error 2 Can WPP find header files which isn't in local directory? Any help would be appreciated. Thanks in advance. --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --
  Message 3 of 7  
02 Jul 12 21:26
ntdev member 131533
xxxxxx@gmail.com
Join Date:
Posts To This List: 6
RE: WPP's Custom Enumeration Type

Thanks for your answer. As you said, I used a fully qualified path. WPP then found correct header file path. But, WPP spited out another error message. 1>1>c:\winddk\7600.16385.1\inc\ddk\ntddk.h(1604) : error : (ParseConfigCallback)Function while is already defined 1>1>c:\winddk\7600.16385.1\inc\ddk\ndis.h(2289) : error : (ParseConfigCallback)Function MmGetMdlByteCount is already defined What does this error message mean?
  Message 4 of 7  
02 Jul 12 22:24
Doron Holan
xxxxxx@microsoft.com
Join Date: 08 Sep 2005
Posts To This List: 8858
RE: WPP's Custom Enumeration Type

Probably that a previous -scan header on the command line includes these files and you are getting multiple definitions. What it probably fundamentally means is that even if you get rid of the multiple definition errors, you will still not get the functionality you want because wpp -scan is already scanning these headers and not expanding the custom types as is. d debt from my phone ________________________________ From: xxxxx@gmail.com Sent: 7/2/2012 6:26 PM To: Windows System Software Devs Interest List Subject: RE:[ntdev] WPP's Custom Enumeration Type Thanks for your answer. As you said, I used a fully qualified path. WPP then found correct header file path. But, WPP spited out another error message. 1>1>c:\winddk\7600.16385.1\inc\ddk\ntddk.h(1604) : error : (ParseConfigCallback)Function while is already defined 1>1>c:\winddk\7600.16385.1\inc\ddk\ndis.h(2289) : error : (ParseConfigCallback)Function MmGetMdlByteCount is already defined What does this error message mean? --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --
  Message 5 of 7  
03 Jul 12 15:42
AlexBe
xxxxxx@microsoft.com
Join Date: 23 Jul 2009
Posts To This List: 57
RE: WPP's Custom Enumeration Type

Information needed to decode the "enum" is extracted from the PDB file, which means that WPP does not need to scan the file containing the enum definition (e.g. ntddk.h). The file which needs to be scanned is the one which has begin_wpp/end_wpp goo, which I am guessing you were already doing since traces with !%ProcessInfoClass% compiled corectly. In your case the problem is that WPP decoder does not do a good job handling typedefs. PROCESSINFOCLASS is a typedef for _PROCESSINFOCLASS). Remove scan of the ntddk.h and change your wpp config to say as below (note the underscore) // begin_wpp config // CUSTOM_TYPE(ProcessInfoClass, ItemEnum(_PROCESSINFOCLASS)); // CUSTOM_TYPE(NdisMedium, ItemEnum(_NDIS_MEDIUM)); // end_wpp And it should get decoded correctly. You can verify that by running tracepdb to extract the TMF files and making sure that TMF has something like. #enumv _PROCESSINFOCLASS { ProcessBasicInformation,0x0 ProcessQuotaLimits,0x1 ProcessIoCounters,0x2 ProcessVmCounters,0x3 ProcessTimes,0x4 ProcessBasePriority,0x5 ProcessRaisePriority,0x6 ProcessDebugPort,0x7 ProcessExceptionPort,0x8 ProcessAccessToken,0x9 ProcessLdtInformation,0xA ProcessLdtSize,0xB ProcessDefaultHardErrorMode,0xC ProcessIoPortHandlers,0xD ProcessPooledUsageAndLimits,0xE ProcessWorkingSetWatch,0xF ProcessUserModeIOPL,0x10 ProcessEnableAlignmentFaultFixup,0x11 ProcessPriorityClass,0x12 ProcessWx86Information,0x13 ProcessHandleCount,0x14 ProcessAffinityMask,0x15 ProcessPriorityBoost,0x16 ProcessDeviceMap,0x17 ProcessSessionInformation,0x18 ProcessForegroundInformation,0x19 ProcessWow64Information,0x1A ProcessImageFileName,0x1B ProcessLUIDDeviceMapsEnabled,0x1C ProcessBreakOnTermination,0x1D ProcessDebugObjectHandle,0x1E ProcessDebugFlags,0x1F ProcessHandleTracing,0x20 ProcessIoPriority,0x21 ProcessExecuteFlags,0x22 ProcessTlsInformation,0x23 ProcessCookie,0x24 ProcessImageInformation,0x25 ProcessCycleTime,0x26 ProcessPagePriority,0x27 ProcessInstrumentationCallback,0x28 ProcessThreadStackAllocation,0x29 ProcessWorkingSetWatchEx,0x2A ProcessImageFileNameWin32,0x2B ProcessImageFileMapping,0x2C ProcessAffinityUpdateMode,0x2D ProcessMemoryAllocationMode,0x2E ProcessGroupInformation,0x2F ProcessTokenVirtualizationEnabled,0x30 ProcessConsoleHostProcess,0x31 ProcessWindowInformation,0x32 ProcessHandleInformation,0x33 ProcessMitigationPolicy,0x34 ProcessDynamicFunctionTableInformation,0x35 ProcessHandleCheckingMode,0x36 ProcessKeepAliveCount,0x37 ProcessRevokeFileHandles,0x38 ProcessWorkingSetControl,0x39 MaxProcessInfoClass,0x3A } From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan Sent: Monday, July 02, 2012 7:05 AM To: Windows System Software Devs Interest List Subject: RE: [ntdev] WPP's Custom Enumeration Type Use a fully qualified path, RUN_WPP = ... -scan:$(ddk_inc_path)\ntddk.h d debt from my phone ________________________________ From: xxxxx@gmail.com Sent: 7/2/2012 12:48 AM To: Windows System Software Devs Interest List Subject: [ntdev] WPP's Custom Enumeration Type Hello, I want to define custom enumeration types for pre-defined enumerations in WDK's header files (e.g. PROCESSINFOCLASS in ntddk.h, NDIS_MEDIUM in ntddndis.h). I added following codes to tracedrv.h in WDK's tracedrv sample : #include <ntddk.h> #include <ntddndis.h> ... // begin_wpp config // CUSTOM_TYPE(ProcessInfoClass, ItemEnum(PROCESSINFOCLASS)); // CUSTOM_TYPE(NdisMedium, ItemEnum(NDIS_MEDIUM)); // end_wpp I then used this, like so : PROCESSINFOCLASS processInfoClass = ProcessConsoleHostProcess; NDIS_MEDIUM ndisMedium = NdisPhysicalMediumWirelessWan; DoTraceMessage(FLAG_ONE, "%!ProcessInfoClass!", processInfoClass); DoTraceMessage(FLAG_ONE, "%!NdisMedium!", ndisMedium); But, TraceView displays integer values, instead of textual names of enumerations above. So, I tried to add -scan parameters to RUN_WPP macro in sources file. RUN_WPP = ... -scan:ntddk.h -scan:ntddndis.h ... As a result, I've got following errors messages. 1>1>d:\testprojects\tracing\tracedrv\wpp : error : (WppCreateFile)Cannot open file ntddk.h, error 2 1>1>d:\testprojects\tracing\tracedrv\wpp : error : (WppCreateFile)Cannot open file ntddndis.h, error 2 Can WPP find header files which isn't in local directory? Any help would be appreciated. Thanks in advance. --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --
  Message 6 of 7  
03 Jul 12 15:44
AlexBe
xxxxxx@microsoft.com
Join Date: 23 Jul 2009
Posts To This List: 57
RE: WPP's Custom Enumeration Type

I just replied to the other fork of this thread with info on what the problem is, there is no need to scan ntddk.h.... Thanks, Alex From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Doron Holan Sent: Monday, July 02, 2012 7:24 PM To: Windows System Software Devs Interest List Subject: RE: [ntdev] WPP's Custom Enumeration Type Probably that a previous -scan header on the command line includes these files and you are getting multiple definitions. What it probably fundamentally means is that even if you get rid of the multiple definition errors, you will still not get the functionality you want because wpp -scan is already scanning these headers and not expanding the custom types as is. d debt from my phone ________________________________ From: xxxxx@gmail.com Sent: 7/2/2012 6:26 PM To: Windows System Software Devs Interest List Subject: RE:[ntdev] WPP's Custom Enumeration Type Thanks for your answer. As you said, I used a fully qualified path. WPP then found correct header file path. But, WPP spited out another error message. 1>1>c:\winddk\7600.16385.1\inc\ddk\ntddk.h(1604) : error : (ParseConfigCallback)Function while is already defined 1>1>c:\winddk\7600.16385.1\inc\ddk\ndis.h(2289) : error : (ParseConfigCallback)Function MmGetMdlByteCount is already defined What does this error message mean? --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --- NTDEV is sponsored by OSR For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer --
  Message 7 of 7  
03 Jul 12 21:03
ntdev member 131533
xxxxxx@gmail.com
Join Date:
Posts To This List: 6
RE: WPP's Custom Enumeration Type

Thank you so much! It works well.
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntdev list to be able to post.

All times are GMT -5. The time now is 10:30.


Copyright ©2014, OSR Open Systems Resources, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license