■ SetKernelObjectSecurity 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 |
using System; using System.Runtime.InteropServices; #region 커널 객체 보안 설정하기 - SetKernelObjectSecurity(handle, securityInformation, securityDescriptor) /// <summary> /// 커널 객체 보안 설정하기 /// </summary> /// <param name="handle">커널 객체 핸들</param> /// <param name="securityInformation">보안 정보</param> /// <param name="securityDescriptor">보안 설명자</param> /// <returns>처리 결과</returns> [DllImport("advapi32", SetLastError = true)] private static extern bool SetKernelObjectSecurity ( IntPtr handle, int securityInformation, [In] byte[] securityDescriptor ); #endregion |