Re: two revision levels are incompatible??

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Doron Holan [MS] (doronh_at_nospam.microsoft.com)
Date: 02/04/05


Date: Thu, 3 Feb 2005 18:41:47 -0800

instead of manually adding the padding, i would use explicit padding (ie use
the #pragma directive) around teh structures that need 1 byte packing, or,
if you can use the std padding setting for windows throughout the project.
this will only come back and get you again sometime.

-- 
Please do not send e-mail directly to this alias. this alias is for 
newsgroup purposes only.
This posting is provided "AS IS" with no warranties, and confers no rights.
"Daniel Miller" <dan@invalid.com> wrote in message 
news:Xns95F29C151D3D7dancarddupercom@216.65.98.70...
> By golly, that's exactly what it was!!  Thank you *very* much, I don't
> know  that I would have ever thought to look at that... all the web info
> on that warning discussed issues with access permissions, which was *way*
> off in left field!!
>
> It turns out that SCSI_PASS_THROUGH and SPT_DIRECT have a UCHAR field
> followed by a ULONG, and DeviceIOControl obviously expects three bytes of
> padding there.  I was using /Zp1 in my builds, as you suspected, and I
> need that for other structs in the app.
>
> I just padded the two structs with a three-byte unused field, then
> rebuilt; now everything works fine!!  That means I have a decent IDE
> again!!  Wow...
>
> Thank you again for that insight...
>
>    Dan Miller
>
> "Doron Holan [MS]" <doronh@nospam.microsoft.com> wrote in
> news:ORJonwaCFHA.904@TK2MSFTNGP12.phx.gbl:
>
>> i would bet that the size of your structure is different due to
>> different packing alignment settings on the compilers.  from both
>> versions of the app, issue a printf("size %d\n", sizeof(struct Xxxx))
>> before the DeviceIoControl call.  if they are different sizes, that is
>> probably the issue.
>>
>> d
>>
> "Daniel Miller" <dan@invalid.com> wrote in message
> news:Xns95F1A3266A137dancarddupercom@216.65.98.71...
>> I'm developing an application on Windows XP... It uses DeviceIOControl/
>> SCSI_PASS_THROUGH_etc to send SCSI commands to USB devices.
>>
>> I was previously using MinGW to build my app, and everything was
> working
>> as
>> expected.  Now I'm trying to build the app using Visual C++ 6.0 SP6.
> The
>> program compiles without warnings, but when I try to send INQUIRY to a
>> device, DeviceIOControl fails with
>>
>>    "Indicates two revision levels are incompatible"
>>
>> I'm baffled by this; what is it trying to tell me??
>>
>
>
> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet 
> News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 
> Newsgroups
> ---= East/West-Coast Server Farms - Total Privacy via Encryption =--- 


Relevant Pages

  • Re: two revision levels are incompatible??
    ... need that for other structs in the app. ... I just padded the two structs with a three-byte unused field, ... > before the DeviceIoControl call. ... > program compiles without warnings, but when I try to send INQUIRY to a ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Size of a structure : Structure Padding
    ... can "use" the space occupied by the padding bytes by reading and writing to ... the structure as an array of unsigned char. ... when assigning structs, ...
    (comp.lang.c)
  • Re: Copying from one struct to another, simple assignment?
    ... two different structs with different padding, ... values to the members of those structs, ... Does the standard require struct assignment to work across ...
    (comp.lang.c)
  • Re: Copying from one struct to another, simple assignment?
    ... two different structs with different padding, ... values to the members of those structs, ... Does the standard require struct assignment to work across ...
    (comp.lang.c)
  • std::vector and structs of PODs
    ... I have ome new code which has to work with some legacy code which does ... a lot of memset's and memcmp's on structs of PODs. ... Looking at the copy of foo which is ... the padding bytes have random values. ...
    (comp.lang.cpp)