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

  • Рекомендуем проверить настройки временной зоны в вашем профиле (страница "Внешний вид форума", пункт "Часовой пояс:").
  • У нас больше нет рассылок. Если вам приходят письма от наших бывших рассылок mail.ru и subscribe.ru, то знайте, что это не мы рассылаем.
   Начало  
Наши сайты
Помощь Поиск Календарь Почта Войти Регистрация  
 
Страниц: [1]   Вниз
  Печать  
Автор Тема: HEEEEEEEEEEEEELP нужен NTDLL.H  (Прочитано 12459 раз)
0 Пользователей и 1 Гость смотрят эту тему.
Anonymous
Гость
« : 04-02-2004 13:14 » 

Выложите его пожалуйста сюда, а то на сайте не могу найти.....
Записан
Anonymous
Гость
« Ответ #1 : 04-02-2004 13:15 » 

не могу найти RtlCreateAcl   даже в NtAPIRef Нэбета
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #2 : 04-02-2004 13:40 » 

Цитата

не могу найти RtlCreateAcl даже в NtAPIRef Нэбета


А его там и не должно быть- это функция только для режима ядра
 
Код:

RtlCreateAcl
RtlCreateAcl creates and initializes an access control list )ACL:.

NTSTATUS
  RtlCreateAcl)
    IN PACL  Acl,
    IN ULONG  AclLength,
    IN ULONG  AclRevision
    :;
Parameters
Acl
Pointer to a caller-allocated buffer, which must be at least sizeof)ACL:, to receive the initialized ACL structure.
AclLength
Length, in bytes, of the buffer pointed to by the Acl parameter. This value must be large enough to contain the ACL header and all of the access-control entries )ACE: to be stored in the ACL. See the following Comments section for information about calculating the size of an ACL.
AclRevision
ACL revision level of the ACL to be created. This is a system-defined constant of the form ACL_REVISIONn, where n is a digit indicating the current version.
Microsoft® Windows NT® 4.0 and earlier{ This value must be ACL_REVISION.

Microsoft® Windows® 2000 and later{ This value can be ACL_REVISION2 or ACL_REVISION_DS. Use ACL_REVISION_DS if the ACL contains object-specific ACEs.

Headers
ntifs.h

Return Value
RtlCreateAcl can return one of the following status values{

STATUS_SUCCESS
The ACL was successfully created and initialized.
STATUS_BUFFER_TOO_SMALL
The new ACL does not fit into the buffer at Acl. A larger ACL buffer is required.
STATUS_INVALID_PARAMETER
The specified revision is not current, or the given AclLength is too large.
Comments
The ACL initialized by RtlCreateAcl contains no access control entries )ACE:. It is empty, as opposed to being a nonexistent ACL. If an empty ACL is applied to an object, it implicitly denies all access to that object. To add ACEs to the ACL, use RtlAddAccessAllowedAce.

To calculate the size of an ACL, add sizeof)ACL: to the size of all the ACEs to be stored in the ACL. To calculate the size of an ACE, add the size of the ACE structure, such as sizeof)ACCESS_ALLOWED_ACE:, to the length of the SID associated with the ACE, and then subtract the size of the SidStart member )which is part of both the ACE structure and the SID:. Use the RtlLengthSid function to get the length of a specified SID.

The following example shows how to calculate the size of an access-allowed ACE{

sizeof )ACCESS_ALLOWED_ACE: - sizeof )ACCESS_ALLOWED_ACE.SidStart:
        + GetLengthSid )pAceSid:;
