Reactos

[ITSS] Sync with Wine Staging 4.18. CORE-16441

+49 -72
+11 -14
dll/win32/itss/chm_lib.c
··· 54 54 * * 55 55 ***************************************************************************/ 56 56 57 - #include "config.h" 58 - #include "wine/port.h" 59 57 60 58 #include <stdarg.h> 61 59 #include <stdio.h> ··· 64 62 65 63 #include "windef.h" 66 64 #include "winbase.h" 67 - #include "wine/unicode.h" 65 + #include "winnls.h" 68 66 69 67 #include "chm_lib.h" 70 68 #include "lzx.h" ··· 995 993 return NULL; 996 994 997 995 /* check if it is the right name */ 998 - if (! strcmpiW(buffer, objPath)) 996 + if (! wcsicmp(buffer, objPath)) 999 997 return temp; 1000 998 1001 999 _chm_skip_PMGL_entry_data(&cur); ··· 1036 1034 return -1; 1037 1035 1038 1036 /* check if it is the right name */ 1039 - if (strcmpiW(buffer, objPath) > 0) 1037 + if (wcsicmp(buffer, objPath) > 0) 1040 1038 return page; 1041 1039 1042 1040 /* load next value for path */ ··· 1327 1325 /* data request not satisfied, so... start up the decompressor machine */ 1328 1326 if (! h->lzx_state) 1329 1327 { 1330 - int window_size = ffs(h->window_size) - 1; 1331 1328 h->lzx_last_block = -1; 1332 - h->lzx_state = LZXinit(window_size); 1329 + h->lzx_state = LZXinit(h->window_size); 1333 1330 } 1334 1331 1335 1332 /* decompress some data */ ··· 1438 1435 1439 1436 /* initialize pathname state */ 1440 1437 lstrcpynW(prefixRectified, prefix, CHM_MAX_PATHLEN); 1441 - prefixLen = strlenW(prefixRectified); 1438 + prefixLen = lstrlenW(prefixRectified); 1442 1439 if (prefixLen != 0) 1443 1440 { 1444 1441 if (prefixRectified[prefixLen-1] != '/') ··· 1487 1484 /* check if we should start */ 1488 1485 if (! it_has_begun) 1489 1486 { 1490 - if (ui.length == 0 && strncmpiW(ui.path, prefixRectified, prefixLen) == 0) 1487 + if (ui.length == 0 && _wcsnicmp(ui.path, prefixRectified, prefixLen) == 0) 1491 1488 it_has_begun = TRUE; 1492 1489 else 1493 1490 continue; ··· 1499 1496 /* check if we should stop */ 1500 1497 else 1501 1498 { 1502 - if (strncmpiW(ui.path, prefixRectified, prefixLen) != 0) 1499 + if (_wcsnicmp(ui.path, prefixRectified, prefixLen) != 0) 1503 1500 { 1504 1501 HeapFree(GetProcessHeap(), 0, page_buf); 1505 1502 return TRUE; ··· 1509 1506 /* check if we should include this path */ 1510 1507 if (lastPathLen != -1) 1511 1508 { 1512 - if (strncmpiW(ui.path, lastPath, lastPathLen) == 0) 1509 + if (_wcsnicmp(ui.path, lastPath, lastPathLen) == 0) 1513 1510 continue; 1514 1511 } 1515 - strcpyW(lastPath, ui.path); 1516 - lastPathLen = strlenW(lastPath); 1512 + lstrcpyW(lastPath, ui.path); 1513 + lastPathLen = lstrlenW(lastPath); 1517 1514 1518 1515 /* get the length of the path */ 1519 - ui_path_len = strlenW(ui.path)-1; 1516 + ui_path_len = lstrlenW(ui.path)-1; 1520 1517 1521 1518 /* check for DIRS */ 1522 1519 if (ui.path[ui_path_len] == '/' && !(what & CHM_ENUMERATE_DIRS))
-2
dll/win32/itss/itss.c
··· 21 21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 22 22 */ 23 23 24 - #include "config.h" 25 24 26 25 #include <stdarg.h> 27 26 #include <stdio.h> ··· 36 35 #include "rpcproxy.h" 37 36 #include "advpub.h" 38 37 39 - #include "wine/unicode.h" 40 38 #include "wine/debug.h" 41 39 42 40 #include "itsstor.h"
+4 -13
dll/win32/itss/lzx.c
··· 169 169 1835008, 1966080, 2097152 170 170 }; 171 171 172 - struct LZXstate *LZXinit(int window) 172 + struct LZXstate *LZXinit(int wndsize) 173 173 { 174 174 struct LZXstate *pState=NULL; 175 - ULONG wndsize = 1 << window; 176 175 int i, posn_slots; 177 - 178 - /* LZX supports window sizes of 2^15 (32Kb) through 2^21 (2Mb) */ 179 - /* if a previously allocated window is big enough, keep it */ 180 - if (window < 15 || window > 21) return NULL; 181 176 182 177 /* allocate state and associated window */ 183 178 pState = HeapAlloc(GetProcessHeap(), 0, sizeof(struct LZXstate)); ··· 190 185 pState->window_size = wndsize; 191 186 192 187 /* calculate required position slots */ 193 - if (window == 20) posn_slots = 42; 194 - else if (window == 21) posn_slots = 50; 195 - else posn_slots = window << 1; 196 - 197 - /** alternatively **/ 198 - /* posn_slots=i=0; while (i < wndsize) i += 1 << extra_bits[posn_slots++]; */ 188 + posn_slots = i = 0; 189 + while (i < wndsize) i += 1 << extra_bits[posn_slots++]; 199 190 200 191 /* initialize other state */ 201 192 pState->R0 = pState->R1 = pState->R2 = 1; ··· 797 788 int i; 798 789 int count=0; 799 790 int w = atoi(v[1]); 800 - LZXinit(&state, w); 791 + LZXinit(&state, 1 << w); 801 792 fout = fopen(v[2], "wb"); 802 793 for (i=3; i<c; i++) 803 794 {
+7 -9
dll/win32/itss/moniker.c
··· 20 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 21 21 */ 22 22 23 - #include "config.h" 24 23 25 24 #include <stdarg.h> 26 25 #include <stdio.h> ··· 33 32 #include "ole2.h" 34 33 35 34 #include "wine/itss.h" 36 - #include "wine/unicode.h" 37 35 #include "wine/debug.h" 38 36 39 37 #include "itsstor.h" ··· 292 290 293 291 TRACE("%p %p %p %p\n", iface, pbc, pmkToLeft, ppszDisplayName); 294 292 295 - len = strlenW( This->szFile ) + strlenW( This->szHtml ); 293 + len = lstrlenW( This->szFile ) + lstrlenW( This->szHtml ); 296 294 str = CoTaskMemAlloc( len*sizeof(WCHAR) ); 297 - sprintfW( str, szFormat, This->szFile, This->szHtml ); 295 + swprintf( str, szFormat, This->szFile, This->szHtml ); 298 296 299 297 *ppszDisplayName = str; 300 298 ··· 354 352 DWORD sz; 355 353 356 354 /* szFile[1] has space for one character already */ 357 - sz = FIELD_OFFSET( ITS_IMonikerImpl, szFile[strlenW( name ) + 1] ); 355 + sz = FIELD_OFFSET( ITS_IMonikerImpl, szFile[lstrlenW( name ) + 1] ); 358 356 359 357 itsmon = HeapAlloc( GetProcessHeap(), 0, sz ); 360 358 itsmon->IMoniker_iface.lpVtbl = &ITS_IMonikerImpl_Vtbl; 361 359 itsmon->ref = 1; 362 - strcpyW( itsmon->szFile, name ); 360 + lstrcpyW( itsmon->szFile, name ); 363 361 itsmon->szHtml = &itsmon->szFile[n]; 364 362 365 363 while( *itsmon->szHtml == ':' ) ··· 443 441 TRACE("%p %s %p %p\n", This, 444 442 debugstr_w( pszDisplayName ), pchEaten, ppmkOut ); 445 443 446 - if( strncmpiW( pszDisplayName, szPrefix, prefix_len ) ) 444 + if( _wcsnicmp( pszDisplayName, szPrefix, prefix_len ) ) 447 445 return MK_E_SYNTAX; 448 446 449 447 /* search backwards for a double colon */ 450 - for( n = strlenW( pszDisplayName ) - 3; prefix_len <= n; n-- ) 448 + for( n = lstrlenW( pszDisplayName ) - 3; prefix_len <= n; n-- ) 451 449 if( ( pszDisplayName[n] == ':' ) && ( pszDisplayName[n+1] == ':' ) ) 452 450 break; 453 451 ··· 457 455 if( !pszDisplayName[n+2] ) 458 456 return MK_E_SYNTAX; 459 457 460 - *pchEaten = strlenW( pszDisplayName ) - n - 3; 458 + *pchEaten = lstrlenW( pszDisplayName ) - n - 3; 461 459 462 460 return ITS_IMoniker_create( ppmkOut, 463 461 &pszDisplayName[prefix_len], n-prefix_len );
-4
dll/win32/itss/precomp.h
··· 2 2 #ifndef _ITSS_PCH_ 3 3 #define _ITSS_PCH_ 4 4 5 - #include <wine/config.h> 6 - #include <wine/port.h> 7 - 8 5 #include <stdarg.h> 9 6 10 7 #define WIN32_NO_STATUS ··· 18 15 #include <objbase.h> 19 16 20 17 #include <wine/itss.h> 21 - #include <wine/unicode.h> 22 18 #include <wine/debug.h> 23 19 24 20 #include "chm_lib.h"
+14 -15
dll/win32/itss/protocol.c
··· 31 31 #include "chm_lib.h" 32 32 33 33 #include "wine/debug.h" 34 - #include "wine/unicode.h" 35 34 36 35 WINE_DEFAULT_DEBUG_CHANNEL(itss); 37 36 ··· 153 152 static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'}; 154 153 static const WCHAR mk_schema[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':'}; 155 154 156 - if(!strncmpiW(its_schema, url, ARRAY_SIZE(its_schema))) 155 + if(!_wcsnicmp(its_schema, url, ARRAY_SIZE(its_schema))) 157 156 return url + ARRAY_SIZE(its_schema); 158 - if(!strncmpiW(msits_schema, url, ARRAY_SIZE(msits_schema))) 157 + if(!_wcsnicmp(msits_schema, url, ARRAY_SIZE(msits_schema))) 159 158 return url + ARRAY_SIZE(msits_schema); 160 - if(!strncmpiW(mk_schema, url, ARRAY_SIZE(mk_schema))) 159 + if(!_wcsnicmp(mk_schema, url, ARRAY_SIZE(mk_schema))) 161 160 return url + ARRAY_SIZE(mk_schema); 162 161 163 162 return NULL; ··· 251 250 252 251 ReleaseBindInfo(&bindinfo); 253 252 254 - len = strlenW(ptr)+3; 253 + len = lstrlenW(ptr)+3; 255 254 file_name = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR)); 256 255 memcpy(file_name, ptr, len*sizeof(WCHAR)); 257 256 hres = UrlUnescapeW(file_name, NULL, &len, URL_UNESCAPE_INPLACE); ··· 261 260 return hres; 262 261 } 263 262 264 - p = strstrW(file_name, separator); 263 + p = wcsstr(file_name, separator); 265 264 if(!p) { 266 265 WARN("invalid url\n"); 267 266 HeapFree(GetProcessHeap(), 0, file_name); ··· 277 276 } 278 277 279 278 object_name = p+2; 280 - len = strlenW(object_name); 279 + len = lstrlenW(object_name); 281 280 282 281 if(*object_name != '/' && *object_name != '\\') { 283 282 memmove(object_name+1, object_name, (len+1)*sizeof(WCHAR)); ··· 307 306 } 308 307 309 308 IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, 310 - strrchrW(object_name, '/')+1); 309 + wcsrchr(object_name, '/')+1); 311 310 312 311 /* FIXME: Native doesn't use FindMimeFromData */ 313 312 hres = FindMimeFromData(NULL, object_name, NULL, 0, NULL, 0, &mime, 0); ··· 487 486 debugstr_w(pwzRelativeUrl), dwCombineFlags, pwzResult, cchResult, 488 487 pcchResult, dwReserved); 489 488 490 - base_end = strstrW(pwzBaseUrl, separator); 489 + base_end = wcsstr(pwzBaseUrl, separator); 491 490 if(!base_end) 492 491 return 0x80041001; 493 492 base_end += 2; ··· 495 494 if(!skip_schema(pwzBaseUrl)) 496 495 return INET_E_USE_DEFAULT_PROTOCOLHANDLER; 497 496 498 - if(strchrW(pwzRelativeUrl, ':')) 497 + if(wcschr(pwzRelativeUrl, ':')) 499 498 return STG_E_INVALIDNAME; 500 499 501 500 if(pwzRelativeUrl[0] == '#') { 502 - base_end += strlenW(base_end); 501 + base_end += lstrlenW(base_end); 503 502 }else if(pwzRelativeUrl[0] != '/') { 504 - ptr = strrchrW(base_end, '/'); 503 + ptr = wcsrchr(base_end, '/'); 505 504 if(ptr) 506 505 base_end = ptr+1; 507 506 else 508 - base_end += strlenW(base_end); 507 + base_end += lstrlenW(base_end); 509 508 } 510 509 511 - rel_len = strlenW(pwzRelativeUrl)+1; 510 + rel_len = lstrlenW(pwzRelativeUrl)+1; 512 511 513 512 *pcchResult = rel_len + (base_end-pwzBaseUrl); 514 513 ··· 516 515 return E_OUTOFMEMORY; 517 516 518 517 memcpy(pwzResult, pwzBaseUrl, (base_end-pwzBaseUrl)*sizeof(WCHAR)); 519 - strcpyW(pwzResult + (base_end-pwzBaseUrl), pwzRelativeUrl); 518 + lstrcpyW(pwzResult + (base_end-pwzBaseUrl), pwzRelativeUrl); 520 519 521 520 return S_OK; 522 521 }
+12 -14
dll/win32/itss/storage.c
··· 20 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 21 21 */ 22 22 23 - #include "config.h" 24 23 25 24 #include <stdarg.h> 26 25 #include <stdio.h> ··· 36 35 #include "itsstor.h" 37 36 38 37 #include "wine/itss.h" 39 - #include "wine/unicode.h" 40 38 #include "wine/debug.h" 41 39 42 40 WINE_DEFAULT_DEBUG_CHANNEL(itss); ··· 167 165 str = cur->ui.path; 168 166 if( *str == '/' ) 169 167 str++; 170 - len = strlenW( str ) + 1; 168 + len = lstrlenW( str ) + 1; 171 169 rgelt->pwcsName = CoTaskMemAlloc( len*sizeof(WCHAR) ); 172 - strcpyW( rgelt->pwcsName, str ); 170 + lstrcpyW( rgelt->pwcsName, str ); 173 171 174 172 /* determine the type */ 175 173 if( rgelt->pwcsName[len-2] == '/' ) ··· 345 343 TRACE("%p %s %p %u %u %p\n", This, debugstr_w(pwcsName), 346 344 reserved1, grfMode, reserved2, ppstm ); 347 345 348 - len = strlenW( This->dir ) + strlenW( pwcsName ) + 1; 346 + len = lstrlenW( This->dir ) + lstrlenW( pwcsName ) + 1; 349 347 path = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); 350 - strcpyW( path, This->dir ); 348 + lstrcpyW( path, This->dir ); 351 349 352 350 if( pwcsName[0] == '/' || pwcsName[0] == '\\' ) 353 351 { 354 - p = &path[strlenW( path ) - 1]; 352 + p = &path[lstrlenW( path ) - 1]; 355 353 while( ( path <= p ) && ( *p == '/' ) ) 356 354 *p-- = 0; 357 355 } 358 - strcatW( path, pwcsName ); 356 + lstrcatW( path, pwcsName ); 359 357 360 358 for(p=path; *p; p++) { 361 359 if(*p == '\\') ··· 417 415 if( !chmfile ) 418 416 return E_FAIL; 419 417 420 - len = strlenW( This->dir ) + strlenW( pwcsName ) + 2; /* need room for a terminating slash */ 418 + len = lstrlenW( This->dir ) + lstrlenW( pwcsName ) + 2; /* need room for a terminating slash */ 421 419 path = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) ); 422 - strcpyW( path, This->dir ); 420 + lstrcpyW( path, This->dir ); 423 421 424 422 if( pwcsName[0] == '/' || pwcsName[0] == '\\' ) 425 423 { 426 - p = &path[strlenW( path ) - 1]; 424 + p = &path[lstrlenW( path ) - 1]; 427 425 while( ( path <= p ) && ( *p == '/' ) ) 428 426 *p-- = 0; 429 427 } 430 - strcatW( path, pwcsName ); 428 + lstrcatW( path, pwcsName ); 431 429 432 430 for(p=path; *p; p++) { 433 431 if(*p == '\\') ··· 620 618 TRACE("%p %s\n", chmfile, debugstr_w( dir ) ); 621 619 622 620 stg = HeapAlloc( GetProcessHeap(), 0, 623 - FIELD_OFFSET( ITSS_IStorageImpl, dir[strlenW( dir ) + 1] )); 621 + FIELD_OFFSET( ITSS_IStorageImpl, dir[lstrlenW( dir ) + 1] )); 624 622 stg->IStorage_iface.lpVtbl = &ITSS_IStorageImpl_Vtbl; 625 623 stg->ref = 1; 626 624 stg->chmfile = chmfile; 627 - strcpyW( stg->dir, dir ); 625 + lstrcpyW( stg->dir, dir ); 628 626 629 627 *ppstgOpen = &stg->IStorage_iface; 630 628
+1 -1
media/doc/README.WINE
··· 85 85 dll/win32/inseng # Synced to WineStaging-4.18 86 86 dll/win32/iphlpapi # Out of sync 87 87 dll/win32/itircl # Synced to WineStaging-4.18 88 - dll/win32/itss # Synced to WineStaging-3.17 88 + dll/win32/itss # Synced to WineStaging-4.18 89 89 dll/win32/jscript # Synced to WineStaging-4.0 90 90 dll/win32/jsproxy # Synced to WineStaging-4.0 91 91 dll/win32/loadperf # Synced to WineStaging-3.3