@@ -4,36 +4,6 @@ use msixbundle::*;
44use std:: path:: Path ;
55use tempfile:: tempdir;
66
7- fn is_elevated ( ) -> bool {
8- use std:: mem;
9- use windows_sys:: Win32 :: Foundation :: CloseHandle ;
10- use windows_sys:: Win32 :: Security :: {
11- GetTokenInformation , OpenProcessToken , TokenElevation , TOKEN_ELEVATION , TOKEN_QUERY ,
12- } ;
13- use windows_sys:: Win32 :: System :: Threading :: GetCurrentProcess ;
14-
15- unsafe {
16- let mut token = std:: mem:: zeroed ( ) ;
17- if OpenProcessToken ( GetCurrentProcess ( ) , TOKEN_QUERY , & mut token) == 0 {
18- return false ;
19- }
20-
21- let mut elevation: TOKEN_ELEVATION = mem:: zeroed ( ) ;
22- let mut size = mem:: size_of :: < TOKEN_ELEVATION > ( ) as u32 ;
23-
24- let result = GetTokenInformation (
25- token,
26- TokenElevation ,
27- & mut elevation as * mut _ as * mut _ ,
28- size,
29- & mut size,
30- ) ;
31-
32- CloseHandle ( token) ;
33- result != 0 && elevation. TokenIsElevated != 0
34- }
35- }
36-
377fn create_minimal_appx_content ( dir : & Path ) {
388 let manifest = r#"<?xml version="1.0" encoding="utf-8"?>
399<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
@@ -428,8 +398,6 @@ fn test_read_manifest_missing_version() {
428398
429399#[ test]
430400fn test_validate_msix ( ) {
431- assert ! ( is_elevated( ) , "test requires admin elevation" ) ;
432-
433401 let tools = locate_sdk_tools ( ) . expect ( "locate SDK" ) ;
434402 assert ! ( tools. appcert. is_some( ) , "WACK not installed" ) ;
435403
@@ -445,8 +413,6 @@ fn test_validate_msix() {
445413
446414#[ test]
447415fn test_validate_bundle ( ) {
448- assert ! ( is_elevated( ) , "test requires admin elevation" ) ;
449-
450416 let tools = locate_sdk_tools ( ) . expect ( "locate SDK" ) ;
451417 assert ! ( tools. appcert. is_some( ) , "WACK not installed" ) ;
452418
0 commit comments