Author: akhaldi
Date: Sat Mar 5 10:20:00 2016
New Revision: 70931
URL:
http://svn.reactos.org/svn/reactos?rev=70931&view=rev
Log:
[SHLWAPI] Sync with Wine Staging 1.9.4. CORE-10912
Modified:
trunk/reactos/dll/win32/shlwapi/ordinal.c
trunk/reactos/dll/win32/shlwapi/shlwapi_main.c
trunk/reactos/dll/win32/shlwapi/stopwatch.c
trunk/reactos/dll/win32/shlwapi/url.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/shlwapi/ordinal.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/ordinal.…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/ordinal.c [iso-8859-1] Sat Mar 5 10:20:00 2016
@@ -78,6 +78,12 @@
TRACE("(%p,%d,%d,%08x,%08x)\n", hShared, dwDstProcId, dwSrcProcId,
dwAccess, dwOptions);
+ if (!hShared)
+ {
+ TRACE("Returning handle NULL\n");
+ return NULL;
+ }
+
/* Get dest process handle */
if (dwDstProcId == dwMyProcId)
hDst = GetCurrentProcess();
@@ -238,6 +244,9 @@
HANDLE hClose;
TRACE("(%p %d)\n", hShared, dwProcId);
+
+ if (!hShared)
+ return TRUE;
/* Get a copy of the handle for our process, closing the source handle */
hClose = SHMapHandle(hShared, dwProcId, GetCurrentProcessId(),
@@ -4022,7 +4031,7 @@
case OS_SMALLBUSINESSSERVER:
ISOS_RETURN(platform == VER_PLATFORM_WIN32_NT)
case OS_TABLETPC:
- FIXME("(OS_TABLEPC) What should we return here?\n");
+ FIXME("(OS_TABLETPC) What should we return here?\n");
return FALSE;
case OS_SERVERADMINUI:
FIXME("(OS_SERVERADMINUI) What should we return here?\n");
@@ -4819,7 +4828,7 @@
* NOTES
* Call should free returned descriptor with LocalFree
*/
-PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(PSHELL_USER_PERMISSION
*apUserPerm, int cUserPerm)
+PSECURITY_DESCRIPTOR WINAPI GetShellSecurityDescriptor(const PSHELL_USER_PERMISSION
*apUserPerm, int cUserPerm)
{
PSID *sidlist;
PSID cur_user = NULL;
Modified: trunk/reactos/dll/win32/shlwapi/shlwapi_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/shlwapi_…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/shlwapi_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/shlwapi_main.c [iso-8859-1] Sat Mar 5 10:20:00 2016
@@ -85,6 +85,9 @@
TRACE("(%p)\n",pdvi);
+ if (!pdvi)
+ return E_INVALIDARG;
+
switch (pdvi2->info1.cbSize)
{
case sizeof(DLLVERSIONINFO2):
@@ -98,7 +101,7 @@
pdvi2->info1.dwPlatformID = DLLVER_PLATFORM_WINDOWS;
return S_OK;
}
- if (pdvi)
- WARN("pdvi->cbSize = %d, unhandled\n", pdvi2->info1.cbSize);
+
+ WARN("pdvi->cbSize = %d, unhandled\n", pdvi2->info1.cbSize);
return E_INVALIDARG;
}
Modified: trunk/reactos/dll/win32/shlwapi/stopwatch.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/stopwatc…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/stopwatch.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/stopwatch.c [iso-8859-1] Sat Mar 5 10:20:00 2016
@@ -175,16 +175,16 @@
*/
DWORD WINAPI GetPerfTime(void)
{
- static LONG64 iCounterFreq = 0;
+ static LARGE_INTEGER iCounterFreq = { {0} };
LARGE_INTEGER iCounter;
TRACE("()\n");
- if (!iCounterFreq)
- QueryPerformanceFrequency((LARGE_INTEGER*)&iCounterFreq);
+ if (!iCounterFreq.QuadPart)
+ QueryPerformanceFrequency(&iCounterFreq);
QueryPerformanceCounter(&iCounter);
- iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq;
+ iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq.QuadPart;
return iCounter.u.LowPart;
}
Modified: trunk/reactos/dll/win32/shlwapi/url.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shlwapi/url.c?re…
==============================================================================
--- trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shlwapi/url.c [iso-8859-1] Sat Mar 5 10:20:00 2016
@@ -946,6 +946,8 @@
if(!RtlCreateUnicodeStringFromAsciiz(&urlW, pszUrl))
return E_INVALIDARG;
+ if(dwFlags & URL_ESCAPE_AS_UTF8)
+ return E_NOTIMPL;
if((ret = UrlEscapeW(urlW.Buffer, escapedW, &lenW, dwFlags)) == E_POINTER) {
escapedW = HeapAlloc(GetProcessHeap(), 0, lenW * sizeof(WCHAR));
ret = UrlEscapeW(urlW.Buffer, escapedW, &lenW, dwFlags);
@@ -980,6 +982,9 @@
return ch == ' ';
if ((flags & URL_ESCAPE_PERCENT) && (ch == '%'))
+ return TRUE;
+
+ if ((flags & URL_ESCAPE_AS_UTF8) && (ch >= 0x80))
return TRUE;
if (ch <= 31 || (ch >= 127 && ch <= 255) )
@@ -1057,8 +1062,8 @@
LPCWSTR src;
DWORD needed = 0, ret;
BOOL stop_escaping = FALSE;
- WCHAR next[5], *dst, *dst_ptr;
- INT len;
+ WCHAR next[12], *dst, *dst_ptr;
+ INT i, len;
PARSEDURLW parsed_url;
DWORD int_flags;
DWORD slashes = 0;
@@ -1073,7 +1078,8 @@
if(dwFlags & ~(URL_ESCAPE_SPACES_ONLY |
URL_ESCAPE_SEGMENT_ONLY |
URL_DONT_ESCAPE_EXTRA_INFO |
- URL_ESCAPE_PERCENT))
+ URL_ESCAPE_PERCENT |
+ URL_ESCAPE_AS_UTF8))
FIXME("Unimplemented flags: %08x\n", dwFlags);
dst_ptr = dst = HeapAlloc(GetProcessHeap(), 0, *pcchEscaped*sizeof(WCHAR));
@@ -1176,10 +1182,39 @@
if(cur == '\\' && (int_flags & WINE_URL_BASH_AS_SLASH)
&& !stop_escaping) cur = '/';
if(URL_NeedEscapeW(cur, dwFlags, int_flags) && stop_escaping ==
FALSE) {
- next[0] = '%';
- next[1] = hexDigits[(cur >> 4) & 0xf];
- next[2] = hexDigits[cur & 0xf];
- len = 3;
+ if(dwFlags & URL_ESCAPE_AS_UTF8) {
+ char utf[16];
+
+ if ((cur >= 0xd800 && cur <= 0xdfff) &&
+ (src[1] >= 0xdc00 && src[1] <= 0xdfff))
+ {
+ len = WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS, src,
2,
+ utf, sizeof(utf), NULL, NULL );
+ src++;
+ }
+ else
+ len = WideCharToMultiByte( CP_UTF8, WC_ERR_INVALID_CHARS,
&cur, 1,
+ utf, sizeof(utf), NULL, NULL );
+
+ if (!len) {
+ utf[0] = 0xef;
+ utf[1] = 0xbf;
+ utf[2] = 0xbd;
+ len = 3;
+ }
+
+ for(i = 0; i < len; i++) {
+ next[i*3+0] = '%';
+ next[i*3+1] = hexDigits[(utf[i] >> 4) & 0xf];
+ next[i*3+2] = hexDigits[utf[i] & 0xf];
+ }
+ len *= 3;
+ } else {
+ next[0] = '%';
+ next[1] = hexDigits[(cur >> 4) & 0xf];
+ next[2] = hexDigits[cur & 0xf];
+ len = 3;
+ }
} else {
next[0] = cur;
len = 1;
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Sat Mar 5 10:20:00 2016
@@ -177,7 +177,7 @@
reactos/dll/win32/shdocvw # Synced to WineStaging-1.7.55
reactos/dll/win32/shell32 # Forked at Wine-20071011
reactos/dll/win32/shfolder # Synced to WineStaging-1.7.55
-reactos/dll/win32/shlwapi # Synced to WineStaging-1.7.55
+reactos/dll/win32/shlwapi # Synced to WineStaging-1.9.4
reactos/dll/win32/slbcsp # Synced to WineStaging-1.7.55
reactos/dll/win32/snmpapi # Synced to WineStaging-1.7.55
reactos/dll/win32/softpub # Synced to WineStaging-1.7.55