Exemple #1
0
        public void CreateAndActivate(string manifest)
        {
            var actCtx = new ACTCTX();

            actCtx.cbSize         = Marshal.SizeOf(typeof(ACTCTX));
            actCtx.dwFlags        = 0;
            actCtx.lpSource       = manifest;
            actCtx.lpResourceName = null;

            hActCtx = Kernel32.CreateActCtx(ref actCtx);
            if (hActCtx == new IntPtr(-1))
            {
                throw new Win32Exception();
            }

            if (!Kernel32.ActivateActCtx(hActCtx, out cookie))
            {
                throw new Win32Exception();
            }
        }
 public static extern IntPtr CreateActCtx(ref ACTCTX actctx);
        public void CreateAndActivate(string manifest)
        {
            var actCtx = new ACTCTX();
            actCtx.cbSize = Marshal.SizeOf(typeof(ACTCTX));
            actCtx.dwFlags = 0;
            actCtx.lpSource = manifest;
            actCtx.lpResourceName = null;

            hActCtx = Kernel32.CreateActCtx(ref actCtx);
            if (hActCtx == new IntPtr(-1))
            {
                throw new Win32Exception();
            }

            if (!Kernel32.ActivateActCtx(hActCtx, out cookie))
            {
                throw new Win32Exception();
            }
        }
Exemple #4
0
 public static extern IntPtr CreateActCtx(ref ACTCTX actctx);