func init // adds using namespace sys.add_use('System.Security.Principal') // initialize instance params = this.props('Constructor').value if(params == 'Constructor') params = '' + sys.get_typed_field('WindowsIdentity.GetCurrent().Token', 'UserToken', 20) elseif(params == 'Constructor2') params = '' + d("upn") elseif(params == 'Constructor3') params = '' + sys.get_typed_field('WindowsIdentity.GetCurrent().Token', 'UserToken', 20) + ', ' + d("type") elseif(params == 'Constructor4') params = '' + d("info") + ', ' + d("context") elseif(params == 'Constructor5') params = '' + d("upn") + ', ' + d("type") elseif(params == 'Constructor6') params = '' + sys.get_typed_field('WindowsIdentity.GetCurrent().Token', 'UserToken', 20) + ', ' + d("type") + ', ' + sys.get_typed_field('WindowsAccountType.Anonymous', 'AccountType', 20) elseif(params == 'Constructor7') params = '' + sys.get_typed_field('WindowsIdentity.GetCurrent().Token', 'UserToken', 20) + ', ' + d("type") + ', ' + sys.get_typed_field('WindowsAccountType.Anonymous', 'AccountType', 20) + ', ' + sys.get_typed_field('false', 'IsAuthenticated', 104) end sys.add_object(this.codename, 'WindowsIdentity', params) // makes implementation methods for properties sys._prop_init('AuthenticationType', 1, 0, 2) sys._prop_init('Groups', 1, 0, 0) sys._prop_init('ImpersonationLevel', 1, 0, 0) sys._prop_init('IsAnonymous', 1, 0, 104) sys._prop_init('.IsAuthenticated', 1, 0, 104) sys._prop_init('IsGuest', 1, 0, 104) sys._prop_init('IsSystem', 1, 0, 104) sys._prop_init('Name', 1, 0, 2) sys._prop_init('Owner', 1, 0, 0) sys._prop_init('Token', 1, 0, 0) sys._prop_init('User', 1, 0, 0) // makes implementation of methods as properties sys._mtd_as_prop_init('Impersonate()') sys._mtd_as_prop_init('WindowsIdentity') // makes implementation of simple methods sys._method_init('Dispose') end func doConstructor(data) blk.println(this.codename, ' = new WindowsIdentity(', sys.get_typed_field(data, 'UserToken', 20), ');') end func doConstructor2(data) blk.println(this.codename, ' = new WindowsIdentity(', d("upn"), ');') end func doConstructor3(data) blk.println(this.codename, ' = new WindowsIdentity(', sys.get_typed_field(data, 'UserToken', 20), ', ', d("type"), ');') end func doConstructor4(data) blk.println(this.codename, ' = new WindowsIdentity(', d("info"), ', ', d("context"), ');') end func doConstructor5(data) blk.println(this.codename, ' = new WindowsIdentity(', d("upn"), ', ', d("type"), ');') end func doConstructor6(data) blk.println(this.codename, ' = new WindowsIdentity(', sys.get_typed_field(data, 'UserToken', 20), ', ', d("type"), ', ', sys.get_typed_field(data, 'AccountType', 20), ');') end func doConstructor7(data) blk.println(this.codename, ' = new WindowsIdentity(', sys.get_typed_field(data, 'UserToken', 20), ', ', d("type"), ', ', sys.get_typed_field(data, 'AccountType', 20), ', ', sys.get_typed_field(data, 'IsAuthenticated', 104), ');') end func GetAnonymous return('WindowsIdentity.GetAnonymous()') end func GetCurrent return('WindowsIdentity.GetCurrent()') end func doGetCurrent2(data) if(linked("onGetCurrent")) event("onGetCurrent", 'WindowsIdentity.GetCurrent(' + sys.get_typed_field(data, 'IsAuthenticated', 104) + ')') else blk.println('WindowsIdentity.GetCurrent(', sys.get_typed_field(data, 'IsAuthenticated', 104), ');') end end func doGetCurrent3(data) if(linked("onGetCurrent")) event("onGetCurrent", 'WindowsIdentity.GetCurrent(' + sys.get_typed_field(data, 'DesiredAccess', 20) + ')') else blk.println('WindowsIdentity.GetCurrent(', sys.get_typed_field(data, 'DesiredAccess', 20), ');') end end func doImpersonate2(data) if(linked("onImpersonate")) event("onImpersonate", 'WindowsIdentity.Impersonate(' + sys.get_typed_field(data, 'UserToken', 20) + ')') else blk.println('WindowsIdentity.Impersonate(', sys.get_typed_field(data, 'UserToken', 20), ');') end end