Exemplo n.º 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();
            }
        }
Exemplo n.º 2
0
 public static extern IntPtr CreateActCtx(ref ACTCTX actctx);
Exemplo n.º 3
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();
            }
        }
Exemplo n.º 4
0
 public static extern IntPtr CreateActCtx(ref ACTCTX actctx);