Search code examples
c++winapidriverkmdf

Compilation warnings in driver after including ksmedia.h


I'm developing a driver bases on Microsoft's Toaster KMDF filter driver example. I've included the headers windef.h, ks.h, ksmedia.h, and now I'm seeing the following warnings:

Warning #1:

\\...\ksmedia.h(732): warning RC4011: identifier truncated to 'STATIC_KSDATAFORMAT_SUBTYPE_WAV'

Line 732 of ksmedia.h reads:

#if !defined( STATIC_KSDATAFORMAT_SUBTYPE_WAVEFORMATEX )

Warning #2:

\\...\ksmedia.h(7795): warning RC4067: unexpected characters following '#endif' directive; newline expected

Line 7795 of ksmedia.h reads:

#endif _AUDIO_CURVE_TYPE_

That happens even though I have another project (not KMDF) which includes the header files, and doesn't display the warnings.

Can you help me understand the reason for this? Can I do something to remove the warnings?


Solution

  • based on your error, i can say that you direct or indirect (via another include) add line:

    #include <ksmedia.h>
    

    in rc file. when RC (Resource Compiler) process ksmedia.h he give exactly this warnings and errors. because ksmedia.h not designed to be processed by RC compiler. also include windows.h and filter.h to rc (as in example) also error by sense. if need some definitions/macros for RC - include winres.h only