Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2012.03.04;
Скачать: CL | DM;

Вниз

как определить владельца мьютекса (mutex owner)   Найти похожие ветки 

 
intlex   (2009-10-06 19:09) [0]

по сабжу,
пробовал NtQueryObject, но пока безуспешно, может кто поможет?


 
clickmaker ©   (2009-10-07 12:14) [1]

GetKernelObjectSecurity(MutexHandle, OWNER_SECURITY_INFORMATION, ... ?


 
intlex   (2009-10-07 15:09) [2]


 InitializeSecurityDescriptor(@sd, SECURITY_DESCRIPTOR_REVISION);
 SetSecurityDescriptorDacl(@sd, True, nil, False);
 sa.nLength := SizeOf(TSecurityAttributes);
 sa.lpSecurityDescriptor := @sd;
 sa.bInheritHandle := False;
 Mutex := CreateMutex(@sa, False, MutexName);
 if (Mutex = 0) then ...;
 if GetLastError = ERROR_ALREADY_EXISTS) then
 begin
   GetKernelObjectSecurity(Mutex, OWNER_SECURITY_INFORMATION, @sd, SizeOf(TSecurityDescriptor), l);
   //GetSecurityDescriptorOwner(@sd, MData, b);

получается sd.Owner = nil, MData = nil
если предварительно заполнить sd.Owner := Pointer(GetCurrentProcessId),
то CreateMutex возвращает 0.
наверное, я что-то не понимаю))


 
clickmaker ©   (2009-10-07 16:14) [3]

var sd: PSecurityDescriptor;

GetKernelObjectSecurity(Mutex, OWNER_SECURITY_INFORMATION, nil, 0, len);
sd := AllocMem(len);
GetKernelObjectSecurity(Mutex, OWNER_SECURITY_INFORMATION, sd, len, len);

а так?


 
intlex   (2009-10-07 16:25) [4]

спасибо, так получилось)



Страницы: 1 вся ветка

Текущий архив: 2012.03.04;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.01 c
15-1321116538
Laguna
2011-11-12 20:48
2012.03.04
Пропал доступ к ресурсам из меню.


4-1254988754
teapo1989
2009-10-08 11:59
2012.03.04
Получение handle окон


6-1252927401
Дмитрий Белькевич
2009-09-14 15:23
2012.03.04
Можно ли как-то узнать, какое приложение фильтрует порт?


2-1322424843
Vyacheslav
2011-11-28 00:14
2012.03.04
Использованние TMemo не для визуального компонента


15-1321409838
Sher
2011-11-16 06:17
2012.03.04
DBGrid to StringGrid