64-bit and 32-bit handles

Discussion in 'Windows 64bit' started by Kornél Pál, Dec 10, 2006.

  1. Kornél Pál

    Kornél Pál Guest

    Hi,

    http://msdn2.microsoft.com/en-us/library/aa384203.aspx
    "Handles to named objects such as mutexes, semaphores, and file handles can
    all be shared."

    Does this mean that I can use DuplicateHandle in a 64-bit process and pass
    the duplicated handle truncated to 32-bits to the appropriate 32-bit process
    and call DuplicateHandle in a 32-bit process and pass the duplicated handle
    zero-extended to 64-bits to the appropriate 64-bit process?

    Thanks for your help.

    Kornél
     
    Kornél Pál, Dec 10, 2006
    #1
    1. Advertising

  2. Most of the regulars here are IT pros or end users, not developers (hence
    the .general in the newsgroup name). So you might have better luck posting
    this over on one of the MSDN forums.

    --
    Charlie.
    http://msmvps.com/xperts64


    "Kornél Pál" <> wrote in message
    news:...
    > Hi,
    >
    > http://msdn2.microsoft.com/en-us/library/aa384203.aspx
    > "Handles to named objects such as mutexes, semaphores, and file handles
    > can all be shared."
    >
    > Does this mean that I can use DuplicateHandle in a 64-bit process and pass
    > the duplicated handle truncated to 32-bits to the appropriate 32-bit
    > process and call DuplicateHandle in a 32-bit process and pass the
    > duplicated handle zero-extended to 64-bits to the appropriate 64-bit
    > process?
    >
    > Thanks for your help.
    >
    > Kornél
    >
     
    Charlie Russel - MVP, Dec 10, 2006
    #2
    1. Advertising

  3. Interesting question.

    Named objects are shared through their name, i.e. the name is unique across
    all 32/64 bit procs.
    This only _suggests_ that it _should be_ possible to use DuplicateHandle
    where the object behind the HANDLE doesn't have an API function that allows
    you to open by name.

    I would suggest that you just try it, a test case should be small enough to
    whip up.
    As a start i would think that if DuplicateHandle returns TRUE then it works.
    This implies you used a valid target proc handle and that DuplicateHandle
    didn't feel it was a problem creating a handle for it.

    I would expect the trunc/0-ext to work.


    cmk
     
    Chris Kushnir, Dec 10, 2006
    #3
  4. Chris Kushnir, Dec 10, 2006
    #4
  5. Kornél Pál

    Kornél Pál Guest

    Kornél Pál, Dec 11, 2006
    #5
  6. Thanks for proving me wrong, Chris. And please, stick around. We do get the
    occasional dev questions, and I am definitely NOT the person to answer them.
    :)

    --
    Charlie.
    http://msmvps.com/xperts64


    "Chris Kushnir" <> wrote in message
    news:...
    > Interesting question.
    >
    > Named objects are shared through their name, i.e. the name is unique
    > across all 32/64 bit procs.
    > This only _suggests_ that it _should be_ possible to use DuplicateHandle
    > where the object behind the HANDLE doesn't have an API function that
    > allows you to open by name.
    >
    > I would suggest that you just try it, a test case should be small enough
    > to whip up.
    > As a start i would think that if DuplicateHandle returns TRUE then it
    > works.
    > This implies you used a valid target proc handle and that DuplicateHandle
    > didn't feel it was a problem creating a handle for it.
    >
    > I would expect the trunc/0-ext to work.
    >
    >
    > cmk
    >
    >
     
    Charlie Russel - MVP, Dec 11, 2006
    #6
  7. No problem, i've been lurking, and answering when i can, in this group for
    the last year.
    I've managed to get more than i've given, but that's the point of stone
    soup. :)


    cmk


    "Charlie Russel - MVP" <> wrote in message
    news:...
    > Thanks for proving me wrong, Chris. And please, stick around. We do get
    > the occasional dev questions, and I am definitely NOT the person to answer
    > them. :)
    > --
    > Charlie.
    > http://msmvps.com/xperts64
    >
    >
    > "Chris Kushnir" <> wrote in message
    > news:...
    >> Interesting question.
    >>
    >> Named objects are shared through their name, i.e. the name is unique
    >> across all 32/64 bit procs.
    >> ...

    >
     
    Chris Kushnir, Dec 11, 2006
    #7
    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. Jimmy Dean
    Replies:
    1
    Views:
    10,395
    Dave Lear
    Jul 26, 2005
  2. Tony H
    Replies:
    2
    Views:
    1,511
    darren
    Aug 28, 2003
  3. Peter Gordon

    Flash Slave which handles the preflash on Canon G5?

    Peter Gordon, Nov 27, 2003, in forum: Digital Photography
    Replies:
    1
    Views:
    401
    Ronald Hands
    Nov 27, 2003
  4. Grant Robertson

    Image database that handles multiple versions of images

    Grant Robertson, Apr 12, 2004, in forum: Digital Photography
    Replies:
    3
    Views:
    359
    Grant Robertson
    Apr 18, 2004
  5. Dave Cohen

    Batch resize that handles landscape and portrait

    Dave Cohen, May 5, 2004, in forum: Digital Photography
    Replies:
    10
    Views:
    4,935
    Webkatz
    May 6, 2004
Loading...

Share This Page