Commit 10b77a99 authored by Guy L. Albertelli's avatar Guy L. Albertelli Committed by Alexandre Julliard

- Fixed PathIsURL{A|W}.

- Implemented PathRenameExtension{A|W}, SHRegDuplicateHKey, ChrCmpI{A|W}. - Added forwards to DrawTextW, CreateDialogParamA, CreateFontW, TracePopupMenuEx.
parent 905f04a9
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "winreg.h" #include "winreg.h"
#include "shlwapi.h" #include "shlwapi.h"
#include "debugtools.h" #include "debugtools.h"
#include "ordinal.h"
DEFAULT_DEBUG_CHANNEL(shell); DEFAULT_DEBUG_CHANNEL(shell);
...@@ -1152,27 +1152,15 @@ BOOL WINAPI PathIsSameRootW(LPCWSTR lpszPath1, LPCWSTR lpszPath2) ...@@ -1152,27 +1152,15 @@ BOOL WINAPI PathIsSameRootW(LPCWSTR lpszPath1, LPCWSTR lpszPath2)
*/ */
BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
{ {
LPSTR lpstrRes; UNKNOWN_SHLWAPI_1 base;
int iSize, i=0; DWORD res1;
static LPSTR SupportedProtocol[] =
{"http","https","ftp","gopher","file","mailto",NULL};
if(!lpstrPath) return FALSE;
/* get protocol */
lpstrRes = strchr(lpstrPath,':');
if(!lpstrRes) return FALSE;
iSize = lpstrRes - lpstrPath;
while(SupportedProtocol[i]) if(!lpstrPath) return FALSE;
{
if (iSize == strlen(SupportedProtocol[i]))
if(!strncasecmp(lpstrPath, SupportedProtocol[i], iSize))
return TRUE;
i++;
}
return FALSE; /* get protocol */
base.size = 24;
res1 = SHLWAPI_1(lpstrPath, &base);
return (base.fcncde) ? TRUE : FALSE;
} }
/************************************************************************* /*************************************************************************
...@@ -1180,29 +1168,15 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath) ...@@ -1180,29 +1168,15 @@ BOOL WINAPI PathIsURLA(LPCSTR lpstrPath)
*/ */
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath) BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
{ {
LPWSTR lpstrRes; UNKNOWN_SHLWAPI_2 base;
int iSize, i=0; DWORD res1;
static WCHAR SupportedProtocol[7][7] =
{{'h','t','t','p','\0'},{'h','t','t','p','s','\0'},{'f','t','p','\0'},
{'g','o','p','h','e','r','\0'},{'f','i','l','e','\0'},
{'m','a','i','l','t','o','\0'},{0}};
if(!lpstrPath) return FALSE; if(!lpstrPath) return FALSE;
/* get protocol */ /* get protocol */
lpstrRes = strchrW(lpstrPath,':'); base.size = 24;
if(!lpstrRes) return FALSE; res1 = SHLWAPI_2(lpstrPath, &base);
iSize = lpstrRes - lpstrPath; return (base.fcncde) ? TRUE : FALSE;
while(SupportedProtocol[i])
{
if (iSize == strlenW(SupportedProtocol[i]))
if(!strncmpiW(lpstrPath, SupportedProtocol[i], iSize))
return TRUE;
i++;
}
return FALSE;
} }
...@@ -1721,8 +1695,14 @@ BOOL WINAPI PathMakeSystemFolderW(LPCWSTR pszPath) ...@@ -1721,8 +1695,14 @@ BOOL WINAPI PathMakeSystemFolderW(LPCWSTR pszPath)
*/ */
BOOL WINAPI PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt) BOOL WINAPI PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt)
{ {
FIXME("%s %s\n", pszPath, pszExt); LPSTR pszExtension = PathFindExtensionA(pszPath);
return FALSE;
if (!pszExtension) return FALSE;
if (pszExtension-pszPath + strlen(pszExt) > MAX_PATH) return FALSE;
strcpy(pszExtension, pszExt);
TRACE("%s\n", pszPath);
return TRUE;
} }
/************************************************************************* /*************************************************************************
...@@ -1730,8 +1710,14 @@ BOOL WINAPI PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt) ...@@ -1730,8 +1710,14 @@ BOOL WINAPI PathRenameExtensionA(LPSTR pszPath, LPCSTR pszExt)
*/ */
BOOL WINAPI PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt) BOOL WINAPI PathRenameExtensionW(LPWSTR pszPath, LPCWSTR pszExt)
{ {
FIXME("%s %s\n", debugstr_w(pszPath), debugstr_w(pszExt)); LPWSTR pszExtension = PathFindExtensionW(pszPath);
return FALSE;
if (!pszExtension) return FALSE;
if (pszExtension-pszPath + strlenW(pszExt) > MAX_PATH) return FALSE;
strcpyW(pszExtension, pszExt);
TRACE("%s\n", debugstr_w(pszPath));
return TRUE;
} }
/************************************************************************* /*************************************************************************
......
...@@ -1046,3 +1046,15 @@ BOOL WINAPI SHLWAPI_323(LPCWSTR lpszSubKey) ...@@ -1046,3 +1046,15 @@ BOOL WINAPI SHLWAPI_323(LPCWSTR lpszSubKey)
return ret ? FALSE : TRUE; return ret ? FALSE : TRUE;
} }
/*************************************************************************
* SHRegDuplicateHKey [SHLWAPI.@]
*/
HKEY WINAPI SHRegDuplicateHKey(HKEY hKey)
{
HKEY newKey = 0;
RegOpenKeyExA(hKey, 0, 0, MAXIMUM_ALLOWED, &newKey);
TRACE("new key is %08x\n", newKey);
return newKey;
}
...@@ -58,7 +58,7 @@ debug_channels (shell) ...@@ -58,7 +58,7 @@ debug_channels (shell)
46 forward @ user32.CopyAcceleratorTableW 46 forward @ user32.CopyAcceleratorTableW
47 forward @ user32.CreateAcceleratorTableW 47 forward @ user32.CreateAcceleratorTableW
48 forward @ gdi32.CreateDCW 48 forward @ gdi32.CreateDCW
49 stub @ 49 forward @ user32.CreateDialogParamA
50 forward @ kernel32.CreateDirectoryW 50 forward @ kernel32.CreateDirectoryW
51 forward @ kernel32.CreateEventW 51 forward @ kernel32.CreateEventW
52 forward @ kernel32.CreateFileW 52 forward @ kernel32.CreateFileW
...@@ -70,7 +70,7 @@ debug_channels (shell) ...@@ -70,7 +70,7 @@ debug_channels (shell)
58 stub @ 58 stub @
59 stub @ 59 stub @
60 forward @ user32.DispatchMessageW 60 forward @ user32.DispatchMessageW
61 stub @ 61 forward @ user32.DrawTextW
62 forward @ gdi32.EnumFontFamiliesW 62 forward @ gdi32.EnumFontFamiliesW
63 forward @ gdi32.EnumFontFamiliesExW 63 forward @ gdi32.EnumFontFamiliesExW
64 forward @ kernel32.EnumResourceNamesW 64 forward @ kernel32.EnumResourceNamesW
...@@ -173,7 +173,7 @@ debug_channels (shell) ...@@ -173,7 +173,7 @@ debug_channels (shell)
161 stub @ 161 stub @
162 stdcall @(str long) SHLWAPI_162 162 stdcall @(str long) SHLWAPI_162
163 stub @ 163 stub @
164 stub @ 164 stdcall @(ptr ptr ptr ptr ptr ptr) SHLWAPI_164
165 stdcall @(long long long long) SHLWAPI_165 165 stdcall @(long long long long) SHLWAPI_165
166 stub @ 166 stub @
167 stub @ 167 stub @
...@@ -181,11 +181,11 @@ debug_channels (shell) ...@@ -181,11 +181,11 @@ debug_channels (shell)
169 stdcall @(long) SHLWAPI_169 169 stdcall @(long) SHLWAPI_169
170 stdcall @(str) SHLWAPI_170 170 stdcall @(str) SHLWAPI_170
171 stub @ 171 stub @
172 stub @ 172 stdcall @(ptr ptr) SHLWAPI_172
173 stub @ 173 stub @
174 stub @ 174 stdcall @(ptr ptr) SHLWAPI_174
175 stub @ 175 stub @
176 stub @ 176 stdcall @(ptr ptr ptr ptr) SHLWAPI_176
177 stub @ 177 stub @
178 stub @ 178 stub @
179 stub @ 179 stub @
...@@ -208,7 +208,7 @@ debug_channels (shell) ...@@ -208,7 +208,7 @@ debug_channels (shell)
196 stub @ 196 stub @
197 stub @ 197 stub @
198 stub @ 198 stub @
199 stub @ 199 stdcall @(ptr ptr) SHLWAPI_199
200 stub @ 200 stub @
201 stub @ 201 stub @
202 stub @ 202 stub @
...@@ -217,10 +217,10 @@ debug_channels (shell) ...@@ -217,10 +217,10 @@ debug_channels (shell)
205 stdcall @(long str str ptr ptr ptr) SHLWAPI_205 205 stdcall @(long str str ptr ptr ptr) SHLWAPI_205
206 stdcall @(long wstr wstr ptr ptr ptr) SHLWAPI_206 206 stdcall @(long wstr wstr ptr ptr ptr) SHLWAPI_206
207 stub @ 207 stub @
208 stub @ 208 stdcall @(long long ptr ptr long) SHLWAPI_208
209 stub @ 209 stub @
210 stub @ 210 stdcall @(ptr long ptr) SHLWAPI_210
211 stub @ 211 stdcall @(ptr long) SHLWAPI_211
212 stub @ 212 stub @
213 stub @ 213 stub @
214 stub @ 214 stub @
...@@ -245,10 +245,10 @@ debug_channels (shell) ...@@ -245,10 +245,10 @@ debug_channels (shell)
233 stub @ 233 stub @
234 stub @ 234 stub @
235 stub @ 235 stub @
236 stub @ 236 stdcall @(ptr) SHLWAPI_236
237 stdcall @(ptr) SHLWAPI_237 237 stdcall @(ptr) SHLWAPI_237
238 stub @ 238 stub @
239 stub @ 239 stdcall @(long str long) SHLWAPI_239
240 stdcall @(long long long long) SHLWAPI_240 240 stdcall @(long long long long) SHLWAPI_240
241 stdcall @() SHLWAPI_241 241 stdcall @() SHLWAPI_241
242 stub @ 242 stub @
...@@ -309,8 +309,8 @@ debug_channels (shell) ...@@ -309,8 +309,8 @@ debug_channels (shell)
297 stub @ 297 stub @
298 forward @ kernel32.WritePrivateProfileStringW 298 forward @ kernel32.WritePrivateProfileStringW
299 stub @ 299 stub @
300 stub @ 300 forward @ gdi32.CreateFontW
301 forward @ gdi32.DrawTextExW # FIXME CreateFontW 301 forward @ user32.DrawTextExW
302 forward @ user32.GetMenuItemInfoW 302 forward @ user32.GetMenuItemInfoW
303 forward @ user32.InsertMenuItemW 303 forward @ user32.InsertMenuItemW
304 forward @ gdi32.CreateMetaFileW 304 forward @ gdi32.CreateMetaFileW
...@@ -351,7 +351,7 @@ debug_channels (shell) ...@@ -351,7 +351,7 @@ debug_channels (shell)
339 forward @ kernel32.GetNumberFormatW 339 forward @ kernel32.GetNumberFormatW
340 forward @ user32.MessageBoxW 340 forward @ user32.MessageBoxW
341 forward @ kernel32.FindNextFileW 341 forward @ kernel32.FindNextFileW
342 stdcall @(long long long long) SHLWAPI_342 342 stdcall @(long long long) SHLWAPI_342
343 stub @ 343 stub @
344 stub @ 344 stub @
345 stub @ 345 stub @
...@@ -365,7 +365,7 @@ debug_channels (shell) ...@@ -365,7 +365,7 @@ debug_channels (shell)
353 stub @ 353 stub @
354 stub @ 354 stub @
355 stub @ 355 stub @
356 stub @ 356 stdcall @(long long long) SHLWAPI_356
357 stdcall @(wstr wstr wstr long long) SHLWAPI_357 357 stdcall @(wstr wstr wstr long long) SHLWAPI_357
358 stdcall @(ptr ptr ptr ptr ptr ptr) SHLWAPI_358 358 stdcall @(ptr ptr ptr ptr ptr ptr) SHLWAPI_358
359 forward @ kernel32.OpenEventW 359 forward @ kernel32.OpenEventW
...@@ -385,17 +385,17 @@ debug_channels (shell) ...@@ -385,17 +385,17 @@ debug_channels (shell)
373 stub @ 373 stub @
374 stub @ 374 stub @
375 stub @ 375 stub @
376 stdcall @(long) SHLWAPI_376 # kernel32.GetUserDefaultUILanguage 376 stdcall @() SHLWAPI_376 # kernel32.GetUserDefaultUILanguage
377 stdcall @(long long long) SHLWAPI_377 377 stdcall @(str long long) SHLWAPI_377
378 stdcall @(long long long) SHLWAPI_378 378 stdcall @(wstr long long) SHLWAPI_378
379 stub @ 379 stub @
380 stub @ 380 stub @
381 stub AssocQueryStringA 381 stub AssocQueryStringA
382 stub AssocQueryStringByKeyA 382 stub AssocQueryStringByKeyA
383 stub AssocQueryStringByKeyW 383 stub AssocQueryStringByKeyW
384 stub AssocQueryStringW 384 stub AssocQueryStringW
385 stub ChrCmpIA 385 stdcall ChrCmpIA(long long) ChrCmpIA
386 stub ChrCmpIW 386 stdcall ChrCmpIW(long long) ChrCmpIW
387 stub ColorAdjustLuma 387 stub ColorAdjustLuma
388 stub @ 388 stub @
389 stdcall @(ptr) SHLWAPI_389 389 stdcall @(ptr) SHLWAPI_389
...@@ -422,7 +422,7 @@ debug_channels (shell) ...@@ -422,7 +422,7 @@ debug_channels (shell)
410 stub @ 410 stub @
411 stub @ 411 stub @
412 stub @ 412 stub @
413 stub @ 413 stdcall @(long) SHLWAPI_413
414 stub @ 414 stub @
415 stub @ 415 stub @
416 stub @ 416 stub @
...@@ -437,7 +437,7 @@ debug_channels (shell) ...@@ -437,7 +437,7 @@ debug_channels (shell)
425 stub @ 425 stub @
426 stub @ 426 stub @
427 stub @ 427 stub @
428 stub @ 428 forward @ user32.TrackPopupMenuEx
429 stub @ 429 stub @
430 stub @ 430 stub @
431 stdcall @(long) SHLWAPI_431 431 stdcall @(long) SHLWAPI_431
...@@ -454,7 +454,7 @@ debug_channels (shell) ...@@ -454,7 +454,7 @@ debug_channels (shell)
442 forward @ kernel32.GetEnvironmentVariableW 442 forward @ kernel32.GetEnvironmentVariableW
443 forward @ kernel32.GetSystemWindowsDirectoryA 443 forward @ kernel32.GetSystemWindowsDirectoryA
444 forward @ kernel32.GetSystemWindowsDirectoryW 444 forward @ kernel32.GetSystemWindowsDirectoryW
445 stub ColorRGBToHLS 445 stdcall ColorRGBToHLS(long ptr ptr ptr) ColorRGBToHLS
446 stub @ 446 stub @
@ stdcall DllGetVersion (ptr) SHLWAPI_DllGetVersion @ stdcall DllGetVersion (ptr) SHLWAPI_DllGetVersion
...@@ -661,14 +661,14 @@ debug_channels (shell) ...@@ -661,14 +661,14 @@ debug_channels (shell)
@ stdcall StrToIntW(wstr)StrToIntW @ stdcall StrToIntW(wstr)StrToIntW
@ stdcall StrTrimA(str str) StrTrimA @ stdcall StrTrimA(str str) StrTrimA
@ stub StrTrimW @ stub StrTrimW
@ stub UrlApplySchemeA @ stdcall UrlApplySchemeA(str ptr ptr long) UrlApplySchemeA
@ stdcall UrlApplySchemeW(str ptr ptr long) UrlApplySchemeW @ stdcall UrlApplySchemeW(wstr ptr ptr long) UrlApplySchemeW
@ stdcall UrlCanonicalizeA(str ptr ptr long) UrlCanonicalizeA @ stdcall UrlCanonicalizeA(str ptr ptr long) UrlCanonicalizeA
@ stdcall UrlCanonicalizeW(wstr ptr ptr long) UrlCanonicalizeW @ stdcall UrlCanonicalizeW(wstr ptr ptr long) UrlCanonicalizeW
@ stdcall UrlCombineA(str str str ptr long) UrlCombineA @ stdcall UrlCombineA(str str str ptr long) UrlCombineA
@ stdcall UrlCombineW(wstr wstr wstr ptr long) UrlCombineW @ stdcall UrlCombineW(wstr wstr wstr ptr long) UrlCombineW
@ stub UrlCompareA @ stdcall UrlCompareA(str str long) UrlCompareA
@ stub UrlCompareW @ stdcall UrlCompareW(wstr wstr long) UrlCompareW
@ stub UrlCreateFromPathA @ stub UrlCreateFromPathA
@ stub UrlCreateFromPathW @ stub UrlCreateFromPathW
@ stdcall UrlEscapeA(str ptr ptr long)UrlEscapeA @ stdcall UrlEscapeA(str ptr ptr long)UrlEscapeA
...@@ -721,7 +721,7 @@ debug_channels (shell) ...@@ -721,7 +721,7 @@ debug_channels (shell)
@ stub SHCreateStreamWrapper @ stub SHCreateStreamWrapper
@ stub SHCreateThread @ stub SHCreateThread
@ stub SHGetThreadRef @ stub SHGetThreadRef
@ stub SHRegDuplicateHKey @ stdcall SHRegDuplicateHKey (long) SHRegDuplicateHKey
@ stub SHRegSetPathA @ stub SHRegSetPathA
@ stub SHRegSetPathW @ stub SHRegSetPathW
@ stub SHRegisterValidateTemplate @ stub SHRegisterValidateTemplate
......
...@@ -17,6 +17,28 @@ ...@@ -17,6 +17,28 @@
DEFAULT_DEBUG_CHANNEL(shell); DEFAULT_DEBUG_CHANNEL(shell);
/************************************************************************* /*************************************************************************
* ChrCmpIA [SHLWAPI.385]
*
* Note: Returns 0 (FALSE) if characters are equal (insensitive).
*/
BOOL WINAPI ChrCmpIA (WORD w1, WORD w2)
{
TRACE("%c ? %c\n", w1, w2);
return (toupper(w1) != toupper(w2));
}
/*************************************************************************
* ChrCmpIW [SHLWAPI.386]
*
* Note: Returns 0 (FALSE) if characters are equal (insensitive).
*/
BOOL WINAPI ChrCmpIW (WCHAR w1, WCHAR w2)
{
TRACE("%c ? %c\n", w1, w2);
return (toupperW(w1) != toupperW(w2));
}
/*************************************************************************
* StrChrA [SHLWAPI.@] * StrChrA [SHLWAPI.@]
*/ */
LPSTR WINAPI StrChrA (LPCSTR str, WORD c) LPSTR WINAPI StrChrA (LPCSTR str, WORD c)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment