Kernel Object under Vista and win7

Source: Internet
Author: User

The Event was used between two applications yesterday. In Windows 7 and Vista, events cannot be received. After searching on the network, we found that the keyword "Global" must be added before the name of the created Event ". In systems after winXP, services run in sections, but after vista, the permission management between services is stricter. So the above problem occurs. The following is an explanation in NSDN:

Kernel Object Name Spaces

A Terminal Services server has multiple namespaces for the following named kernel objects: events, semaphores, mutexes, waitable timers, file-mapping objects, and job objects. there is a global namespace used primarily by services such as client/server applications. in addition, each client session has a separate namespace for these objects. note that this differs from the standard Windows environment in which all processes and services share a single namespace for these objects.

The separate client session namespaces enable multiple clients to run the same applications without interfering with each other. for processes started under a client session, the system uses the session namespace by default. however, these processes can use the global namespace by prepending the "Global/" prefix to the object name. for example, the following code CILS CreateEvent and creates an event object named CSAPP in the global namespace:

[C ++]

CreateEvent (NULL, FALSE, FALSE, "Global // CSAPP ");

Service applications in a Terminal Services environment use the global namespace by default. processes started under session zero (typically the console session) also use the global namespace by default. the global namespace enables processes on multiple client sessions to communicate with a service application or with the console session. for example, a client/server application might use a mutex object for synchronization. the server component running as a service can create the mutex object in the global namespace. then the client component running as a process running under a client session can use the "Global/" prefix to open the mutex object.

Another use of the global namespace is for applications that use named objects to detect that there is already an instance of the application running in the system running SS all sessions. this named object must be created or opened in the global namespace instead of the per-session namespace. note that the more common case of running the application once per session is supported by default since the named object is created in a per session namespace.

Client processes can also use the "Local/" prefix to explicitly create an object in their session namespace.

The "Local", "Global" and "Session" prefixes are reserved for system use and shoshould not be used as names for kernel objects. these keywords are case sensitive. on Windows 2000 without Terminal Services, these keywords are ignored. on Windows NT 4.0 without Terminal Services, and earlier versions of Windows NT, the functions for creating or opening these objects fail if you specify a name containing the backslash character (/).

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.