■ CreateEnvironmentBlock API 함수를 선언하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
using System; using System.Runtime.InteropServices; #region 환경 블럭 생성하기 - CreateEnvironmentBlock(environmentHandle, tokenHandle, inherit) /// <summary> /// 환경 블럭 생성하기 /// </summary> /// <param name="environmentHandle">환경 핸들</param> /// <param name="tokenHandle">토큰 핸들</param> /// <param name="inherit">상속 여부</param> /// <returns>처리 결과</returns> [DllImport("userenv", SetLastError = true)] private static extern bool CreateEnvironmentBlock(ref IntPtr environmentHandle, IntPtr tokenHandle, bool inherit); #endregion |