Format Parameters of DbgPrint

Hi All,

I am making some modification in the filespy code.
I used the statement

DbgPrint( ( “The buffer Length-
%lu\n”, pIrpStack->Parameters.QueryFile.Length) );

and getting the error

fspyhash.c(431) : error C2220: warning treated as error - no object file
generated
fspyhash.c(431) : error C4047: ‘function’ : ‘PCH’ differs in levels of
indirection from ‘ULONG’

I think there is some error in precompiled header file.

In the following similar case in the same routine I am getting no error.
DbgPrint( " ******%lu \n", QueryBuffer->FileNameLength );

Where can I get help on the format parameters of DbgPrint.

Please help.
Lalit.

Lalit,

This looks like a programming error to me.

In the first case, you are passing a single parameter - it is a ULONG
(pIrpStack->Parameters.QueryFile.Length) and in the second case you are
passing two parameters, the first is a char * (PCH) and the second is a
ULONG.

I’d try rewriting your first DbgPrint:

DbgPrint( “The buffer Length-
%lu\n”, pIrpStack->Parameters.QueryFile.Length);

This way your first parameter is a char *, and the second is a ULONG.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Lalit S. Rana [mailto:xxxxx@epatra.com]
Sent: Tuesday, May 13, 2003 10:02 AM
To: File Systems Developers
Subject: [ntfsd] Format Parameters of DbgPrint

Hi All,

I am making some modification in the filespy code.
I used the statement

DbgPrint( ( “The buffer Length-
%lu\n”, pIrpStack->Parameters.QueryFile.Length) );

and getting the error

fspyhash.c(431) : error C2220: warning treated as error - no object file
generated
fspyhash.c(431) : error C4047: ‘function’ : ‘PCH’ differs in levels of
indirection from ‘ULONG’

I think there is some error in precompiled header file.

In the following similar case in the same routine I am getting no error.
DbgPrint( " ******%lu \n", QueryBuffer->FileNameLength );

Where can I get help on the format parameters of DbgPrint.

Please help.
Lalit.


You are currently subscribed to ntfsd as: xxxxx@osr.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

I had the same problem when modifying filemon. The reason was that
DbgPrint is a system function and also was a macro defined in filemon.h.
The macro needed the double paranthesis to be able to call the original
DbgPrint with all the arguments. But if the header was not included in
the newly added source file the linker called the original DbgPrint with
only one argument, meaning the last from the list (arg1, arg2,…argn).
I changed the name of the macro in DbgPrintM to eliminate the confusion.

Daniel

Lalit S. Rana wrote:

Hi All,

I am making some modification in the filespy code.
I used the statement

DbgPrint( ( “The buffer Length-
%lu\n”, pIrpStack->Parameters.QueryFile.Length) );

and getting the error

fspyhash.c(431) : error C2220: warning treated as error - no object file
generated
fspyhash.c(431) : error C4047: ‘function’ : ‘PCH’ differs in levels of
indirection from ‘ULONG’

I think there is some error in precompiled header file.

In the following similar case in the same routine I am getting no error.
DbgPrint( " ******%lu \n", QueryBuffer->FileNameLength );

Where can I get help on the format parameters of DbgPrint.

Please help.
Lalit.


You are currently subscribed to ntfsd as: xxxxx@ipdevel.ro
To unsubscribe send a blank email to xxxxx@lists.osr.com

The second example uses only one paren. And the first uses two.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Lalit S. Rana
Sent: Tuesday, May 13, 2003 7:02 AM
To: File Systems Developers
Subject: [ntfsd] Format Parameters of DbgPrint

Hi All,

I am making some modification in the filespy code.
I used the statement

DbgPrint( ( “The buffer Length-
%lu\n”, pIrpStack->Parameters.QueryFile.Length) );

and getting the error

fspyhash.c(431) : error C2220: warning treated as error - no object file
generated
fspyhash.c(431) : error C4047: ‘function’ : ‘PCH’ differs in levels of
indirection from ‘ULONG’

I think there is some error in precompiled header file.

In the following similar case in the same routine I am getting no error.
DbgPrint( " ******%lu \n", QueryBuffer->FileNameLength );

Where can I get help on the format parameters of DbgPrint.

Please help.
Lalit.


You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com