Re: vTable offsets

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

From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 08/01/04

  • Next message: Mike H: "Re: vTable offsets"
    Date: Sat, 31 Jul 2004 19:52:13 -0700
    
    

    What about starting by posting the interface in question you are
    referencing and the client code you used to obtain it? I suspect
    you obtained a pure IDispatch* and tried to address it as a dual
    interface, but this is a mere guess. At any rate, the problem is
    somewhere with your perception not corresponding with the
    reality. A dual interface doesn't have a gap in the vtable as you
    are trying to explain it. Ah, details as the server type (in-proc vs
    out-of-proc), threading model, etc might be of further help too.

    -- 
    =====================================
    Alexander Nickolov
    Microsoft MVP [VC], MCSD
    email: agnickolov@mvps.org
    MVP VC FAQ: http://www.mvps.org/vcfaq
    =====================================
    "Mike H" <mikehg1@removethis foraccess-4-free.com> wrote in message
    news:zLWOc.148454$%t6.5656@roc.nntpserver.com...
    >
    > "Alexander Nickolov" <agnickolov@mvps.org> wrote in message
    > news:uq$RdoldEHA.3612@TK2MSFTNGP09.phx.gbl...
    > > Your assertions fall out from thin air, you need to provide some
    > > hard details before we can even consider them... Working in C
    > > is one such detail - you can get things wrong easily in C, since you
    > > have to build all vtables by hand. (And I'm probably not saying
    > > anything new here...)
    >
    > I'm not sure how much more detail I can give without answering my own
    > question?
    > I would have thought this would be an easy question for someone with a
    > strong knowledge of this stuff. I have read Inside OLE, it does not
    provide
    > much detail on the subject.
    >
    > This seems to be common to Controls made with VB. The vTable offset starts
    > at 0 for IUknown, but the first exposed function starts at 1956. So we
    have:
    >
    > offset zero:
    > IUknown
    > IDispatch <--This would end at offset 27
    > 28 through 1955 missing ...If I insert dummy placeholders here everything
    > works as expected
    > Foo Interface <--The offset starts at 1956
    >
    > So I guess my next 2 questions would be why the gap? and is it possible to
    > specify an offset using C instead of placing 482 dummy placeholders?
    >
    > Thanks,
    > Mike H.
    >
    > >
    > > As a general advice, read the first 6 chapters of "Inside OLE"
    > > by Kraig Brockschmidt, MS Press (available on old MSDN
    > > Library CDs, otherwise long since out of print). Chapter 5 or 6
    > > contains an example of building a COM object in C.
    > >
    > > -- 
    > > =====================================
    > > Alexander Nickolov
    > > Microsoft MVP [VC], MCSD
    > > email: agnickolov@mvps.org
    > > MVP VC FAQ: http://www.mvps.org/vcfaq
    > > =====================================
    > >
    > > "Mike H" <mikehg1@removethis foraccess-4-free.com> wrote in message
    > > news:J0vOc.118584$%t6.34381@roc.nntpserver.com...
    > > > I'm still in the learning stage of the COM world and have a question
    > about
    > > > vtables. Using an Object browser I notice the vTable offset is 28 for
    > the
    > > > first function, which seems to make sense if you calculate the size of
    > the
    > > > Dispatch interface first. But some start with a vTable offset of
    usually
    > > > 1956 and these are usually the interface functions that I can't seem
    to
    > > > access. Most of the time it results in a GPF or a No Interface return
    > > value.
    > > > Can someone shed some light on how these vTables need to be
    implemented
    > > > and/or called? I am using plain C btw.
    > > >
    > > > Thanks,
    > > > Mike H.
    > > >
    > > >
    > >
    > >
    >
    >
    

  • Next message: Mike H: "Re: vTable offsets"

    Relevant Pages

    • Re: 2.6.9-rc2 bio sickness with large writes
      ... >>offset in page structure ... for DMA addressibility ... >>I can assume from the interface as designed that if you pass an offset ... Hardware doesn't care about page boundries. ...
      (Linux-Kernel)
    • Re: can event handler call event source passed as connection point parameter?
      ... passing a derived interface through a _pure_dispinterface_, ... with no other methods in the vtables. ... Microsoft MVP, MCSD ... Alexander Nickolov wrote: ...
      (microsoft.public.vc.atl)
    • Re: 2.6.9-rc2 bio sickness with large writes
      ... Can you explain the circumstances related to the bio->bi_size callback. ... page and offset sematics in the interface are also somewhat burdensome. ... is great for mmap for the VFS layer, and it dure makes it a lot easier ...
      (Linux-Kernel)
    • Re: JonesForth queries
      ... Assuming you have a suitable interface presumably at a defined address ... method_offset is an offset from the start of this table. ... One for the msg_number and one for the relevant word to ... Windows each control) you are using. ...
      (comp.lang.forth)
    • Re: JonesForth queries
      ... Assuming you have a suitable interface presumably at a defined address ... method_offset is an offset from the start of this table. ... One for the msg_number and one for the relevant word to ... Windows each control) you are using. ...
      (comp.lang.forth)