Click here to Skip to main content
12,689,349 members (25,831 online)

C / C++ / MFC

 
QuestionC++, RealTime Scheduler in Operating System Pin
Kevin Stlip17-Nov-12 17:10
memberKevin Stlip17-Nov-12 17:10 
AnswerRe: C++, RealTime Scheduler in Operating System Pin
Richard MacCutchan17-Nov-12 22:46
mvpRichard MacCutchan17-Nov-12 22:46 
Questionporting my device driver 32 bit to windows 7 64 bit Pin
navn199116-Nov-12 23:03
membernavn199116-Nov-12 23:03 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
jschell17-Nov-12 6:52
memberjschell17-Nov-12 6:52 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
BilliousBob23-Nov-12 5:50
memberBilliousBob23-Nov-12 5:50 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
Clark Kent SuperCoder17-Nov-12 6:52
memberClark Kent SuperCoder17-Nov-12 6:52 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
navn199118-Nov-12 22:54
membernavn199118-Nov-12 22:54 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
Clark Kent SuperCoder19-Nov-12 1:15
memberClark Kent SuperCoder19-Nov-12 1:15 
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.
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
navn199121-Nov-12 3:40
membernavn199121-Nov-12 3:40 
GeneralRe: porting my device driver 32 bit to windows 7 64 bit Pin
BilliousBob23-Nov-12 5:51
memberBilliousBob23-Nov-12 5:51 
AnswerRe: porting my device driver 32 bit to windows 7 64 bit Pin
BilliousBob23-Nov-12 5:50
memberBilliousBob23-Nov-12 5:50 
QuestionMemory usage Pin
john563215-Nov-12 22:48
memberjohn563215-Nov-12 22:48 
AnswerRe: Memory usage Pin
Orjan Westin16-Nov-12 0:23
memberOrjan Westin16-Nov-12 0:23 
AnswerRe: Memory usage Pin
DavidCrow16-Nov-12 3:27
memberDavidCrow16-Nov-12 3:27 
AnswerRe: Memory usage Pin
Rolf Kristensen16-Nov-12 4:30
memberRolf Kristensen16-Nov-12 4:30 
AnswerRe: Memory usage Pin
Arun S J18-Nov-12 19:13
memberArun S J18-Nov-12 19:13 
Questioninterp project in 64bit system Pin
Dang Vu Tuan15-Nov-12 22:46
memberDang Vu Tuan15-Nov-12 22:46 
AnswerRe: interp project in 64bit system Pin
Richard MacCutchan16-Nov-12 0:57
mvpRichard MacCutchan16-Nov-12 0:57 
QuestionSql server Database BackUp Pin
shibashish mohanty15-Nov-12 21:06
membershibashish mohanty15-Nov-12 21:06 
AnswerRe: Sql server Database BackUp Pin
Richard MacCutchan16-Nov-12 0:55
mvpRichard MacCutchan16-Nov-12 0:55 
AnswerRe: Sql server Database BackUp Pin
André Kraak16-Nov-12 1:48
memberAndré Kraak16-Nov-12 1:48 
QuestionNeed help compiling Pin
xLeonx15-Nov-12 9:51
memberxLeonx15-Nov-12 9:51 
AnswerRe: Need help compiling Pin
jeron115-Nov-12 10:51
memberjeron115-Nov-12 10:51 
QuestionRe: Need help compiling Pin
DavidCrow15-Nov-12 11:34
memberDavidCrow15-Nov-12 11:34 
QuestionRe: Need help compiling Pin
CPallini16-Nov-12 0:09
mvpCPallini16-Nov-12 0:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.170113.4 | Last Updated 16 Jan 2017
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid