Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Computing > Windows 64bit > different behavior of AMD64 compiler 14.00.40310.41 on Windows xp and 2k

Reply
Thread Tools

different behavior of AMD64 compiler 14.00.40310.41 on Windows xp and 2k

 
 
yezdived@gmail.com
Guest
Posts: n/a
 
      03-08-2006
Hi All,
I found Windows AMD64 compiler behaving differently When used on
Windows XP SP2 and Windows 2K professional. (both using Windows 2003
SP1 SDK - April edition)

I've a .tlb which is imported in my .cpp file. This typelibrary has a
structure defined inside and I'm using it in my code.

XXX.cpp:

#import COMLib.tlb
using namespace COMLib;
.....
main()
{
COMLib::STRUCTDAT structData;
}
.....
//

When the project is compiled on XP SP2 with VS2003 IDE, the tlh code
generated looks like follows:
// Created by Microsoft (R) C/C++ Compiler Version 14.00.40310.41
(cda64a29).
//...
#pragma once
#pragma pack(push,
namespace COMLib {
.....
.....
#pragma pack(push, 4) //////Here is the difference, on WIN2k, this
value is 8.
struct STRUCTDAT
{
unsigned long ValidationDataLength;
unsigned char * ValidationData;
};
#pragma pack(pop)
.....
.....
}
#pragma pack(pop)

While on Win2k the same project under same environment the tlh
generated looks like

// Created by Microsoft (R) C/C++ Compiler Version 14.00.40310.41
(b739b039).
//...
#pragma once
#pragma pack(push,
namespace COMLib {
.....
.....
#pragma pack(push, //////Here is the difference, on WINXP, this
value is 4.
struct STRUCTDAT
{
unsigned long ValidationDataLength;
unsigned char * ValidationData;
};
#pragma pack(pop)
.....
.....
}
#pragma pack(pop)


Because of the wrong alignment on XP, sample built here fails while
built on Win2K succeeds. Does anyone know why compiler is behaving
this way? How to make it build correctly on WinXP?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Python for amd64 and x86 on Windows Trent Mick Python 0 03-12-2007 10:24 PM
Python for amd64 and x86 on Windows Hengel, Simon Python 0 01-25-2007 06:25 PM
Windows AMD64 executable javerberg@yahoo.com Java 6 05-26-2006 04:58 PM
different behavior on different machines, same JRE/IE Johnny Ruin Java 5 03-15-2006 08:51 PM
BeginGetResponse - Different Behavior on Windows 2000 and Windows XP Jim Davis ASP .Net 1 06-09-2004 05:23 PM



Advertisments