Hi, i’m new to driver development and trying to create system threads in my driver,but the compiler is giving me the error C4028: formal parameter 1 different from declaration ,but i see no problem with that parameter which is of HANDLE type and also it compiled without any error in old DDK but with latest DDK the problem persists.Do i have to include any header file for this to compile in latest DDK? Can someone here help me to get through this error please?
How about posting your code?
mm
xxxxx@gmail.com wrote:
Hi, i’m new to driver development and trying to create system threads in my driver,but the compiler is giving me the error C4028: formal parameter 1 different from declaration ,but i see no problem with that parameter which is of HANDLE type and also it compiled without any error in old DDK but with latest DDK the problem persists.Do i have to include any header file for this to compile in latest DDK? Can someone here help me to get through this error please?
As someone else wrote, post the code. The most common error is using a
handle for the first parameter when it should be a pointer to a handle.
wrote in message news:xxxxx@ntdev…
> Hi, i’m new to driver development and trying to create system threads in
> my driver,but the compiler is giving me the error C4028: formal parameter
> 1 different from declaration ,but i see no problem with that parameter
> which is of HANDLE type and also it compiled without any error in old DDK
> but with latest DDK the problem persists.Do i have to include any header
> file for this to compile in latest DDK? Can someone here help me to get
> through this error please?
>
Yes david i’ve passed a pointer to the handle by passing it by reference.Have a look at my thread code.
HANDLE ThreadHandle ;
ntStatus = PsCreateSystemThread ( &ThreadHandle, 0, NULL, NULL, NULL, ADriveHookThread, NULL ) ; -> error C4028: formal parameter 1 different from declaration
-
How about you post the rest of the function.
-
What files are you including in the source file in which this function is defined? If it’s anything (Microsoft, that is) but
‘wdm.h,’ ‘ntddk.h’ or ‘ntifs.h,’ you’re probably doing something wrong. -
What version of the WDK are you using?
-
What BUILD environment are you using? It should be something like ‘BUILD -ceZ.’ If you’re not using BUILD, you’re on your own.
-
What command are you using to BUILD this (i. e. - BUILD -ceZ)?
-
Are you sure that this worked before? The reason I ask is that passing ‘0’ for AccessMask (format parameter 2) seems unlikely
to be valid or at least useful. It’s possible that 0 encodes something special that I don’t know about, but either way, why aren’t
you using the manifest constants (i. e. - GENERIC_READ, GENERIC_WRITE, et. c.)? When you do things like this, it makes people
suspect that you’re doing something very non-standard, especially given the compile error your getting.
mm
xxxxx@gmail.com wrote:
Yes david i’ve passed a pointer to the handle by passing it by reference.Have a look at my thread code.
HANDLE ThreadHandle ;
ntStatus = PsCreateSystemThread ( &ThreadHandle, 0, NULL, NULL, NULL, ADriveHookThread, NULL ) ; -> error C4028: formal parameter 1 different from declaration
I wrote a simple basic driver just to check if PsCreateSystemThread() works atleast in this ,but seems like the problem is not with my code but with DDK.
-
I’m including ntddk.h in the source file.
-
I’m using DDK 3790.1830
4)I’m using Server 2003 checked 64 bit Build environment
-
Build -cefbw
-
Yes it compiles perfectly in Windows? 2000 Driver Development Kit without any errors. I have to port it to 64 bit architecture,the problem comes with the latest DDK.
You should use the latest (Srv08) WDK.
The Srv03 SP1 DDK is obsolete.
- S
-----Original Message-----
From: xxxxx@gmail.com
Sent: Saturday, October 11, 2008 03:26
To: Windows System Software Devs Interest List
Subject: RE:[ntdev] Error with PsCreateSystemThread
I wrote a simple basic driver just to check if PsCreateSystemThread() works atleast in this ,but seems like the problem is not with my code but with DDK.
2) I’m including ntddk.h in the source file.
3) I’m using DDK 3790.1830
4)I’m using Server 2003 checked 64 bit Build environment
5) Build -cefbw
6) Yes it compiles perfectly in Windows? 2000 Driver Development Kit without any errors. I have to port it to 64 bit architecture,the problem comes with the latest DDK.
—
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
There is NO “latest DDK”. This is the LAST DDK, which is long obsolete
except for NDIS 5 drivers and some historical reference, if needed. The
current one is called the Windows Driver Kit (WDK) and was released in March
of this year. Try connect.microsoft.com.
There is no “Sever 23003 checked 64 bit Build environment”. Which one are
you using? I would consider: “Windows Server 2003 Checked x64 Build
Environment”. Probably not the IA-64 variation unless you happen to have an
Itanium sitting around and are an adventurer.
wrote in message news:xxxxx@ntdev…
I wrote a simple basic driver just to check if PsCreateSystemThread() works
atleast in this ,but seems like the problem is not with my code but with
DDK.
2) I’m including ntddk.h in the source file.
3) I’m using DDK 3790.1830
4)I’m using Server 2003 checked 64 bit Build environment
5) Build -cefbw
6) Yes it compiles perfectly in Windows® 2000 Driver Development Kit without
any errors. I have to port it to 64 bit architecture,the problem comes with
the latest DDK.
I tried compiling with WDK 6001.18001 but the problem is same ![]()
Hey guys problem solved!!! the problem was not with the first parameter but 6th. Surprisingly latest DDK fired error at 1st parameter instead of 6th.
ntStatus = PsCreateSystemThread ( &ThreadHandle , GENERIC_ALL, NULL, NULL, NULL,(PKSTART_ROUTINE) ADriveHookThread, NULL ) ; -> Solved the problem.
xxxxx@gmail.com wrote:
Hey guys problem solved!!! the problem was not with the first parameter but 6th. Surprisingly latest DDK fired error at 1st parameter instead of 6th.
ntStatus = PsCreateSystemThread ( &ThreadHandle , GENERIC_ALL, NULL, NULL, NULL,(PKSTART_ROUTINE) ADriveHookThread, NULL ) ; -> Solved the problem.
The compiler was probably complaining that the 1st parameter of
ADriveHookThread didn’t match PKSTART_ROUTINE, not that the 1st
parameter of PsCreateSystemThread didn’t match.
–
Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.