To calculate the size of an ACL, use the following algorithm, substituting the appropriate ACE structure in the sizeof)ACE: expression{

cbAcl = sizeof )ACL:;
for )i = 0 ; i < nAceCount ; i++: |
    // subtract ACE.SidStart from the size
    cbAce = sizeof )ACE: - sizeof )DWORD:;
    // add this ACE's SID length
    cbAce += GetLengthSid )pAceSid[i(:;
    // add the length of each ACE to the total ACL length
    cbAcl += cbAce;
"

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

Callers of RtlCreateAcl must be running at IRQL < DISPATCH_LEVEL.

See Also
ACCESS_ALLOWED_ACE, ACE, ACL, RtlAddAccessAllowedAce, RtlLengthSid, SID




свободно распространяемый ntfis.h(а не ntdll.h) тут
http://www.acc.umu.se/~bosse/
Записан
Anonymous
Гость
« Ответ #3 : 04-02-2004 14:03 » 

А с RtlAddAccessAllowedAce что мне делать? Ее там нет....
Боссе, млин....
Я просто в шоке Я шокирован!  Начал переписывать winnt.h и попутно с гугла передираю описания недокументированных функций........

Я кончу суицидом.....
Записан
Anonymous
Гость
« Ответ #4 : 04-02-2004 14:04 » 

бред.....BOOL WINAPI RtlAddAccessAllowedAce(
а в другом месте - функция возвращает NTSTATUS
Записан
Anonymous
Гость
« Ответ #5 : 04-02-2004 14:27 » 

Комплетед=) Шиит, я не в курсе как это все к меня будет работать....

последний вопрос....правильно ли я делаю

// создаем DACL
...
// заполмям
sd.dacl = <наш созданный дакл>

// даем команду на установку
ZwSetSecurityObject(SharedEventHandle,
   DACL_SECURITY_INFORMATION, // Даем команду на добавления DACL
   (PSECURITY_DESCRIPTOR) &sd // т.е здесь (в этой структуре) будет смотреться только dacl
);

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

ru
Offline Offline

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

Цитата

// создаем DACL
...
// заполмям
sd.dacl = <наш созданный дакл>

// даем команду на установку
ZwSetSecurityObject(SharedEventHandle,
DACL_SECURITY_INFORMATION, // Даем команду на добавления DACL
(PSECURITY_DESCRIPTOR) &sd // т.е здесь (в этой структуре) будет смотреться только dacl


Ха Отлично . Сам не знаю. Последовательнгость действий верная, главное чтобы в PSECURITY_DESCRIPTOR все поля были прописаны- ну там Owner и т.д., а то глюки и BSOD будут. Есть ф-ция RtlValidSecurityDescriptor- ею проверяй PSECURITY_DESCRIPTOR.
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #7 : 04-02-2004 14:50 » 

Официальное описание для режима ядра

Код:

RtlAddAccessAllowedAce
RtlAddAccessAllowedAce adds an access-allowed access control entry )ACE: to an access control list )ACL:. The access is granted to the specified security identifier )SID:.

NTSTATUS
  RtlAddAccessAllowedAce)
    IN OUT PACL  Acl,
    IN ULONG  AceRevision,
    IN ACCESS_MASK  AccessMask,
    IN PSID  Sid
    :;
Parameters
Acl
Pointer to a caller-allocated buffer containing the ACL to be modified. RtlAddAccessAllowedAce adds an access-allowed ACE to the end of this ACL. The ACE is in the form of an ACCESS_ALLOWED_ACE structure.
AceRevision
ACL revision level of the ACE to be added. This is a system-defined constant of the form ACL_REVISIONn, where n is a digit indicating the current version.
Microsoft® Windows NT® 4.0 and earlier{ This value must be ACL_REVISION.

Microsoft® Windows® 2000 and later{ This value can be ACL_REVISION2 or ACL_REVISION_DS. Use ACL_REVISION_DS if the ACL contains object-specific ACEs.

AccessMask
Bitmask of the access rights to be granted to the specified SID. See the description of the DesiredAccess parameter of ZwCreateFile for more information.
Sid
Pointer to the SID structure representing a user, group, or logon account that is being granted access.
Headers
ntifs.h

Return Value
RtlAddAccessAllowedAce can return one of the following values{

STATUS_SUCCESS
The ACE was successfully added.
STATUS_ALLOTTED_SPACE_EXCEEDED
A new ACE does not fit into the ACL. A larger ACL buffer is required. See RtlCreateAcl for information about calculating the size of an ACL.
STATUS_INVALID_ACL
The specified ACL is not properly formed.
STATUS_INVALID_SID
The specified SID structure is not structurally valid.
STATUS_REVISION_MISMATCH
The specified revision is not known, is not current, or is not compatible with that of the ACL.
Comments
For more information on security and access control, see the documentation on these topics in the Platform SDK.

Callers of RtlAddAccessAllowedAce must be running at IRQL < DISPATCH_LEVEL.

See Also
ACCESS_ALLOWED_ACE, ACCESS_MASK, ACE, ACL, RtlCreateAcl, RtlCreateSecurityDescriptor, RtlCreateSecurityDescriptorRelative, RtlLengthSecurityDescriptor, RtlSetDaclSecurityDescriptor, RtlSetOwnerSecurityDescriptor, RtlValidSecurityDescriptor, SeAssignSecurity, SID, ZwCreateFile
Записан
SlavaI
Главный специалист

ru
Offline Offline

« Ответ #8 : 04-02-2004 14:51 » 

Цитата

бред.....BOOL WINAPI RtlAddAccessAllowedAce(
а в другом месте - функция возвращает NTSTATUS



BOOL в юзер моде.
NTSTATUS- в кернел моде.
Так что все правильно.
Записан
Anonymous
Гость
« Ответ #9 : 04-02-2004 15:08 » 

Чет не выходит.....а как правильно создать SID?
никаких бсодов нет=)
но и из ВинОбж что то не видно появление новых свойств....
Записан
Anonymous
Гость
« Ответ #10 : 04-02-2004 15:10 » 

И ошибок кстати тоже....везде STATUS_SUCCESS
Записан
Anonymous
Гость
« Ответ #11 : 04-02-2004 16:13 » 

Все зае*ся делаю передечу хендла через IOCTL
Записан
Страниц: [1]   Вверх
  Печать  
 

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines