Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7830103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:04:20+00:00 2026-06-02T11:04:20+00:00

I think the two functions will return the same kernel handle. And I write

  • 0

I think the two functions will return the same kernel handle.
And I write a test programme to prove my view:

In my programme I create a kernel handle with name ‘_MYTEST’

hHandle1 = CreateMutex(NULL, false, _T("_MYTEST"));

then I start a thread and open the handle above in this thread with the following code:

hHandle2 = OpenMutex(MUTEX_ALL_ACCESS, false, _T("_MYTEST"));

when I run the programme, I find the two return values aren’t equal!
The value of hHandle2 is 4 greater than the value of hHandle1.
Why?Are there any problems in my code?If not, why are the two values not equal?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T11:04:23+00:00Added an answer on June 2, 2026 at 11:04 am

    A handle isn’t the object, it’s a descriptor stored in the kernel mapping a value valid only in your program’s address space to a kernel object.

    That’s the long way of saying: a handle to the mutex is not the mutex itself. Just because the handles are different does not mean the mutexes underneath are.

    That’s like creating two different pointers to one object in C, then comparing the addresses of the pointers (vs the contents of the pointer) to falsely deduce the objects are not the same.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want these two print functions to do the same thing: unsigned int Arraye[]
I'm trying to write a small Powershell function that will return some summary data
Being new to VS, how may I think of these two concepts, what is
Currently I think that processor only has two states: run and not run. If
Given I have two File objects I can think of the following implementation: public
So I am trying to think of a way to facilitate two things. It
Lets say we texturing quad (two triangles). I think what this question is similiar
Okay i have two models: posts and comments. as you can think comments has
Using oracle database. Here's how i think the SQLException happens... Say i have two
I witnessed the following weird behavior. I have two functions, which do almost the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.