|
Hi All,
Can you please tell me, what all the things i need to take care when i am trying to port my device driver 32 bit to windows 7 64 bit?
|
|
|
|
|
Googling with following phases seems to turn up results.
how to convert from 32bit to 64bit windows 7
gotchas converting from 32bit to 64bit windows 7
tutorial converting from 32bit to 64bit windows 7
converting 32bit to 64bit windows 7 site:codeproject.com
Last of those turned up the following (could be more.)
Lessons on development of 64-bit C/C++ applications[^]
|
|
|
|
|
...except this is a driver, not an app...
|
|
|
|
|
|
Thanks for the reply.
In our case we have a different types of data types used in the app(ie UINT8,UINT16,UINT32) and the different types of pointers(ie PUINT8,PUINT16,PUINT32).Here do i need to change the types to 64 or not?Because i am getting the crashes in the driver driver in different places.
|
|
|
|
|
Yea. You must.
Be careful when performing unsigned and signed operations. Consider the following:
ULONG x;
LONG y;
LONG *pVar1;
LONG *pVar2;
pVar2 = pVar1 + y * (x - 1);
The problem arises because x is unsigned, which makes the entire expression unsigned. This works fine unless y is negative.
In this case, y is converted to an unsigned value, the expression is evaluated using 32-bit precision, scaled, and added to pVar1.
On 64-bit Windows, this 32-bit unsigned negative number becomes a large 64-bit positive number, which gives the wrong result.
To fix this problem, declare x as a signed value or explicitly typecast it to LONG in the expression.
|
|
|
|
|
Thanks for the reply,
in case of pointers for eg PUINT8 OR PUINT16 do i need to change the datatypes to PUINT32 or PUINT64?
and for normal variables UINT8 OR UINT16 do i need to change the datatypes to UINT32 or UINT64?
if not in which cases i have to change the data types.
I am totally new to the drivers programming,Please suggest me some links.
|
|
|
|
|
Use size_t types pretty much every where.
|
|
|
|