GetDeviceInfo Errors in Source Code CE4.2
From: H. Edgar (nospam_at_nospam.com)
Date: 11/28/04
- Next message: Steve Maillet \(eMVP\): "Re: about suspend problem."
- Previous message: YiYi: "Re: about suspend problem."
- Next in thread: Chuck Zalinski: "RE: GetDeviceInfo Errors in Source Code CE4.2"
- Reply: Chuck Zalinski: "RE: GetDeviceInfo Errors in Source Code CE4.2"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 28 Nov 2004 18:35:13 +0100
The ATAPI driver function CDisk::GetDeviceInfo in CE4.2 CSP X86 has some C++
errors:
It uses the function AtaGetRegistryString from helper.cpp, e.g. in the
following statement:
if (!hKey || !AtaGetRegistryString( hKey, REG_VALUE_HDPROFILE, (PTSTR
*)&psdi->szProfile, sizeof(psdi->szProfile))) {
wcscpy( psdi->szProfile, REG_VALUE_HDPROFILE);
}
The cast (PTSTR *)&psdi->szProfile is wrong. This generates an exception
error because AtaGetRegistryString tries to write into *((PTSTR
*)&psdi->szProfile). This is wrong for
struct
{
szProfile[40];
}
Edgar
- Next message: Steve Maillet \(eMVP\): "Re: about suspend problem."
- Previous message: YiYi: "Re: about suspend problem."
- Next in thread: Chuck Zalinski: "RE: GetDeviceInfo Errors in Source Code CE4.2"
- Reply: Chuck Zalinski: "RE: GetDeviceInfo Errors in Source Code CE4.2"
- Messages sorted by: [ date ] [ thread ]