Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Printing Line number with WDK
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mark Scott  
View profile  
 More options Apr 6 2010, 6:48 am
Newsgroups: microsoft.public.development.device.drivers
From: Mark Scott <mrk...@gmail.com>
Date: Tue, 6 Apr 2010 03:48:10 -0700 (PDT)
Local: Tues, Apr 6 2010 6:48 am
Subject: Printing Line number with WDK
I am trying to print the line numbers using __LINE__ in DbgPrint,
however it does not seem to be working.
I am using WDK 7600.16385.1 for x86 Windows7 build.

The statement
DbgPrint(( __LINE__ "\n" ));
results in compilation error
error C2143: syntax error : missing ')' before 'string'
warning C4047: 'function' : 'PCSTR' differs in levels of indirection
from 'int'
warning C4024: 'DbgPrint' : different types for formal and actual
parameter 1

while the statement
DbgPrint(( "%d \n", __LINE__ ));
gives the following compilation warnings (errors):
warning C4047: 'function' : 'PCSTR' differs in levels of indirection
from 'int'
warning C4047: 'function' : 'PCSTR' differs in levels of indirection
from 'int'
warning C4024: 'DbgPrint' : different types for formal and actual
parameter 1
warning C4024: 'DbgPrint' : different types for formal and actual
parameter 1

Can any one point me if there is any problem in my code (DbgPrint
statements).
I have not faced this problem with earlier versions of WDK/DDK on
Vista

Thanks,
Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kalle Olavi Niemitalo  
View profile  
 More options Apr 6 2010, 6:21 pm
Newsgroups: microsoft.public.development.device.drivers
From: Kalle Olavi Niemitalo <k...@iki.fi>
Date: Wed, 07 Apr 2010 01:21:08 +0300
Local: Tues, Apr 6 2010 6:21 pm
Subject: Re: Printing Line number with WDK

Mark Scott <mrk...@gmail.com> writes:
> DbgPrint(( "%d \n", __LINE__ ));

Either use fewer parentheses or switch to KdPrint.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
alberto  
View profile  
 More options Apr 7 2010, 2:23 pm
Newsgroups: microsoft.public.development.device.drivers
From: alberto <amore...@ieee.org>
Date: Wed, 7 Apr 2010 11:23:05 -0700 (PDT)
Local: Wed, Apr 7 2010 2:23 pm
Subject: Re: Printing Line number with WDK

In my driver I use __LINE__ as a parameter to  RtlStringCchPrintfA and
it works fine. But I don't use any extra parenthesis, and I let my
format string issue the \n.

Hope this helps,

Alberto.

On Apr 6, 6:48 am, Mark Scott <mrk...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Roberts  
View profile  
 More options Apr 8 2010, 1:27 am
Newsgroups: microsoft.public.development.device.drivers
From: Tim Roberts <t...@probo.com>
Date: Wed, 07 Apr 2010 22:27:35 -0700
Local: Thurs, Apr 8 2010 1:27 am
Subject: Re: Printing Line number with WDK

You have two problems.  First, DbgPrint is a real function, and thus only
takes one set of parens.  KdPrint is a macro, and requires two sets.

Second, just as the error message says, __LINE__ is an integer, not a
string.  You can't pass it where a string is expected.

>I have not faced this problem with earlier versions of WDK/DDK on
>Vista

You probably used KdPrint instead of DbgPrint.
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »