Help! _VtblGapPlaceHolder1() added during preprocessing

Discussion in 'Windows 64bit' started by yezdived@gmail.com, Mar 9, 2006.

  1. Guest

    Hi,
    Yet another problem of different behavior exhibited when building on
    Win2k and XP.
    Using AMD64 environment (Windows 2003 SDK SP1-April2005 edition - /XP64
    /RETAIL options set) and VS2003 IDE to compile a file.
    This cpp file is importing a typelibrary like this:

    #import "COMLib.tlb"
    //.... code
    //.... code

    When I compile this file in Win2k and generate preprocessor output (/P
    option), I see that for an interface definition, two extra methods are
    being added (_VtblGapPlaceHolder1( ) and 2..)

    struct __declspec(uuid("4730c519-8998-43f6-993b-80befea1d404"))
    ITCSpecific : IUnknown
    {
    HRESULT GetUserKey(/* removed params */ );
    HRESULT ReleaseSpace ( );
    HRESULT WriteValue (/*removed params*/ );


    virtual HRESULT _VtblGapPlaceholder1( ) { return
    ((HRESULT)0x80004001L); }
    virtual HRESULT _VtblGapPlaceholder2( ) { return
    ((HRESULT)0x80004001L); }
    virtual HRESULT __stdcall raw_GetUserKey ( /*deleted other
    params*/ ) = 0;
    virtual HRESULT __stdcall raw_ReleaseSpace ( ) = 0;
    virtual HRESULT __stdcall raw_WriteValue (/*deleted params*/ ) =
    0;
    };

    Under same conditions on Win XP SP2 however, the preprocessor output
    does not have these PlaceHolder methods. And my server dll was built on
    XP SP2.

    :( so when I build client on Win2K, method invocation is messing up due
    to extra 16 bytes added to vtbl offset because of PlaceHoler()
    methods. and so instead of invoking GetUserKey(), WriteValue() gets
    invoked.

    WHY, WHY!! Why is the compiler behaving differently on Win2k and Win XP
    SP2. What brings in _vtblGapPlaceHolder1() methods??? I can't ship my
    SDK code until it is buildable from Win2K and XP SP2 targeted to 64-bit
    environment. :((

    ved
    , Mar 9, 2006
    #1
    1. Advertising

  2. Its probably best if you post this issue to:
    microsoft.public.vsnet.general
    microsoft.public.vsnet.debugging
    --
    --
    Andre
    Windows Connect | http://www.windowsconnected.com
    Extended64 | http://www.extended64.com
    Blog | http://www.extended64.com/blogs/andre
    http://spaces.msn.com/members/adacosta

    <> wrote in message
    news:...
    > Hi,
    > Yet another problem of different behavior exhibited when building on
    > Win2k and XP.
    > Using AMD64 environment (Windows 2003 SDK SP1-April2005 edition - /XP64
    > /RETAIL options set) and VS2003 IDE to compile a file.
    > This cpp file is importing a typelibrary like this:
    >
    > #import "COMLib.tlb"
    > //.... code
    > //.... code
    >
    > When I compile this file in Win2k and generate preprocessor output (/P
    > option), I see that for an interface definition, two extra methods are
    > being added (_VtblGapPlaceHolder1( ) and 2..)
    >
    > struct __declspec(uuid("4730c519-8998-43f6-993b-80befea1d404"))
    > ITCSpecific : IUnknown
    > {
    > HRESULT GetUserKey(/* removed params */ );
    > HRESULT ReleaseSpace ( );
    > HRESULT WriteValue (/*removed params*/ );
    >
    >
    > virtual HRESULT _VtblGapPlaceholder1( ) { return
    > ((HRESULT)0x80004001L); }
    > virtual HRESULT _VtblGapPlaceholder2( ) { return
    > ((HRESULT)0x80004001L); }
    > virtual HRESULT __stdcall raw_GetUserKey ( /*deleted other
    > params*/ ) = 0;
    > virtual HRESULT __stdcall raw_ReleaseSpace ( ) = 0;
    > virtual HRESULT __stdcall raw_WriteValue (/*deleted params*/ ) =
    > 0;
    > };
    >
    > Under same conditions on Win XP SP2 however, the preprocessor output
    > does not have these PlaceHolder methods. And my server dll was built on
    > XP SP2.
    >
    > :( so when I build client on Win2K, method invocation is messing up due
    > to extra 16 bytes added to vtbl offset because of PlaceHoler()
    > methods. and so instead of invoking GetUserKey(), WriteValue() gets
    > invoked.
    >
    > WHY, WHY!! Why is the compiler behaving differently on Win2k and Win XP
    > SP2. What brings in _vtblGapPlaceHolder1() methods??? I can't ship my
    > SDK code until it is buildable from Win2K and XP SP2 targeted to 64-bit
    > environment. :((
    >
    > ved
    >
    Andre Da Costa [Extended64], Mar 9, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. default
    Replies:
    0
    Views:
    489
    default
    Apr 20, 2005
  2. =?Utf-8?B?c21pdGNoZWxs?=

    Need help with MACHINE_CHECK_EXCEPTION during x64 install or repai

    =?Utf-8?B?c21pdGNoZWxs?=, Jan 18, 2006, in forum: Windows 64bit
    Replies:
    7
    Views:
    582
    =?Utf-8?B?QWhvY2hhdQ==?=
    Mar 11, 2006
  3. Computer shuts off during boot. Help?

    , Sep 17, 2007, in forum: Computer Support
    Replies:
    2
    Views:
    1,113
    w_tom
    Sep 18, 2007
  4. Donnie
    Replies:
    12
    Views:
    3,346
Loading...

Share This Page