Форум программистов «Весельчак У»
  *
Добро пожаловать, Гость. Пожалуйста, войдите или зарегистрируйтесь.
Вам не пришло письмо с кодом активации?

  • Рекомендуем проверить настройки временной зоны в вашем профиле (страница "Внешний вид форума", пункт "Часовой пояс:").
  • У нас больше нет рассылок. Если вам приходят письма от наших бывших рассылок mail.ru и subscribe.ru, то знайте, что это не мы рассылаем.
   Начало  
Наши сайты
Помощь Поиск Календарь Почта Войти Регистрация  
 
Страниц: [1]   Вниз
  Печать  
Автор Тема: OpenEvent для событий созданных в \\BaseNamedObject\\  (Прочитано 15045 раз)
0 Пользователей и 1 Гость смотрят эту тему.
new
Гость
« : 03-02-2004 11:18 » 

как открыть событие, созданное в \\BaseNamedObject\\

искал в \\Global\\ \\BaseNamedObject\\  но его там нет
Записан
Anonymous
Гость
« Ответ #1 : 03-02-2004 11:34 » 

Во, ошибка - отказанно в доступе (я беру права EVENT_MODIFY_STATE)
Записан
new
Гость
« Ответ #2 : 03-02-2004 17:19 » 

Короче у меня большие проблемы  Я шокирован!   с установкой прав на объект.
Кто знает как проставлять права сабытию в ядре, пожалуйста, помогите..... :?
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #3 : 04-02-2004 06:25 » 

Цитата

Короче у меня большие проблемы  с установкой прав на объект.
Кто знает как проставлять права сабытию в ядре, пожалуйста, помогите.....


Ты его чем открываешь. Надо IoCreateNotificationEvent.

Код:

RtlInitUnicodeString)&EventName, L"\\BaseNamedObjects\\SharedEvent":;
SharedEvent = IoCreateNotificationEvent)&EventName, &SharedEventHandle:;


Если используешь ZwCreateEvent, то именно его, а не NtCreateEvent, иначе могут применить права юзерского потока, так как может не смениться PreviousMode на KernelMode.

Цитата

Кто знает как проставлять права сабытию в ядре, пожалуйста, помогите.....


ZwSetSecurityObject
Записан
Anonymous
Гость
« Ответ #4 : 04-02-2004 08:34 » 

Цитата

ZwSetSecurityObject


Это из какого DDK? К меня ДДК2000 и такого нет Молчу

Заранее спасибо Ага
Записан
Anonymous
Гость
« Ответ #5 : 04-02-2004 08:38 » 

Я создаю событие в ядре IoCreateNotificationEvent

потом в юзер моде отркрываю ОпенИвент - прав нет - не открывается - выставляю права вручную - открывается но не работает WaitFor... (прав нет)
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #6 : 04-02-2004 11:02 » 

Цитата

Это из какого DDK?


Из моего Отлично . Как минимум открой книгу G.Nebbet "Windows 2000/NT Native API Reference". На сайте она есть в разделе Файлы. Эта функция есть и в ядре(собственно она и вызывается из юзер мода, после перехода в кернел мод), параметры те же.

Цитата

потом в юзер моде отркрываю ОпенИвент - прав нет - не открывается - выставляю права вручную - открывается но не работает WaitFor... (прав нет)


Блин, приехали! Так бы и сказал, что событие создано в кернел моде, а открыть пытаются в юзер моде. В кернел моде оно создается с правами на открытие для System. Надо самому DACL менять после создания еще в драйвере.

Иди на www.osronline.com и в поиске набери Sharing Event и читай статью под номером 1.
Записан
Anonymous
Гость
« Ответ #7 : 04-02-2004 11:18 » 

Sharing Is Caring - Sharing Events Between Kernel-User Mode ?

Тут ни единого слова про DACL. :?

Цитата

Надо самому DACL менять после создания еще в драйвере


Вот я и спрашиваю - как?  Вот такой я вот
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #8 : 04-02-2004 11:22 » 

Цитата

Тут ни единого слова про DACL.  


Вот так его менять- ZwSetSecurityObject .

