How to create a no security level kernel object
2008-08-29 21:26
447 查看
I make a sample of Event object to show this issue:
How to create a no security level kernel object?
Code
HANDLE hMonitor = OpenEventA(EVENT_ALL_ACCESS, FALSE, "Global\\{A7DF02C8-0F89-4a3b-A6E8-E3E08C167C58}");
if ( NULL == hMonitor )
{
cout << "Open event failed, last error:" << GetLastError() << endl;
return 0;
}
SetEvent(hMonitor);
Why I make this sample?
Because I want to operate a windows kernel object in the different process, and these process own the different security level. e.g. service and user process. So if you don't set the security descriptor , you will always get the NULL when you invoke OpenEvent API and get the error number is 5.
How to create a no security level kernel object?
Code
HANDLE hMonitor = OpenEventA(EVENT_ALL_ACCESS, FALSE, "Global\\{A7DF02C8-0F89-4a3b-A6E8-E3E08C167C58}");
if ( NULL == hMonitor )
{
cout << "Open event failed, last error:" << GetLastError() << endl;
return 0;
}
SetEvent(hMonitor);
Why I make this sample?
Because I want to operate a windows kernel object in the different process, and these process own the different security level. e.g. service and user process. So if you don't set the security descriptor , you will always get the NULL when you invoke OpenEvent API and get the error number is 5.
相关文章推荐
- How to create a new object in Windchill with IBAs
- How to create security string in exchange cmdlet
- What is junction object and how to create it?
- How to create QTP Shared Object Repository
- how to create and submit kernel patch through git step by step
- How to Create a Second Level GridView in ASP.NET
- How to add a new key from kernel level to java level
- SAP CRM How to Create your own BOL Object for webclient
- how to create a global singleton object in exe
- How to create custom methods for use in spring security expression language annotations
- How To Create a kernel thread
- How to Create, Compile, Load Linux LKM Loadable Kernel Modules
- How to create fully custom Role, User, Event, Resource classes for use with the Security and Scheduler modules
- How to create Immutable Class and Object in Java - Tutorial Example
- [win32] How to use WIN32 Event Kernel Object
- How To Create ASM Diskgroups using NFS/NAS Files
- how to use Dom to create and remove element
- HOWTO Change the Linux Kernel Start Address
- How to create and apply a patch with Git
- [reproduce]How to Create Domain in Windows Server 2012.