# Include <SDDL. h> void createlowprocess () {boolbret; handlehtoken; handlehnewtoken; // notepad is used as an example wcharwszprocessname [max_path] = l "C: // windows // system32 // notepad.exe "; // low integrity Sid wcharwszintegritysid [20] = l" S-1-16-4096 "; psidpintegritysid = NULL; token_mandatory_label til = {0 }; process_information procinfo = {0}; startupinfostartupinfo = {0}; ulongexitcode = 0; If (openprocesstoken (getcurrentprocess (), maximum_allowed, & htoken) {if, null, securityimpersonation, tokenprimary, & hnewtoken) {If (convertstringsidtosid (wszintegritysid, & pintegritysid) {Til. label. attributes = se_group_integrity; Til. label. SID = pintegritysid; // set the process integrity level if (settokeninformation (hnewtoken, tokenintegritylevel, & til, sizeof (token_mandatory_label) + getlengthsid (pintegritysid ))) {// create the new process at low integrity Bret = createprocessasuser (hnewtoken, null, wszprocessname, null, null, false, 0, null, null, & startupinfo, & procinfo );} localfree (pintegritysid);} closehandle (hnewtoken);} closehandle (htoken );}}