■ GetKernelObjectSecurity API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
using System; using System.Runtime.InteropServices; #region 커널 객체 보안 구하기 - GetKernelObjectSecurity(handle, securityInformation, securityDescriptor, length, lengthNeeded) /// <summary> /// 커널 객체 보안 구하기 /// </summary> /// <param name="handle">커널 객체 핸들</param> /// <param name="securityInformation">보안 정보</param> /// <param name="securityDescriptor">보안 설명자</param> /// <param name="length">길이</param> /// <param name="lengthNeeded">필요 길이</param> /// <returns>처리 결과</returns> [DllImport("advapi32", SetLastError = true)] private static extern bool GetKernelObjectSecurity ( IntPtr handle, int securityInformation, [Out] byte[] securityDescriptor, uint length, out uint lengthNeeded ); #endregion |