Sync to Wine-0_9_2: Francois Gouget fgouget@free.fr - Remove spaces before '\n' in traces. - Assorted spelling and case fixes. Steven Edwards winehacker@gmail.com - Partly implement MsiMessageBox[A/W] on top of MessageBoxEx[A/W] YunSong Hwang hys545@dreamwiz.com - Add Korean translations. - Update Korean translations. Aric Stewart aric@codeweavers.com - Use MsiDecomposeDescriptorW in MsiProvideQualifiedComponentExW. Mike McCormack mike@codeweavers.com - Fix comparison of empty properties to numbers and add test cases. - Only return ERROR_MORE_DATA if there's a buffer to copy a result into. - Fix function prototype and spec file entry for MsiEnumComponentQualifiers. - Set the Installed property if the product is already installed. - Loop around calling RegQueryValue until we have a big enough string for both the name and the value. - Convert MsiEnumComponentQualifiers to use msi_strcpy_to_awstring. - Empty strings are not equal to any number, so all comparisons against them fail except for tests for non-equalness. Modified: trunk/reactos/lib/msi/helpers.c Modified: trunk/reactos/lib/msi/msi_Ko.rc Modified: trunk/reactos/lib/msi/registry.c _____
Modified: trunk/reactos/lib/msi/helpers.c --- trunk/reactos/lib/msi/helpers.c 2005-11-25 23:10:34 UTC (rev 19588) +++ trunk/reactos/lib/msi/helpers.c 2005-11-25 23:12:29 UTC (rev 19589) @@ -221,40 +221,42 @@
if (!name) return NULL;
- /* special resolving for Target and Source root dir */ - if (strcmpW(name,cszTargetDir)==0 || strcmpW(name,cszSourceDir)==0) + /* source directories appear to always be at the root */ + if (source) { - if (!source) + path = msi_dup_property( package, cszSourceDir ); + if (!path) { - LPWSTR check_path; - check_path = msi_dup_property( package, cszTargetDir ); - if (!check_path) + path = msi_dup_property( package, cszDatabase ); + if (path) { - check_path = msi_dup_property( package, cszRootDrive ); - if (set_prop) - MSI_SetPropertyW(package,cszTargetDir,check_path); + p = strrchrW(path,'\'); + if (p) + *(p+1) = 0; } - - /* correct misbuilt target dir */ - path = build_directory_name(2, check_path, NULL); - if (strcmpiW(path,check_path)!=0) - MSI_SetPropertyW(package,cszTargetDir,path); - msi_free(check_path); } - else + if (folder) + *folder = get_loaded_folder( package, name ); + return path; + } + + /* special resolving for Target and Source root dir */ + if (strcmpW(name,cszTargetDir)==0 || strcmpW(name,cszSourceDir)==0) + { + LPWSTR check_path; + check_path = msi_dup_property( package, cszTargetDir ); + if (!check_path) { - path = msi_dup_property( package, cszSourceDir ); - if (!path) - { - path = msi_dup_property( package, cszDatabase ); - if (path) - { - p = strrchrW(path,'\'); - if (p) - *(p+1) = 0; - } - } + check_path = msi_dup_property( package, cszRootDrive ); + if (set_prop) + MSI_SetPropertyW(package,cszTargetDir,check_path); } + + /* correct misbuilt target dir */ + path = build_directory_name(2, check_path, NULL); + if (strcmpiW(path,check_path)!=0) + MSI_SetPropertyW(package,cszTargetDir,path); + msi_free(check_path); if (folder) *folder = get_loaded_folder( package, name ); return path; @@ -267,20 +269,14 @@ if (folder) *folder = f;
- if (!source && f->ResolvedTarget) + if (f->ResolvedTarget) { path = strdupW( f->ResolvedTarget ); TRACE(" already resolved to %s\n",debugstr_w(path)); return path; } - else if (source && f->ResolvedSource) + else if (f->Property) { - path = strdupW( f->ResolvedSource ); - TRACE(" (source)already resolved to %s\n",debugstr_w(path)); - return path; - } - else if (!source && f->Property) - { path = build_directory_name( 2, f->Property, NULL );
TRACE(" internally set to %s\n",debugstr_w(path)); @@ -296,25 +292,13 @@ TRACE(" ! Parent is %s\n", debugstr_w(parent));
p = resolve_folder(package, parent, source, set_prop, NULL); - if (!source) - { - TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault)); + TRACE(" TargetDefault = %s\n", debugstr_w(f->TargetDefault));
- path = build_directory_name( 3, p, f->TargetDefault, NULL ); - f->ResolvedTarget = strdupW( path ); - TRACE(" resolved into %s\n",debugstr_w(path)); - if (set_prop) - MSI_SetPropertyW(package,name,path); - } - else - { - if (f->SourceDefault && f->SourceDefault[0]!='.') - path = build_directory_name( 3, p, f->SourceDefault, NULL ); - else - path = strdupW(p); - TRACE(" (source)resolved into %s\n",debugstr_w(path)); - f->ResolvedSource = strdupW( path ); - } + path = build_directory_name( 3, p, f->TargetDefault, NULL ); + f->ResolvedTarget = strdupW( path ); + TRACE(" resolved into %s\n",debugstr_w(path)); + if (set_prop) + MSI_SetPropertyW(package,name,path); msi_free(p); } return path; _____
Modified: trunk/reactos/lib/msi/msi_Ko.rc --- trunk/reactos/lib/msi/msi_Ko.rc 2005-11-25 23:10:34 UTC (rev 19588) +++ trunk/reactos/lib/msi/msi_Ko.rc 2005-11-25 23:12:29 UTC (rev 19589) @@ -22,12 +22,12 @@
STRINGTABLE DISCARDABLE { - 5 "path %s not found" + 5 "%s ?µÀ?©ª ?ú???÷ ¥°¢??¤??" 9 "Á¢??® %s ??È" 10 "?²©°Á? ©????»?÷" - 11 "enter which folder contains %s" - 12 "install source for feature missing" - 13 "network drive for feature missing" - 14 "feature from:" - 15 "choose which folder contains %s" + 11 "%s©ª ã¸ÃÈä?? ã·?§©ª ?ÈÀ?ä???®" + 12 "?³?° ???ð(feature)?? ?ºÃÐ ???í ?°??" + 13 "?³?° ???ð(feature)?? ?ºÃÐ ?Îã«?÷?® ÁÕ¾???Û" + 14 "???ð(feature)?í?¡:" + 15 " %s©ª ã¸ÃÈä?? ã·?§ ????" } _____
Modified: trunk/reactos/lib/msi/registry.c --- trunk/reactos/lib/msi/registry.c 2005-11-25 23:10:34 UTC (rev 19588) +++ trunk/reactos/lib/msi/registry.c 2005-11-25 23:12:29 UTC (rev 19589) @@ -773,7 +773,7 @@
awstring *lpQualBuf, DWORD* pcchQual, awstring *lpAppBuf, DWORD* pcchAppBuf ) { - DWORD name_sz, val_sz, type, ofs; + DWORD name_sz, val_sz, name_max, val_max, type, ofs; LPWSTR name = NULL, val = NULL; UINT r, r2; HKEY key; @@ -789,41 +789,58 @@ return ERROR_UNKNOWN_COMPONENT;
/* figure out how big the name is we want to return */ - name_sz = 0; - if (pcchQual) - { - r = ERROR_OUTOFMEMORY; - name_sz = *pcchQual * 4; - name = msi_alloc( name_sz * sizeof(WCHAR) ); - if (!name) - goto end; - } + name_max = 0x10; + r = ERROR_OUTOFMEMORY; + name = msi_alloc( name_max * sizeof(WCHAR) ); + if (!name) + goto end;
- /* figure out how big the value is */ - type = 0; - val_sz = 0; - r = RegEnumValueW( key, iIndex, NULL, NULL, - NULL, &type, NULL, &val_sz ); - if (r != ERROR_SUCCESS) + val_max = 0x10; + r = ERROR_OUTOFMEMORY; + val = msi_alloc( val_max ); + if (!val) goto end;
- if (type != REG_MULTI_SZ) + /* loop until we allocate enough memory */ + while (1) { - ERR("component data has wrong type (%ld)\n", type); + name_sz = name_max; + val_sz = val_max; + r = RegEnumValueW( key, iIndex, name, &name_sz, + NULL, &type, (LPBYTE)val, &val_sz ); + if (r == ERROR_SUCCESS) + break; + if (r != ERROR_MORE_DATA) + goto end; + + if (type != REG_MULTI_SZ) + { + ERR("component data has wrong type (%ld)\n", type); + goto end; + } + + r = ERROR_OUTOFMEMORY; + if ((name_sz+1) >= name_max) + { + name_max *= 2; + msi_free( name ); + name = msi_alloc( name_max * sizeof (WCHAR) ); + if (!name) + goto end; + continue; + } + if (val_sz > val_max) + { + val_max = val_sz + sizeof (WCHAR); + val = msi_alloc( val_max * sizeof (WCHAR) ); + if (!val) + goto end; + continue; + } + ERR("should be enough data, but isn't %ld %ld\n", name_sz, val_sz ); goto end; }
- /* the value size is in bytes */ - val_sz += sizeof(WCHAR); - val = msi_alloc( val_sz ); - if (!val) - goto end; - - r = RegEnumValueW( key, iIndex, name, &name_sz, - NULL, &type, (LPBYTE)val, &val_sz ); - if (r != ERROR_SUCCESS) - goto end; - ofs = 0; r = MsiDecomposeDescriptorW( val, NULL, NULL, NULL, &ofs ); if (r != ERROR_SUCCESS)