Описание для юзер мода, но верно и для кернел мода.
ZwSetSecurityObject
ZwSetSecurityObject sets the security descriptor protecting an object.
NTSYSAPI
NTSTATUS
NTAPI
ZwSetSecurityObject(
IN HANDLE Handle,
IN SECURITY_INFORMATION SecurityInformation,
IN PSECURITY_DESCRIPTOR SecurityDescriptor
);
Parameters
Handle
A handle to an object.The handle must either grant WRITE_OWNER and/or WRITE_DAC
access to the object as appropriate, or the caller must be the owner of the object.To
access the system ACL of the object, the handle must grant ACCESS_SYSTEM_SECURITY.
SecurityInformation
A bit mask specifying the type of information being set.The defined values are:
OWNER_SECURITY_INFORMATION 0x01
GROUP_SECURITY_INFORMATION 0x02
DACL_SECURITY_INFORMATION 0x04
SACL_SECURITY_INFORMATION 0x08
SecurityDescriptor
Points to a SECURITY_DESCRIPTOR structure containing the new security information.
The SECURITY_DESCRIPTOR structure must be in self-relative format.
Return Value
Returns STATUS_SUCCESS or an error status, such as STATUS_ACCESS_DENIED.
Related Win32 Functions
SetKernelObjectSecurity, SetUserObjectSecurity.
Remarks
SetKernelObjectSecurity and SetUserObjectSecurity both expose the full functionality
of ZwSetSecurityObject.
SeSecurityPrivilege is needed to open an object for ACCESS_SYSTEM_SECURITY
access.This privilege need not be enabled at the time of calling ZwSetSecurityObject.
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #9 : 04-02-2004 11:25 » 

А вот описание из IFSDK

ZwSetSecurityObject
[This is preliminary documentation and subject to change.]

ZwSetSecurityObject sets an object's security state.

NTSTATUS
  ZwSetSecurityObject(
    IN HANDLE  Handle,
    IN SECURITY_INFORMATION  SecurityInformation,
    IN PSECURITY_DESCRIPTOR  SecurityDescriptor,
    );
Parameters
Handle
Handle for the object whose security state is to be set. This handle must have the access specified in the Meaning column of the table shown in the description of the SecurityInformation parameter.
SecurityInformation
Pointer to a SECURITY_INFORMATION value specifying the information to be set. Can be a combination of one or more of the following. Value Meaning
DACL_SECURITY_INFORMATION Indicates the discretionary access control list (DACL) of the object is to be set. Requires WRITE_DAC access.  
GROUP_SECURITY_INFORMATION Indicates the primary group identifier of the object is to be set. Requires WRITE_OWNER access.  
OWNER_SECURITY_INFORMATION Indicates the owner identifier of the object is to be set. Requires WRITE_OWNER access.  
SACL_SECURITY_INFORMATION Indicates the system ACL (SACL) of the object is to be set. Requires ACCESS_SYSTEM_SECURITY access.  


SecurityDescriptor
Pointer to the security descriptor to be set for the object.
Headers
ntifs.h

Return Value
ZwSetSecurityObject returns STATUS_SUCCESS or an appropriate error status. Possible error status codes include the following:

STATUS_ACCESS_DENIED
Handle did not have the required access.
STATUS_ACCESS_VIOLATION
SecurityDescriptor was a NULL pointer.
STATUS_INSUFFICIENT_RESOURCES
The object's security descriptor could not be captured.
STATUS_INVALID_ACL
The object's security descriptor contained an invalid ACL.
STATUS_INVALID_HANDLE
Handle was not a valid handle.
STATUS_INVALID_SECURITY_DESCR
SecurityDescriptor did not point to a valid security descriptor.
STATUS_INVALID_SID
The object's security descriptor contained an invalid SID.
STATUS_OBJECT_TYPE_MISMATCH
Handle was not a handle of the expected type.
STATUS_UNKNOWN_REVISION
The revision level of the object's security descriptor was unknown or not supported.
Comments
This routine is available on Microsoft® Windows® XP and later.

A security descriptor can be in absolute or self-relative form. In self-relative form, all members of the structure are located contiguously in memory. In absolute form, the structure only contains pointers to the members. For more information, see "Absolute and Self-Relative Security Descriptors" in the Security section of the Platform SDK documentation.

For more information on security and access control, see the documentation on these topics in the Platform SDK.

Callers of ZwSetSecurityObject must be running at IRQL PASSIVE_LEVEL.

See Also
SECURITY_DESCRIPTOR, SECURITY_INFORMATION, ZwQuerySecurityObject
Записан
Anonymous
Гость
« Ответ #10 : 04-02-2004 12:14 » 

Почему эта функция в DDK не определена?
Может для этого были причины?

спасибо
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #11 : 04-02-2004 12:25 » 

Цитата

Почему эта функция в DDK не определена?


Определена в IFSDK- это DDK для разработчиков файловых систем.

Цитата

Может для этого были причины?


Причина всегда одна- деньги. DDK бесплатен. IFSDK- 1000$. Хочешь- плати.
Записан
Страниц: [1]   Вверх
  Печать  
 

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines