Signed-off-by: Michael Stefaniuc mstefani@winehq.org --- dlls/ntdll/actctx.c | 532 ++++++++++++++++---------------------------- 1 file changed, 194 insertions(+), 338 deletions(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c index faccd21d4b1..5db464a383e 100644 --- a/dlls/ntdll/actctx.c +++ b/dlls/ntdll/actctx.c @@ -565,125 +565,25 @@ struct actctx_loader static const xmlstr_t empty_xmlstr;
#ifdef __i386__ -static const WCHAR current_archW[] = {'x','8','6',0}; +static const WCHAR current_archW[] = L"x86"; #elif defined __x86_64__ -static const WCHAR current_archW[] = {'a','m','d','6','4',0}; +static const WCHAR current_archW[] = L"amd64"; #elif defined __arm__ -static const WCHAR current_archW[] = {'a','r','m',0}; +static const WCHAR current_archW[] = L"arm"; #elif defined __aarch64__ -static const WCHAR current_archW[] = {'a','r','m','6','4',0}; +static const WCHAR current_archW[] = L"arm64"; #else -static const WCHAR current_archW[] = {'n','o','n','e',0}; +static const WCHAR current_archW[] = L"none"; #endif
-static const WCHAR asmv1W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','1',0}; -static const WCHAR asmv2W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','2',0}; -static const WCHAR asmv3W[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','a','s','m','.','v','3',0}; -static const WCHAR assemblyW[] = {'a','s','s','e','m','b','l','y',0}; -static const WCHAR assemblyIdentityW[] = {'a','s','s','e','m','b','l','y','I','d','e','n','t','i','t','y',0}; -static const WCHAR bindingRedirectW[] = {'b','i','n','d','i','n','g','R','e','d','i','r','e','c','t',0}; -static const WCHAR clrClassW[] = {'c','l','r','C','l','a','s','s',0}; -static const WCHAR clrSurrogateW[] = {'c','l','r','S','u','r','r','o','g','a','t','e',0}; -static const WCHAR comClassW[] = {'c','o','m','C','l','a','s','s',0}; -static const WCHAR comInterfaceExternalProxyStubW[] = {'c','o','m','I','n','t','e','r','f','a','c','e','E','x','t','e','r','n','a','l','P','r','o','x','y','S','t','u','b',0}; -static const WCHAR comInterfaceProxyStubW[] = {'c','o','m','I','n','t','e','r','f','a','c','e','P','r','o','x','y','S','t','u','b',0}; -static const WCHAR dependencyW[] = {'d','e','p','e','n','d','e','n','c','y',0}; -static const WCHAR dependentAssemblyW[] = {'d','e','p','e','n','d','e','n','t','A','s','s','e','m','b','l','y',0}; -static const WCHAR descriptionW[] = {'d','e','s','c','r','i','p','t','i','o','n',0}; -static const WCHAR fileW[] = {'f','i','l','e',0}; -static const WCHAR hashW[] = {'h','a','s','h',0}; -static const WCHAR noInheritW[] = {'n','o','I','n','h','e','r','i','t',0}; -static const WCHAR noInheritableW[] = {'n','o','I','n','h','e','r','i','t','a','b','l','e',0}; -static const WCHAR typelibW[] = {'t','y','p','e','l','i','b',0}; -static const WCHAR windowClassW[] = {'w','i','n','d','o','w','C','l','a','s','s',0}; - -static const WCHAR clsidW[] = {'c','l','s','i','d',0}; -static const WCHAR hashalgW[] = {'h','a','s','h','a','l','g',0}; -static const WCHAR helpdirW[] = {'h','e','l','p','d','i','r',0}; -static const WCHAR iidW[] = {'i','i','d',0}; -static const WCHAR languageW[] = {'l','a','n','g','u','a','g','e',0}; -static const WCHAR manifestVersionW[] = {'m','a','n','i','f','e','s','t','V','e','r','s','i','o','n',0}; -static const WCHAR nameW[] = {'n','a','m','e',0}; -static const WCHAR neutralW[] = {'n','e','u','t','r','a','l',0}; -static const WCHAR newVersionW[] = {'n','e','w','V','e','r','s','i','o','n',0}; -static const WCHAR oldVersionW[] = {'o','l','d','V','e','r','s','i','o','n',0}; -static const WCHAR optionalW[] = {'o','p','t','i','o','n','a','l',0}; -static const WCHAR processorArchitectureW[] = {'p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e',0}; -static const WCHAR progidW[] = {'p','r','o','g','i','d',0}; -static const WCHAR publicKeyTokenW[] = {'p','u','b','l','i','c','K','e','y','T','o','k','e','n',0}; -static const WCHAR threadingmodelW[] = {'t','h','r','e','a','d','i','n','g','M','o','d','e','l',0}; -static const WCHAR tlbidW[] = {'t','l','b','i','d',0}; -static const WCHAR typeW[] = {'t','y','p','e',0}; -static const WCHAR versionW[] = {'v','e','r','s','i','o','n',0}; -static const WCHAR xmlnsW[] = {'x','m','l','n','s',0}; -static const WCHAR versionedW[] = {'v','e','r','s','i','o','n','e','d',0}; -static const WCHAR yesW[] = {'y','e','s',0}; -static const WCHAR noW[] = {'n','o',0}; -static const WCHAR restrictedW[] = {'R','E','S','T','R','I','C','T','E','D',0}; -static const WCHAR controlW[] = {'C','O','N','T','R','O','L',0}; -static const WCHAR hiddenW[] = {'H','I','D','D','E','N',0}; -static const WCHAR hasdiskimageW[] = {'H','A','S','D','I','S','K','I','M','A','G','E',0}; -static const WCHAR flagsW[] = {'f','l','a','g','s',0}; -static const WCHAR miscstatusW[] = {'m','i','s','c','S','t','a','t','u','s',0}; -static const WCHAR miscstatusiconW[] = {'m','i','s','c','S','t','a','t','u','s','I','c','o','n',0}; -static const WCHAR miscstatuscontentW[] = {'m','i','s','c','S','t','a','t','u','s','C','o','n','t','e','n','t',0}; -static const WCHAR miscstatusthumbnailW[] = {'m','i','s','c','S','t','a','t','u','s','T','h','u','m','b','n','a','i','l',0}; -static const WCHAR miscstatusdocprintW[] = {'m','i','s','c','S','t','a','t','u','s','D','o','c','P','r','i','n','t',0}; -static const WCHAR baseInterfaceW[] = {'b','a','s','e','I','n','t','e','r','f','a','c','e',0}; -static const WCHAR nummethodsW[] = {'n','u','m','M','e','t','h','o','d','s',0}; -static const WCHAR proxyStubClsid32W[] = {'p','r','o','x','y','S','t','u','b','C','l','s','i','d','3','2',0}; -static const WCHAR runtimeVersionW[] = {'r','u','n','t','i','m','e','V','e','r','s','i','o','n',0}; -static const WCHAR mscoreeW[] = {'M','S','C','O','R','E','E','.','D','L','L',0}; -static const WCHAR mscoree2W[] = {'m','s','c','o','r','e','e','.','d','l','l',0}; - -static const WCHAR activatewhenvisibleW[] = {'a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0}; -static const WCHAR actslikebuttonW[] = {'a','c','t','s','l','i','k','e','b','u','t','t','o','n',0}; -static const WCHAR actslikelabelW[] = {'a','c','t','s','l','i','k','e','l','a','b','e','l',0}; -static const WCHAR alignableW[] = {'a','l','i','g','n','a','b','l','e',0}; -static const WCHAR alwaysrunW[] = {'a','l','w','a','y','s','r','u','n',0}; -static const WCHAR canlinkbyole1W[] = {'c','a','n','l','i','n','k','b','y','o','l','e','1',0}; -static const WCHAR cantlinkinsideW[] = {'c','a','n','t','l','i','n','k','i','n','s','i','d','e',0}; -static const WCHAR ignoreactivatewhenvisibleW[] = {'i','g','n','o','r','e','a','c','t','i','v','a','t','e','w','h','e','n','v','i','s','i','b','l','e',0}; -static const WCHAR imemodeW[] = {'i','m','e','m','o','d','e',0}; -static const WCHAR insertnotreplaceW[] = {'i','n','s','e','r','t','n','o','t','r','e','p','l','a','c','e',0}; -static const WCHAR insideoutW[] = {'i','n','s','i','d','e','o','u','t',0}; -static const WCHAR invisibleatruntimeW[] = {'i','n','v','i','s','i','b','l','e','a','t','r','u','n','t','i','m','e',0}; -static const WCHAR islinkobjectW[] = {'i','s','l','i','n','k','o','b','j','e','c','t',0}; -static const WCHAR nouiactivateW[] = {'n','o','u','i','a','c','t','i','v','a','t','e',0}; -static const WCHAR onlyiconicW[] = {'o','n','l','y','i','c','o','n','i','c',0}; -static const WCHAR recomposeonresizeW[] = {'r','e','c','o','m','p','o','s','e','o','n','r','e','s','i','z','e',0}; -static const WCHAR renderingisdeviceindependentW[] = {'r','e','n','d','e','r','i','n','g','i','s','d','e','v','i','c','e','i','n','d','e','p','e','n','d','e','n','t',0}; -static const WCHAR setclientsitefirstW[] = {'s','e','t','c','l','i','e','n','t','s','i','t','e','f','i','r','s','t',0}; -static const WCHAR simpleframeW[] = {'s','i','m','p','l','e','f','r','a','m','e',0}; -static const WCHAR staticW[] = {'s','t','a','t','i','c',0}; -static const WCHAR supportsmultilevelundoW[] = {'s','u','p','p','o','r','t','s','m','u','l','t','i','l','e','v','e','l','u','n','d','o',0}; -static const WCHAR wantstomenumergeW[] = {'w','a','n','t','s','t','o','m','e','n','u','m','e','r','g','e',0}; - -static const WCHAR compatibilityW[] = {'c','o','m','p','a','t','i','b','i','l','i','t','y',0}; -static const WCHAR compatibilityNSW[] = {'u','r','n',':','s','c','h','e','m','a','s','-','m','i','c','r','o','s','o','f','t','-','c','o','m',':','c','o','m','p','a','t','i','b','i','l','i','t','y','.','v','1',0}; -static const WCHAR applicationW[] = {'a','p','p','l','i','c','a','t','i','o','n',0}; -static const WCHAR supportedOSW[] = {'s','u','p','p','o','r','t','e','d','O','S',0}; -static const WCHAR IdW[] = {'I','d',0}; -static const WCHAR requestedExecutionLevelW[] = {'r','e','q','u','e','s','t','e','d','E','x','e','c','u','t','i','o','n','L','e','v','e','l',0}; -static const WCHAR requestedPrivilegesW[] = {'r','e','q','u','e','s','t','e','d','P','r','i','v','i','l','e','g','e','s',0}; -static const WCHAR securityW[] = {'s','e','c','u','r','i','t','y',0}; -static const WCHAR trustInfoW[] = {'t','r','u','s','t','I','n','f','o',0}; -static const WCHAR windowsSettingsW[] = {'w','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}; -static const WCHAR autoElevateW[] = {'a','u','t','o','E','l','e','v','a','t','e',0}; -static const WCHAR disableThemingW[] = {'d','i','s','a','b','l','e','T','h','e','m','i','n','g',0}; -static const WCHAR disableWindowFilteringW[] = {'d','i','s','a','b','l','e','W','i','n','d','o','w','F','i','l','t','e','r','i','n','g',0}; -static const WCHAR windowsSettings2005NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','0','5','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}; -static const WCHAR windowsSettings2011NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','1','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}; -static const WCHAR windowsSettings2016NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','6','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}; -static const WCHAR windowsSettings2017NSW[] = {'h','t','t','p',':','/','/','s','c','h','e','m','a','s','.','m','i','c','r','o','s','o','f','t','.','c','o','m','/','S','M','I','/','2','0','1','7','/','W','i','n','d','o','w','s','S','e','t','t','i','n','g','s',0}; -static const WCHAR dpiAwareW[] = {'d','p','i','A','w','a','r','e',0}; -static const WCHAR dpiAwarenessW[] = {'d','p','i','A','w','a','r','e','n','e','s','s',0}; -static const WCHAR gdiScalingW[] = {'g','d','i','S','c','a','l','i','n','g',0}; -static const WCHAR highResolutionScrollingAwareW[] = {'h','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0}; -static const WCHAR longPathAwareW[] = {'l','o','n','g','P','a','t','h','A','w','a','r','e',0}; -static const WCHAR magicFutureSettingW[] = {'m','a','g','i','c','F','u','t','u','r','e','S','e','t','t','i','n','g',0}; -static const WCHAR printerDriverIsolationW[] = {'p','r','i','n','t','e','r','D','r','i','v','e','r','I','s','o','l','a','t','i','o','n',0}; -static const WCHAR ultraHighResolutionScrollingAwareW[] = {'u','l','t','r','a','H','i','g','h','R','e','s','o','l','u','t','i','o','n','S','c','r','o','l','l','i','n','g','A','w','a','r','e',0}; +static const WCHAR asmv1W[] = L"urn:schemas-microsoft-com:asm.v1"; +static const WCHAR asmv2W[] = L"urn:schemas-microsoft-com:asm.v2"; +static const WCHAR asmv3W[] = L"urn:schemas-microsoft-com:asm.v3"; +static const WCHAR compatibilityNSW[] = L"urn:schemas-microsoft-com:compatibility.v1"; +static const WCHAR windowsSettings2005NSW[] = L"http://schemas.microsoft.com/SMI/2005/WindowsSettings"; +static const WCHAR windowsSettings2011NSW[] = L"http://schemas.microsoft.com/SMI/2011/WindowsSettings"; +static const WCHAR windowsSettings2016NSW[] = L"http://schemas.microsoft.com/SMI/2016/WindowsSettings"; +static const WCHAR windowsSettings2017NSW[] = L"http://schemas.microsoft.com/SMI/2017/WindowsSettings";
struct olemisc_entry { @@ -693,35 +593,30 @@ struct olemisc_entry
static const struct olemisc_entry olemisc_values[] = { - { activatewhenvisibleW, OLEMISC_ACTIVATEWHENVISIBLE }, - { actslikebuttonW, OLEMISC_ACTSLIKEBUTTON }, - { actslikelabelW, OLEMISC_ACTSLIKELABEL }, - { alignableW, OLEMISC_ALIGNABLE }, - { alwaysrunW, OLEMISC_ALWAYSRUN }, - { canlinkbyole1W, OLEMISC_CANLINKBYOLE1 }, - { cantlinkinsideW, OLEMISC_CANTLINKINSIDE }, - { ignoreactivatewhenvisibleW, OLEMISC_IGNOREACTIVATEWHENVISIBLE }, - { imemodeW, OLEMISC_IMEMODE }, - { insertnotreplaceW, OLEMISC_INSERTNOTREPLACE }, - { insideoutW, OLEMISC_INSIDEOUT }, - { invisibleatruntimeW, OLEMISC_INVISIBLEATRUNTIME }, - { islinkobjectW, OLEMISC_ISLINKOBJECT }, - { nouiactivateW, OLEMISC_NOUIACTIVATE }, - { onlyiconicW, OLEMISC_ONLYICONIC }, - { recomposeonresizeW, OLEMISC_RECOMPOSEONRESIZE }, - { renderingisdeviceindependentW, OLEMISC_RENDERINGISDEVICEINDEPENDENT }, - { setclientsitefirstW, OLEMISC_SETCLIENTSITEFIRST }, - { simpleframeW, OLEMISC_SIMPLEFRAME }, - { staticW, OLEMISC_STATIC }, - { supportsmultilevelundoW, OLEMISC_SUPPORTSMULTILEVELUNDO }, - { wantstomenumergeW, OLEMISC_WANTSTOMENUMERGE } + { L"activatewhenvisible", OLEMISC_ACTIVATEWHENVISIBLE }, + { L"actslikebutton", OLEMISC_ACTSLIKEBUTTON }, + { L"actslikelabel", OLEMISC_ACTSLIKELABEL }, + { L"alignable", OLEMISC_ALIGNABLE }, + { L"alwaysrun", OLEMISC_ALWAYSRUN }, + { L"canlinkbyole1", OLEMISC_CANLINKBYOLE1 }, + { L"cantlinkinside", OLEMISC_CANTLINKINSIDE }, + { L"ignoreactivatewhenvisible", OLEMISC_IGNOREACTIVATEWHENVISIBLE }, + { L"imemode", OLEMISC_IMEMODE }, + { L"insertnotreplace", OLEMISC_INSERTNOTREPLACE }, + { L"insideout", OLEMISC_INSIDEOUT }, + { L"invisibleatruntime", OLEMISC_INVISIBLEATRUNTIME }, + { L"islinkobject", OLEMISC_ISLINKOBJECT }, + { L"nouiactivate", OLEMISC_NOUIACTIVATE }, + { L"onlyiconic", OLEMISC_ONLYICONIC }, + { L"recomposeonresize", OLEMISC_RECOMPOSEONRESIZE }, + { L"renderingisdeviceindependent", OLEMISC_RENDERINGISDEVICEINDEPENDENT }, + { L"setclientsitefirst", OLEMISC_SETCLIENTSITEFIRST }, + { L"simpleframe", OLEMISC_SIMPLEFRAME }, + { L"static", OLEMISC_STATIC }, + { L"supportsmultilevelundo", OLEMISC_SUPPORTSMULTILEVELUNDO }, + { L"wantstomenumerge", OLEMISC_WANTSTOMENUMERGE } };
-static const WCHAR xmlW[] = {'?','x','m','l',0}; -static const WCHAR dotManifestW[] = {'.','m','a','n','i','f','e','s','t',0}; -static const WCHAR version_formatW[] = {'%','u','.','%','u','.','%','u','.','%','u',0}; -static const WCHAR wildcardW[] = {'*',0}; - static ACTIVATION_CONTEXT system_actctx = { ACTCTX_MAGIC, 1 }; static ACTIVATION_CONTEXT *process_actctx = &system_actctx;
@@ -1008,7 +903,7 @@ static BOOL is_matching_identity( const struct assembly_identity *id1,
if (id1->language && id2->language && !is_matching_string( id1->language, id2->language )) { - if (wcscmp( wildcardW, id1->language ) && wcscmp( wildcardW, id2->language )) + if (wcscmp( L"*", id1->language ) && wcscmp( L"*", id2->language )) return FALSE; } if (id1->version.major != id2->version.major) return FALSE; @@ -1078,14 +973,11 @@ static void free_depend_manifests(struct actctx_loader* acl)
static WCHAR *build_assembly_dir(struct assembly_identity* ai) { - static const WCHAR undW[] = {'_',0}; - static const WCHAR noneW[] = {'n','o','n','e',0}; - static const WCHAR mskeyW[] = {'d','e','a','d','b','e','e','f',0}; - - const WCHAR *arch = ai->arch ? ai->arch : noneW; - const WCHAR *key = ai->public_key ? ai->public_key : noneW; - const WCHAR *lang = ai->language ? ai->language : noneW; - const WCHAR *name = ai->name ? ai->name : noneW; + static const WCHAR mskeyW[] = L"deadbeef"; + const WCHAR *arch = ai->arch ? ai->arch : L"none"; + const WCHAR *key = ai->public_key ? ai->public_key : L"none"; + const WCHAR *lang = ai->language ? ai->language : L"none"; + const WCHAR *name = ai->name ? ai->name : L"none"; SIZE_T size = (wcslen(arch) + 1 + wcslen(name) + 1 + wcslen(key) + 24 + 1 + wcslen(lang) + 1) * sizeof(WCHAR) + sizeof(mskeyW); WCHAR *ret; @@ -1093,16 +985,16 @@ static WCHAR *build_assembly_dir(struct assembly_identity* ai) if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, size ))) return NULL;
wcscpy( ret, arch ); - wcscat( ret, undW ); + wcscat( ret, L"_" ); wcscat( ret, name ); - wcscat( ret, undW ); + wcscat( ret, L"_" ); wcscat( ret, key ); - wcscat( ret, undW ); - swprintf( ret + wcslen(ret), size - wcslen(ret), version_formatW, + wcscat( ret, L"_" ); + swprintf( ret + wcslen(ret), size - wcslen(ret), L"%u.%u.%u.%u", ai->version.major, ai->version.minor, ai->version.build, ai->version.revision ); - wcscat( ret, undW ); + wcscat( ret, L"_" ); wcscat( ret, lang ); - wcscat( ret, undW ); + wcscat( ret, L"_" ); wcscat( ret, mskeyW ); return ret; } @@ -1123,35 +1015,26 @@ static inline void append_string( WCHAR *buffer, const WCHAR *prefix, const WCHA
static WCHAR *build_assembly_id( const struct assembly_identity *ai ) { - static const WCHAR archW[] = - {',','p','r','o','c','e','s','s','o','r','A','r','c','h','i','t','e','c','t','u','r','e','=',0}; - static const WCHAR public_keyW[] = - {',','p','u','b','l','i','c','K','e','y','T','o','k','e','n','=',0}; - static const WCHAR typeW[] = - {',','t','y','p','e','=',0}; - static const WCHAR versionW[] = - {',','v','e','r','s','i','o','n','=',0}; - WCHAR version[64], *ret; SIZE_T size = 0;
- swprintf( version, ARRAY_SIZE(version), version_formatW, + swprintf( version, ARRAY_SIZE(version), L"%u.%u.%u.%u", ai->version.major, ai->version.minor, ai->version.build, ai->version.revision ); if (ai->name) size += wcslen(ai->name) * sizeof(WCHAR); - if (ai->arch) size += wcslen(archW) + wcslen(ai->arch) + 2; - if (ai->public_key) size += wcslen(public_keyW) + wcslen(ai->public_key) + 2; - if (ai->type) size += wcslen(typeW) + wcslen(ai->type) + 2; - size += wcslen(versionW) + wcslen(version) + 2; + if (ai->arch) size += wcslen(L",processorArchitecture=") + wcslen(ai->arch) + 2; + if (ai->public_key) size += wcslen(L",publicKeyToken=") + wcslen(ai->public_key) + 2; + if (ai->type) size += wcslen(L",type=") + wcslen(ai->type) + 2; + size += wcslen(L",version=") + wcslen(version) + 2;
if (!(ret = RtlAllocateHeap( GetProcessHeap(), 0, (size + 1) * sizeof(WCHAR) ))) return NULL;
if (ai->name) wcscpy( ret, ai->name ); else *ret = 0; - append_string( ret, archW, ai->arch ); - append_string( ret, public_keyW, ai->public_key ); - append_string( ret, typeW, ai->type ); - append_string( ret, versionW, version ); + append_string( ret, L",processorArchitecture=", ai->arch ); + append_string( ret, L",publicKeyToken=", ai->public_key ); + append_string( ret, L",type=", ai->type ); + append_string( ret, L",version=", version ); return ret; }
@@ -1222,15 +1105,15 @@ static BOOL set_error( xmlbuf_t *xmlbuf )
static BOOL is_xmlns_attr( const struct xml_attr *attr ) { - const int len = wcslen( xmlnsW ); + const int len = wcslen( L"xmlns" ); if (attr->name.len < len) return FALSE; - if (wcsncmp( attr->name.ptr, xmlnsW, len )) return FALSE; + if (wcsncmp( attr->name.ptr, L"xmlns", len )) return FALSE; return (attr->name.len == len || attr->name.ptr[len] == ':'); }
static void push_xmlns( xmlbuf_t *xmlbuf, const struct xml_attr *attr ) { - const int len = wcslen( xmlnsW ); + const int len = wcslen( L"xmlns" ); struct xml_attr *ns;
if (xmlbuf->ns_pos == MAX_NAMESPACES - 1) @@ -1527,27 +1410,27 @@ static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *a
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, nameW)) + if (xml_attr_cmp(&attr, L"name")) { if (!(ai->name = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, typeW)) + else if (xml_attr_cmp(&attr, L"type")) { if (!(ai->type = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, versionW)) + else if (xml_attr_cmp(&attr, L"version")) { if (!parse_version(&attr.value, &ai->version)) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, processorArchitectureW)) + else if (xml_attr_cmp(&attr, L"processorArchitecture")) { if (!(ai->arch = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, publicKeyTokenW)) + else if (xml_attr_cmp(&attr, L"publicKeyToken")) { if (!(ai->public_key = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, languageW)) + else if (xml_attr_cmp(&attr, L"language")) { if (!(ai->language = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } @@ -1565,19 +1448,14 @@ static void parse_assembly_identity_elem(xmlbuf_t *xmlbuf, ACTIVATION_CONTEXT *a
static enum comclass_threadingmodel parse_com_class_threadingmodel(xmlstr_t *value) { - static const WCHAR apartW[] = {'A','p','a','r','t','m','e','n','t',0}; - static const WCHAR neutralW[] = {'N','e','u','t','r','a','l',0}; - static const WCHAR freeW[] = {'F','r','e','e',0}; - static const WCHAR bothW[] = {'B','o','t','h',0}; - if (value->len == 0) return ThreadingModel_No; - if (xmlstr_cmp(value, apartW)) + if (xmlstr_cmp(value, L"Apartment")) return ThreadingModel_Apartment; - else if (xmlstr_cmp(value, freeW)) + else if (xmlstr_cmp(value, L"Free")) return ThreadingModel_Free; - else if (xmlstr_cmp(value, bothW)) + else if (xmlstr_cmp(value, L"Both")) return ThreadingModel_Both; - else if (xmlstr_cmp(value, neutralW)) + else if (xmlstr_cmp(value, L"Neutral")) return ThreadingModel_Neutral; else return ThreadingModel_No; @@ -1686,43 +1564,43 @@ static void parse_com_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll, st
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, clsidW)) + if (xml_attr_cmp(&attr, L"clsid")) { if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, progidW)) + else if (xml_attr_cmp(&attr, L"progid")) { if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, tlbidW)) + else if (xml_attr_cmp(&attr, L"tlbid")) { if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, threadingmodelW)) + else if (xml_attr_cmp(&attr, L"threadingModel")) { entity->u.comclass.model = parse_com_class_threadingmodel(&attr.value); } - else if (xml_attr_cmp(&attr, miscstatusW)) + else if (xml_attr_cmp(&attr, L"miscStatus")) { entity->u.comclass.miscstatus = parse_com_class_misc(&attr.value); } - else if (xml_attr_cmp(&attr, miscstatuscontentW)) + else if (xml_attr_cmp(&attr, L"miscStatusContent")) { entity->u.comclass.miscstatuscontent = parse_com_class_misc(&attr.value); } - else if (xml_attr_cmp(&attr, miscstatusthumbnailW)) + else if (xml_attr_cmp(&attr, L"miscStatusThumbnail")) { entity->u.comclass.miscstatusthumbnail = parse_com_class_misc(&attr.value); } - else if (xml_attr_cmp(&attr, miscstatusiconW)) + else if (xml_attr_cmp(&attr, L"miscStatusIcon")) { entity->u.comclass.miscstatusicon = parse_com_class_misc(&attr.value); } - else if (xml_attr_cmp(&attr, miscstatusdocprintW)) + else if (xml_attr_cmp(&attr, L"miscStatusDocPrint")) { entity->u.comclass.miscstatusdocprint = parse_com_class_misc(&attr.value); } - else if (xml_attr_cmp(&attr, descriptionW)) + else if (xml_attr_cmp(&attr, L"description")) { /* not stored */ } @@ -1740,7 +1618,7 @@ static void parse_com_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll, st
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, progidW, asmv1W)) + if (xml_elem_cmp(&elem, L"progid", asmv1W)) { parse_com_class_progid(xmlbuf, entity, &elem); } @@ -1818,34 +1696,34 @@ static void parse_cominterface_proxy_stub_elem( xmlbuf_t *xmlbuf, struct dll_red
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, iidW)) + if (xml_attr_cmp(&attr, L"iid")) { if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, nameW)) + else if (xml_attr_cmp(&attr, L"name")) { if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, baseInterfaceW)) + else if (xml_attr_cmp(&attr, L"baseInterface")) { if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf ); entity->u.ifaceps.mask |= BaseIface; } - else if (xml_attr_cmp(&attr, nummethodsW)) + else if (xml_attr_cmp(&attr, L"numMethods")) { if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf ); entity->u.ifaceps.mask |= NumMethods; } - else if (xml_attr_cmp(&attr, tlbidW)) + else if (xml_attr_cmp(&attr, L"tlbid")) { if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, proxyStubClsid32W)) + else if (xml_attr_cmp(&attr, L"proxyStubClsid32")) { if (!(psclsid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } /* not used */ - else if (xml_attr_cmp(&attr, threadingmodelW)) + else if (xml_attr_cmp(&attr, L"threadingModel")) { } else if (!is_xmlns_attr( &attr )) @@ -1876,13 +1754,13 @@ static BOOL parse_typelib_flags(const xmlstr_t *value, struct entity *entity) start = str; while (*str != ',' && (i++ < value->len)) str++;
- if (!wcsnicmp(start, restrictedW, str-start)) + if (!wcsnicmp(start, L"RESTRICTED", str-start)) *flags |= LIBFLAG_FRESTRICTED; - else if (!wcsnicmp(start, controlW, str-start)) + else if (!wcsnicmp(start, L"CONTROL", str-start)) *flags |= LIBFLAG_FCONTROL; - else if (!wcsnicmp(start, hiddenW, str-start)) + else if (!wcsnicmp(start, L"HIDDEN", str-start)) *flags |= LIBFLAG_FHIDDEN; - else if (!wcsnicmp(start, hasdiskimageW, str-start)) + else if (!wcsnicmp(start, L"HASDISKIMAGE", str-start)) *flags |= LIBFLAG_FHASDISKIMAGE; else { @@ -1943,19 +1821,19 @@ static void parse_typelib_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll,
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, tlbidW)) + if (xml_attr_cmp(&attr, L"tlbid")) { if (!(entity->u.typelib.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, versionW)) + else if (xml_attr_cmp(&attr, L"version")) { if (!parse_typelib_version(&attr.value, entity)) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, helpdirW)) + else if (xml_attr_cmp(&attr, L"helpdir")) { if (!(entity->u.typelib.helpdir = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, flagsW)) + else if (xml_attr_cmp(&attr, L"flags")) { if (!parse_typelib_flags(&attr.value, entity)) set_error( xmlbuf ); } @@ -1976,12 +1854,11 @@ static inline int aligned_string_len(int len)
static int get_assembly_version(struct assembly *assembly, WCHAR *ret) { - static const WCHAR fmtW[] = {'%','u','.','%','u','.','%','u','.','%','u',0}; struct assembly_version *ver = &assembly->id.version; WCHAR buff[25];
if (!ret) ret = buff; - return swprintf(ret, ARRAY_SIZE(buff), fmtW, ver->major, ver->minor, ver->build, ver->revision); + return swprintf(ret, ARRAY_SIZE(buff), L"%u.%u.%u.%u", ver->major, ver->minor, ver->build, ver->revision); }
static void parse_window_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll, @@ -2001,11 +1878,11 @@ static void parse_window_class_elem( xmlbuf_t *xmlbuf, struct dll_redirect *dll, entity->u.class.versioned = TRUE; while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, versionedW)) + if (xml_attr_cmp(&attr, L"versioned")) { - if (xmlstr_cmpi(&attr.value, noW)) + if (xmlstr_cmpi(&attr.value, L"no")) entity->u.class.versioned = FALSE; - else if (!xmlstr_cmpi(&attr.value, yesW)) + else if (!xmlstr_cmpi(&attr.value, L"yes")) set_error( xmlbuf ); } else if (!is_xmlns_attr( &attr )) @@ -2035,11 +1912,11 @@ static void parse_binding_redirect_elem( xmlbuf_t *xmlbuf, const struct xml_elem
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, oldVersionW)) + if (xml_attr_cmp(&attr, L"oldVersion")) { FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr)); } - else if (xml_attr_cmp(&attr, newVersionW)) + else if (xml_attr_cmp(&attr, L"newVersion")) { FIXME("Not stored yet %s\n", debugstr_xml_attr(&attr)); } @@ -2093,29 +1970,29 @@ static void parse_com_interface_external_proxy_stub_elem(xmlbuf_t *xmlbuf,
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, iidW)) + if (xml_attr_cmp(&attr, L"iid")) { if (!(entity->u.ifaceps.iid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, nameW)) + else if (xml_attr_cmp(&attr, L"name")) { if (!(entity->u.ifaceps.name = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, baseInterfaceW)) + else if (xml_attr_cmp(&attr, L"baseInterface")) { if (!(entity->u.ifaceps.base = xmlstrdupW(&attr.value))) set_error( xmlbuf ); entity->u.ifaceps.mask |= BaseIface; } - else if (xml_attr_cmp(&attr, nummethodsW)) + else if (xml_attr_cmp(&attr, L"numMethods")) { if (!(parse_nummethods(&attr.value, entity))) set_error( xmlbuf ); entity->u.ifaceps.mask |= NumMethods; } - else if (xml_attr_cmp(&attr, proxyStubClsid32W)) + else if (xml_attr_cmp(&attr, L"proxyStubClsid32")) { if (!(entity->u.ifaceps.ps32 = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, tlbidW)) + else if (xml_attr_cmp(&attr, L"tlbid")) { if (!(entity->u.ifaceps.tlib = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } @@ -2146,27 +2023,27 @@ static void parse_clr_class_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, nameW)) + if (xml_attr_cmp(&attr, L"name")) { if (!(entity->u.comclass.name = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, clsidW)) + else if (xml_attr_cmp(&attr, L"clsid")) { if (!(entity->u.comclass.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, progidW)) + else if (xml_attr_cmp(&attr, L"progid")) { if (!(entity->u.comclass.progid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, tlbidW)) + else if (xml_attr_cmp(&attr, L"tlbid")) { if (!(entity->u.comclass.tlbid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, threadingmodelW)) + else if (xml_attr_cmp(&attr, L"threadingModel")) { entity->u.comclass.model = parse_com_class_threadingmodel(&attr.value); } - else if (xml_attr_cmp(&attr, runtimeVersionW)) + else if (xml_attr_cmp(&attr, L"runtimeVersion")) { if (!(entity->u.comclass.version = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } @@ -2183,7 +2060,7 @@ static void parse_clr_class_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, progidW, asmv1W)) + if (xml_elem_cmp(&elem, L"progid", asmv1W)) { parse_com_class_progid(xmlbuf, entity, &elem); } @@ -2213,15 +2090,15 @@ static void parse_clr_surrogate_elem( xmlbuf_t *xmlbuf, struct assembly *assembl
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, nameW)) + if (xml_attr_cmp(&attr, L"name")) { if (!(entity->u.clrsurrogate.name = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, clsidW)) + else if (xml_attr_cmp(&attr, L"clsid")) { if (!(entity->u.clrsurrogate.clsid = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, runtimeVersionW)) + else if (xml_attr_cmp(&attr, L"runtimeVersion")) { if (!(entity->u.clrsurrogate.version = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } @@ -2248,11 +2125,8 @@ static void parse_dependent_assembly_elem( xmlbuf_t *xmlbuf, struct actctx_loade
while (next_xml_attr(xmlbuf, &attr, &end)) { - static const WCHAR allowDelayedBindingW[] = {'a','l','l','o','w','D','e','l','a','y','e','d','B','i','n','d','i','n','g',0}; - static const WCHAR trueW[] = {'t','r','u','e',0}; - - if (xml_attr_cmp(&attr, allowDelayedBindingW)) - ai.delayed = xmlstr_cmp(&attr.value, trueW); + if (xml_attr_cmp(&attr, L"allowDelayedBinding")) + ai.delayed = xmlstr_cmp(&attr.value, L"true"); else if (!is_xmlns_attr( &attr )) WARN("unknown attr %s\n", debugstr_xml_attr(&attr)); } @@ -2261,11 +2135,11 @@ static void parse_dependent_assembly_elem( xmlbuf_t *xmlbuf, struct actctx_loade
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, assemblyIdentityW, asmv1W)) + if (xml_elem_cmp(&elem, L"assemblyIdentity", asmv1W)) { parse_assembly_identity_elem(xmlbuf, acl->actctx, &ai, &elem); /* store the newly found identity for later loading */ - if (ai.arch && !wcscmp(ai.arch, wildcardW)) + if (ai.arch && !wcscmp(ai.arch, L"*")) { RtlFreeHeap( GetProcessHeap(), 0, ai.arch ); ai.arch = strdupW( current_archW ); @@ -2274,7 +2148,7 @@ static void parse_dependent_assembly_elem( xmlbuf_t *xmlbuf, struct actctx_loade debugstr_w(ai.name), debugstr_version(&ai.version), debugstr_w(ai.arch) ); if (!add_dependent_assembly_id(acl, &ai)) set_error( xmlbuf ); } - else if (xml_elem_cmp(&elem, bindingRedirectW, asmv1W)) + else if (xml_elem_cmp(&elem, L"bindingRedirect", asmv1W)) { parse_binding_redirect_elem(xmlbuf, &elem); } @@ -2296,9 +2170,9 @@ static void parse_dependency_elem( xmlbuf_t *xmlbuf, struct actctx_loader *acl,
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, optionalW)) + if (xml_attr_cmp(&attr, L"optional")) { - optional = xmlstr_cmpi( &attr.value, yesW ); + optional = xmlstr_cmpi( &attr.value, L"yes" ); TRACE("optional=%s\n", debugstr_xmlstr(&attr.value)); } else if (!is_xmlns_attr( &attr )) @@ -2311,7 +2185,7 @@ static void parse_dependency_elem( xmlbuf_t *xmlbuf, struct actctx_loader *acl,
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, dependentAssemblyW, asmv1W)) + if (xml_elem_cmp(&elem, L"dependentAssembly", asmv1W)) { parse_dependent_assembly_elem(xmlbuf, acl, &elem, optional); } @@ -2355,19 +2229,18 @@ static void parse_file_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, nameW)) + if (xml_attr_cmp(&attr, L"name")) { if (!(dll->name = xmlstrdupW(&attr.value))) set_error( xmlbuf ); TRACE("name=%s\n", debugstr_xmlstr(&attr.value)); } - else if (xml_attr_cmp(&attr, hashW)) + else if (xml_attr_cmp(&attr, L"hash")) { if (!(dll->hash = xmlstrdupW(&attr.value))) set_error( xmlbuf ); } - else if (xml_attr_cmp(&attr, hashalgW)) + else if (xml_attr_cmp(&attr, L"hashalg")) { - static const WCHAR sha1W[] = {'S','H','A','1',0}; - if (!xmlstr_cmpi(&attr.value, sha1W)) + if (!xmlstr_cmpi(&attr.value, L"SHA1")) FIXME("hashalg should be SHA1, got %s\n", debugstr_xmlstr(&attr.value)); } else if (!is_xmlns_attr( &attr )) @@ -2384,24 +2257,24 @@ static void parse_file_elem( xmlbuf_t* xmlbuf, struct assembly* assembly,
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, comClassW, asmv1W)) + if (xml_elem_cmp(&elem, L"comClass", asmv1W)) { parse_com_class_elem(xmlbuf, dll, acl, &elem); } - else if (xml_elem_cmp(&elem, comInterfaceProxyStubW, asmv1W)) + else if (xml_elem_cmp(&elem, L"comInterfaceProxyStub", asmv1W)) { parse_cominterface_proxy_stub_elem(xmlbuf, dll, acl, &elem); } - else if (xml_elem_cmp(&elem, hashW, asmv2W)) + else if (xml_elem_cmp(&elem, L"hash", asmv2W)) { WARN("asmv2:hash (undocumented) not supported\n"); parse_unknown_elem(xmlbuf, &elem); } - else if (xml_elem_cmp(&elem, typelibW, asmv1W)) + else if (xml_elem_cmp(&elem, L"typelib", asmv1W)) { parse_typelib_elem(xmlbuf, dll, acl, &elem); } - else if (xml_elem_cmp(&elem, windowClassW, asmv1W)) + else if (xml_elem_cmp(&elem, L"windowClass", asmv1W)) { parse_window_class_elem(xmlbuf, dll, acl, &elem); } @@ -2421,7 +2294,7 @@ static void parse_supportedos_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, IdW)) + if (xml_attr_cmp(&attr, L"Id")) { COMPATIBILITY_CONTEXT_ELEMENT *compat; UNICODE_STRING str; @@ -2460,7 +2333,7 @@ static void parse_compatibility_application_elem(xmlbuf_t *xmlbuf, struct assemb
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, supportedOSW, compatibilityNSW)) + if (xml_elem_cmp(&elem, L"supportedOS", compatibilityNSW)) { parse_supportedos_elem(xmlbuf, assembly, acl, &elem); } @@ -2479,7 +2352,7 @@ static void parse_compatibility_elem(xmlbuf_t *xmlbuf, struct assembly *assembly
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, applicationW, compatibilityNSW)) + if (xml_elem_cmp(&elem, L"application", compatibilityNSW)) { parse_compatibility_application_elem(xmlbuf, assembly, acl, &elem); } @@ -2534,17 +2407,17 @@ static void parse_windows_settings_elem( xmlbuf_t *xmlbuf, struct assembly *asse
while (next_xml_elem( xmlbuf, &elem, parent )) { - if (xml_elem_cmp( &elem, autoElevateW, windowsSettings2005NSW ) || - xml_elem_cmp( &elem, disableThemingW, windowsSettings2005NSW ) || - xml_elem_cmp( &elem, disableWindowFilteringW, windowsSettings2011NSW ) || - xml_elem_cmp( &elem, dpiAwareW, windowsSettings2005NSW ) || - xml_elem_cmp( &elem, dpiAwarenessW, windowsSettings2016NSW ) || - xml_elem_cmp( &elem, gdiScalingW, windowsSettings2017NSW ) || - xml_elem_cmp( &elem, highResolutionScrollingAwareW, windowsSettings2017NSW ) || - xml_elem_cmp( &elem, longPathAwareW, windowsSettings2016NSW ) || - xml_elem_cmp( &elem, magicFutureSettingW, windowsSettings2017NSW ) || - xml_elem_cmp( &elem, printerDriverIsolationW, windowsSettings2011NSW ) || - xml_elem_cmp( &elem, ultraHighResolutionScrollingAwareW, windowsSettings2017NSW )) + if (xml_elem_cmp( &elem, L"autoElevate", windowsSettings2005NSW ) || + xml_elem_cmp( &elem, L"disableTheming", windowsSettings2005NSW ) || + xml_elem_cmp( &elem, L"disableWindowFiltering", windowsSettings2011NSW ) || + xml_elem_cmp( &elem, L"dpiAware", windowsSettings2005NSW ) || + xml_elem_cmp( &elem, L"dpiAwareness", windowsSettings2016NSW ) || + xml_elem_cmp( &elem, L"gdiScaling", windowsSettings2017NSW ) || + xml_elem_cmp( &elem, L"highResolutionScrollingAware", windowsSettings2017NSW ) || + xml_elem_cmp( &elem, L"longPathAware", windowsSettings2016NSW ) || + xml_elem_cmp( &elem, L"magicFutureSetting", windowsSettings2017NSW ) || + xml_elem_cmp( &elem, L"printerDriverIsolation", windowsSettings2011NSW ) || + xml_elem_cmp( &elem, L"ultraHighResolutionScrollingAware", windowsSettings2017NSW )) { parse_settings_elem( xmlbuf, assembly, acl, &elem ); } @@ -2563,7 +2436,7 @@ static void parse_application_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_elem( xmlbuf, &elem, parent )) { - if (xml_elem_cmp( &elem, windowsSettingsW, asmv3W )) + if (xml_elem_cmp( &elem, L"windowsSettings", asmv3W )) { parse_windows_settings_elem( xmlbuf, assembly, acl, &elem ); } @@ -2578,14 +2451,6 @@ static void parse_application_elem( xmlbuf_t *xmlbuf, struct assembly *assembly, static void parse_requested_execution_level_elem( xmlbuf_t *xmlbuf, struct assembly *assembly, struct actctx_loader *acl, const struct xml_elem *parent ) { - static const WCHAR levelW[] = {'l','e','v','e','l',0}; - static const WCHAR asInvokerW[] = {'a','s','I','n','v','o','k','e','r',0}; - static const WCHAR requireAdministratorW[] = {'r','e','q','u','i','r','e','A','d','m','i','n','i','s','t','r','a','t','o','r',0}; - static const WCHAR highestAvailableW[] = {'h','i','g','h','e','s','t','A','v','a','i','l','a','b','l','e',0}; - static const WCHAR uiAccessW[] = {'u','i','A','c','c','e','s','s',0}; - static const WCHAR falseW[] = {'f','a','l','s','e',0}; - static const WCHAR trueW[] = {'t','r','u','e',0}; - struct xml_elem elem; struct xml_attr attr; BOOL end = FALSE; @@ -2595,22 +2460,22 @@ static void parse_requested_execution_level_elem( xmlbuf_t *xmlbuf, struct assem
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, levelW)) + if (xml_attr_cmp(&attr, L"level")) { - if (xmlstr_cmpi(&attr.value, asInvokerW)) + if (xmlstr_cmpi(&attr.value, L"asInvoker")) assembly->run_level = ACTCTX_RUN_LEVEL_AS_INVOKER; - else if (xmlstr_cmpi(&attr.value, highestAvailableW)) + else if (xmlstr_cmpi(&attr.value, L"highestAvailable")) assembly->run_level = ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE; - else if (xmlstr_cmpi(&attr.value, requireAdministratorW)) + else if (xmlstr_cmpi(&attr.value, L"requireAdministrator")) assembly->run_level = ACTCTX_RUN_LEVEL_REQUIRE_ADMIN; else FIXME("unknown execution level: %s\n", debugstr_xmlstr(&attr.value)); } - else if (xml_attr_cmp(&attr, uiAccessW)) + else if (xml_attr_cmp(&attr, L"uiAccess")) { - if (xmlstr_cmpi(&attr.value, falseW)) + if (xmlstr_cmpi(&attr.value, L"false")) assembly->ui_access = FALSE; - else if (xmlstr_cmpi(&attr.value, trueW)) + else if (xmlstr_cmpi(&attr.value, L"true")) assembly->ui_access = TRUE; else FIXME("unknown uiAccess value: %s\n", debugstr_xmlstr(&attr.value)); @@ -2635,7 +2500,7 @@ static void parse_requested_privileges_elem( xmlbuf_t *xmlbuf, struct assembly *
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, requestedExecutionLevelW, asmv1W)) + if (xml_elem_cmp(&elem, L"requestedExecutionLevel", asmv1W)) { parse_requested_execution_level_elem(xmlbuf, assembly, acl, &elem); } @@ -2654,7 +2519,7 @@ static void parse_security_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, requestedPrivilegesW, asmv1W)) + if (xml_elem_cmp(&elem, L"requestedPrivileges", asmv1W)) { parse_requested_privileges_elem(xmlbuf, assembly, acl, &elem); } @@ -2673,7 +2538,7 @@ static void parse_trust_info_elem( xmlbuf_t *xmlbuf, struct assembly *assembly,
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (xml_elem_cmp(&elem, securityW, asmv1W)) + if (xml_elem_cmp(&elem, L"security", asmv1W)) { parse_security_elem(xmlbuf, assembly, acl, &elem); } @@ -2697,10 +2562,9 @@ static void parse_assembly_elem( xmlbuf_t *xmlbuf, struct assembly* assembly,
while (next_xml_attr(xmlbuf, &attr, &end)) { - if (xml_attr_cmp(&attr, manifestVersionW)) + if (xml_attr_cmp(&attr, L"manifestVersion")) { - static const WCHAR v10W[] = {'1','.','0',0}; - if (!xmlstr_cmp(&attr.value, v10W)) + if (!xmlstr_cmp(&attr.value, L"1.0")) { FIXME("wrong version %s\n", debugstr_xmlstr(&attr.value)); break; @@ -2721,44 +2585,44 @@ static void parse_assembly_elem( xmlbuf_t *xmlbuf, struct assembly* assembly,
while (next_xml_elem(xmlbuf, &elem, parent)) { - if (assembly->type == APPLICATION_MANIFEST && xml_elem_cmp(&elem, noInheritW, asmv1W)) + if (assembly->type == APPLICATION_MANIFEST && xml_elem_cmp(&elem, L"noInherit", asmv1W)) { parse_noinherit_elem(xmlbuf, &elem); assembly->no_inherit = TRUE; } - else if (xml_elem_cmp(&elem, noInheritableW, asmv1W)) + else if (xml_elem_cmp(&elem, L"noInheritable", asmv1W)) { parse_noinheritable_elem(xmlbuf, &elem); } - else if (xml_elem_cmp(&elem, descriptionW, asmv1W)) + else if (xml_elem_cmp(&elem, L"description", asmv1W)) { parse_description_elem(xmlbuf, &elem); } - else if (xml_elem_cmp(&elem, comInterfaceExternalProxyStubW, asmv1W)) + else if (xml_elem_cmp(&elem, L"comInterfaceExternalProxyStub", asmv1W)) { parse_com_interface_external_proxy_stub_elem(xmlbuf, assembly, acl, &elem); } - else if (xml_elem_cmp(&elem, dependencyW, asmv1W)) + else if (xml_elem_cmp(&elem, L"dependency", asmv1W)) { parse_dependency_elem(xmlbuf, acl, &elem); } - else if (xml_elem_cmp(&elem, fileW, asmv1W)) + else if (xml_elem_cmp(&elem, L"file", asmv1W)) { parse_file_elem(xmlbuf, assembly, acl, &elem); } - else if (xml_elem_cmp(&elem, clrClassW, asmv1W)) + else if (xml_elem_cmp(&elem, L"clrClass", asmv1W)) { parse_clr_class_elem(xmlbuf, assembly, acl, &elem); } - else if (xml_elem_cmp(&elem, clrSurrogateW, asmv1W)) + else if (xml_elem_cmp(&elem, L"clrSurrogate", asmv1W)) { parse_clr_surrogate_elem(xmlbuf, assembly, acl, &elem); } - else if (xml_elem_cmp(&elem, trustInfoW, asmv1W)) + else if (xml_elem_cmp(&elem, L"trustInfo", asmv1W)) { parse_trust_info_elem(xmlbuf, assembly, acl, &elem); } - else if (xml_elem_cmp(&elem, assemblyIdentityW, asmv1W)) + else if (xml_elem_cmp(&elem, L"assemblyIdentity", asmv1W)) { parse_assembly_identity_elem(xmlbuf, acl->actctx, &assembly->id, &elem);
@@ -2787,11 +2651,11 @@ static void parse_assembly_elem( xmlbuf_t *xmlbuf, struct assembly* assembly, } } } - else if (xml_elem_cmp(&elem, compatibilityW, compatibilityNSW)) + else if (xml_elem_cmp(&elem, L"compatibility", compatibilityNSW)) { parse_compatibility_elem(xmlbuf, assembly, acl, &elem); } - else if (xml_elem_cmp(&elem, applicationW, asmv3W)) + else if (xml_elem_cmp(&elem, L"application", asmv3W)) { parse_application_elem(xmlbuf, assembly, acl, &elem); } @@ -2820,11 +2684,11 @@ static NTSTATUS parse_manifest_buffer( struct actctx_loader* acl, struct assembl
if (!next_xml_elem(xmlbuf, &elem, &parent)) return STATUS_SXS_CANT_GEN_ACTCTX;
- if (xmlstr_cmp(&elem.name, xmlW) && + if (xmlstr_cmp(&elem.name, L"?xml") && (!parse_xml_header(xmlbuf) || !next_xml_elem(xmlbuf, &elem, &parent))) return STATUS_SXS_CANT_GEN_ACTCTX;
- if (!xml_elem_cmp(&elem, assemblyW, asmv1W)) + if (!xml_elem_cmp(&elem, L"assembly", asmv1W)) { FIXME("root element is %s, not <assembly>\n", debugstr_xml_elem(&elem)); return STATUS_SXS_CANT_GEN_ACTCTX; @@ -3080,7 +2944,6 @@ static NTSTATUS get_manifest_in_manifest_file( struct actctx_loader* acl, struct static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl, struct assembly_identity* ai, LPCWSTR filename, LPCWSTR directory, HMODULE module, LPCWSTR resname ) { - static const WCHAR fmtW[] = { '.','%','l','u',0 }; WCHAR *buffer; NTSTATUS status; UNICODE_STRING nameW; @@ -3095,10 +2958,10 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl, { UNICODE_STRING name;
- if (!(status = get_module_filename( module, &name, sizeof(dotManifestW) + 10*sizeof(WCHAR) ))) + if (!(status = get_module_filename( module, &name, sizeof(L".manifest") + 10*sizeof(WCHAR) ))) { - if (resid != 1) swprintf( name.Buffer + wcslen(name.Buffer), 10, fmtW, resid ); - wcscat( name.Buffer, dotManifestW ); + if (resid != 1) swprintf( name.Buffer + wcslen(name.Buffer), 10, L".%lu", resid ); + wcscat( name.Buffer, L".manifest" ); if (!RtlDosPathNameToNtPathName_U( name.Buffer, &nameW, NULL, NULL )) status = STATUS_RESOURCE_DATA_NOT_FOUND; RtlFreeUnicodeString( &name ); @@ -3108,11 +2971,11 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl, else { if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, - (wcslen(filename) + 10) * sizeof(WCHAR) + sizeof(dotManifestW) ))) + (wcslen(filename) + 10) * sizeof(WCHAR) + sizeof(L".manifest") ))) return STATUS_NO_MEMORY; wcscpy( buffer, filename ); - if (resid != 1) swprintf( buffer + wcslen(buffer), 10, fmtW, resid ); - wcscat( buffer, dotManifestW ); + if (resid != 1) swprintf( buffer + wcslen(buffer), 10, L".%lu", resid ); + wcscat( buffer, L".manifest" ); RtlInitUnicodeString( &nameW, buffer ); }
@@ -3128,9 +2991,7 @@ static NTSTATUS get_manifest_in_associated_manifest( struct actctx_loader* acl,
static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai ) { - static const WCHAR lookup_fmtW[] = - {'%','s','_','%','s','_','%','s','_','%','u','.','%','u','.','*','.','*','_', - '%','s','_','*','.','m','a','n','i','f','e','s','t',0}; + static const WCHAR lookup_fmtW[] = L"%s_%s_%s_%u.%u.*.*_%s_*.manifest"; static const WCHAR wine_trailerW[] = {'d','e','a','d','b','e','e','f','.','m','a','n','i','f','e','s','t'};
WCHAR *lookup, *ret = NULL; @@ -3140,7 +3001,7 @@ static WCHAR *lookup_manifest_file( HANDLE dir, struct assembly_identity *ai ) unsigned int data_pos = 0, data_len, len; char buffer[8192];
- if (!lang || !wcsicmp( lang, neutralW )) lang = wildcardW; + if (!lang || !wcsicmp( lang, L"neutral" )) lang = L"*";
len = wcslen(ai->arch) + wcslen(ai->name) + wcslen(ai->public_key) + wcslen(lang) + 20 + ARRAY_SIZE(lookup_fmtW); if (!(lookup = RtlAllocateHeap( GetProcessHeap(), 0, len * sizeof(WCHAR) ))) return NULL; @@ -3217,17 +3078,14 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit WCHAR *path, *file = NULL; HANDLE handle;
- static const WCHAR manifest_dirW[] = - {'\','w','i','n','s','x','s','\','m','a','n','i','f','e','s','t','s',0}; - if (!ai->arch || !ai->name || !ai->public_key) return STATUS_NO_SUCH_FILE;
- if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(manifest_dirW) + + if (!(path = RtlAllocateHeap( GetProcessHeap(), 0, sizeof(L"\winsxs\manifests") + wcslen(windows_dir) * sizeof(WCHAR) ))) return STATUS_NO_MEMORY;
wcscpy( path, windows_dir ); - wcscat( path, manifest_dirW ); + wcscat( path, L"\winsxs\manifests" );
if (!RtlDosPathNameToNtPathName_U( path, &path_us, NULL, NULL )) { @@ -3285,7 +3143,6 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit static NTSTATUS lookup_assembly(struct actctx_loader* acl, struct assembly_identity* ai) { - static const WCHAR dotDllW[] = {'.','d','l','l',0}; unsigned int i; WCHAR *buffer, *p, *directory; NTSTATUS status; @@ -3305,7 +3162,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
nameW.Buffer = NULL; if (!(buffer = RtlAllocateHeap( GetProcessHeap(), 0, - (len + 2 * wcslen(ai->name) + 2) * sizeof(WCHAR) + sizeof(dotManifestW) ))) + (len + 2 * wcslen(ai->name) + 2) * sizeof(WCHAR) + sizeof(L".manifest") ))) return STATUS_NO_MEMORY;
if (!(directory = build_assembly_dir( ai ))) @@ -3336,7 +3193,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, wcscpy( p, ai->name ); p += wcslen(p);
- wcscpy( p, dotDllW ); + wcscpy( p, L".dll" ); if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL )) { status = open_nt_file( &file, &nameW ); @@ -3351,7 +3208,7 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl, RtlFreeUnicodeString( &nameW ); }
- wcscpy( p, dotManifestW ); + wcscpy( p, L".manifest" ); if (RtlDosPathNameToNtPathName_U( buffer, &nameW, NULL, NULL )) { status = open_nt_file( &file, &nameW ); @@ -3684,7 +3541,6 @@ static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT* actctx, struct strsec struct entity *entity = &dll->entities.base[k]; if (entity->kind == ACTIVATION_CONTEXT_SECTION_WINDOW_CLASS_REDIRECTION) { - static const WCHAR exclW[] = {'!',0}; ULONG versioned_len, module_len; UNICODE_STRING str; WCHAR *ptrW; @@ -3733,7 +3589,7 @@ static NTSTATUS build_wndclass_section(ACTIVATION_CONTEXT* actctx, struct strsec if (entity->u.class.versioned) { get_assembly_version(assembly, ptrW); - wcscat(ptrW, exclW); + wcscat(ptrW, L"!"); wcscat(ptrW, entity->u.class.name); } else @@ -4037,7 +3893,7 @@ static void get_comserver_datalen(const struct entity_array *entities, const str *len += aligned_string_len(str_len*sizeof(WCHAR));
/* module name is forced to mscoree.dll, and stored two times with different case */ - *module_len += sizeof(mscoreeW) + sizeof(mscoree2W); + *module_len += sizeof(L"MSCOREE.DLL") + sizeof(L"mscoree.dll"); } else { @@ -4076,7 +3932,7 @@ static void add_comserver_record(const struct guidsection_header *section, const else progid_len = 0;
- module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : wcslen(mscoreeW)*sizeof(WCHAR); + module_len = dll ? wcslen(dll->name)*sizeof(WCHAR) : wcslen(L"MSCOREE.DLL")*sizeof(WCHAR);
/* setup new index entry */ RtlInitUnicodeString(&str, entity->u.comclass.clsid); @@ -4142,7 +3998,7 @@ static void add_comserver_record(const struct guidsection_header *section, const clrdata->size = sizeof(*clrdata); clrdata->res[0] = 0; clrdata->res[1] = 2; /* FIXME: unknown field */ - clrdata->module_len = wcslen(mscoreeW)*sizeof(WCHAR); + clrdata->module_len = wcslen(L"MSCOREE.DLL")*sizeof(WCHAR); clrdata->module_offset = *module_offset + data->name_len + sizeof(WCHAR); clrdata->name_len = wcslen(entity->u.comclass.name)*sizeof(WCHAR); clrdata->name_offset = clrdata->size; @@ -4155,11 +4011,11 @@ static void add_comserver_record(const struct guidsection_header *section, const
/* module name */ ptrW = (WCHAR*)((BYTE*)section + clrdata->module_offset); - memcpy(ptrW, mscoree2W, clrdata->module_len); + memcpy(ptrW, L"mscoree.dll", clrdata->module_len); ptrW[clrdata->module_len/sizeof(WCHAR)] = 0;
ptrW = (WCHAR*)((BYTE*)section + data->name_offset); - memcpy(ptrW, mscoreeW, data->name_len); + memcpy(ptrW, L"MSCOREE.DLL", data->name_len); ptrW[data->name_len/sizeof(WCHAR)] = 0;
/* class name */