Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.005 c
15-1321342175
oleg1963lora
2011-11-15 11:29
2012.03.04
Анимация *.gif объектов


1-1287596219
MAcKZloy
2010-10-20 21:36
2012.03.04
XmlDocument и теги


15-1321449825
aka
2011-11-16 17:23
2012.03.04
Движение объектов по форме


2-1322388950
я
2011-11-27 14:15
2012.03.04
длина bmp в пикселях


2-1321907625
Елена
2011-11-22 00:33
2012.03.04
TPaintBox & TImage




   Наверх