Moved shlwapi routines from shell32.dll to shlwapi.dll.
This commit is contained in:
parent
7e495e1d66
commit
6430d93aa6
|
@ -393,9 +393,8 @@ oleaut32/liboleaut32.so: libole32.so libcomctl32.so
|
|||
olecli/libolecli32.so: libolesvr32.so libole32.so
|
||||
olepro32/libolepro32.so: liboleaut32.so libole32.so
|
||||
opengl32/libopengl32.so: libx11drv.so libgdi32.so
|
||||
shell32/libshell32.so: libole32.so
|
||||
shell32/libshell32.so: libole32.so libshlwapi.so
|
||||
shfolder/libshfolder.so: libshell32.so
|
||||
shlwapi/libshlwapi.so: libshell32.so
|
||||
urlmon/liburlmon.so: libole32.so
|
||||
version/libversion.so: liblz32.so
|
||||
win32s/libw32skrnl.so: libkernel32.so
|
||||
|
|
|
@ -5,7 +5,7 @@ VPATH = @srcdir@
|
|||
MODULE = shell32
|
||||
SOVERSION = 1.0
|
||||
ALTNAMES = shell
|
||||
IMPORTS = ole32
|
||||
IMPORTS = ole32 shlwapi
|
||||
|
||||
C_SRCS = \
|
||||
brsfolder.c \
|
||||
|
@ -19,7 +19,6 @@ C_SRCS = \
|
|||
iconcache.c \
|
||||
memorystream.c \
|
||||
pidl.c \
|
||||
regstream.c \
|
||||
shell32_main.c \
|
||||
shell.c \
|
||||
shellguid.c \
|
||||
|
|
|
@ -3,6 +3,7 @@ type win32
|
|||
init Shell32LibMain
|
||||
rsrc shres
|
||||
|
||||
import shlwapi.dll
|
||||
import user32.dll
|
||||
import comctl32.dll
|
||||
|
||||
|
@ -91,7 +92,7 @@ import ole32.dll
|
|||
82 stdcall DragQueryFileA(long long ptr long) DragQueryFileA
|
||||
83 stub CIDLData_CreateFromIDArray
|
||||
84 stub SHIsBadInterfacePtr
|
||||
85 stdcall OpenRegStream(long str str long) SHOpenRegStreamA
|
||||
85 forward OpenRegStream shlwapi.SHOpenRegStreamA
|
||||
86 stdcall SHRegisterDragDrop(long ptr) SHRegisterDragDrop
|
||||
87 stdcall SHRevokeDragDrop(long) SHRevokeDragDrop
|
||||
88 stdcall SHDoDragDrop(long long long long long) SHDoDragDrop
|
||||
|
|
|
@ -749,42 +749,6 @@ HRESULT WINAPI SHELL32_DllGetVersion (DLLVERSIONINFO *pdvi)
|
|||
|
||||
return S_OK;
|
||||
}
|
||||
/***********************************************************************
|
||||
* DllGetVersion [SHLWAPI]
|
||||
*
|
||||
* Retrieves version information of the 'SHLWAPI.DLL'
|
||||
*
|
||||
* PARAMS
|
||||
* pdvi [O] pointer to version information structure.
|
||||
*
|
||||
* RETURNS
|
||||
* Success: S_OK
|
||||
* Failure: E_INVALIDARG
|
||||
*
|
||||
* NOTES
|
||||
* Returns version of a SHLWAPI.dll from IE5.01.
|
||||
*/
|
||||
|
||||
HRESULT WINAPI SHLWAPI_DllGetVersion (DLLVERSIONINFO *pdvi)
|
||||
{
|
||||
if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
|
||||
{
|
||||
WARN("wrong DLLVERSIONINFO size from app");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
pdvi->dwMajorVersion = 5;
|
||||
pdvi->dwMinorVersion = 0;
|
||||
pdvi->dwBuildNumber = 2314;
|
||||
pdvi->dwPlatformID = 1000;
|
||||
|
||||
TRACE("%lu.%lu.%lu.%lu\n",
|
||||
pdvi->dwMajorVersion, pdvi->dwMinorVersion,
|
||||
pdvi->dwBuildNumber, pdvi->dwPlatformID);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* global variables of the shell32.dll
|
||||
* all are once per process
|
||||
|
|
|
@ -960,69 +960,6 @@ BOOL WINAPI shell32_243(DWORD a, DWORD b)
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHCreateShellPalette
|
||||
*/
|
||||
HPALETTE WINAPI SHCreateShellPalette(HDC hdc)
|
||||
{
|
||||
FIXME("stub\n");
|
||||
return CreateHalftonePalette(hdc);
|
||||
}
|
||||
/*************************************************************************
|
||||
* wnsprintfA [SHLWAPI]
|
||||
*/
|
||||
int WINAPIV wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...)
|
||||
{
|
||||
va_list valist;
|
||||
INT res;
|
||||
|
||||
va_start( valist, lpFmt );
|
||||
res = wvsnprintfA( lpOut, cchLimitIn, lpFmt, valist );
|
||||
va_end( valist );
|
||||
return res;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* wnsprintfW [SHLWAPI]
|
||||
*/
|
||||
int WINAPIV wnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...)
|
||||
{
|
||||
va_list valist;
|
||||
INT res;
|
||||
|
||||
va_start( valist, lpFmt );
|
||||
res = wvsnprintfW( lpOut, cchLimitIn, lpFmt, valist );
|
||||
va_end( valist );
|
||||
return res;
|
||||
}
|
||||
/*************************************************************************
|
||||
* UrlEscapeA [SHLWAPI]
|
||||
*/
|
||||
HRESULT WINAPI UrlEscapeA(
|
||||
LPCSTR pszUrl,
|
||||
LPSTR pszEscaped,
|
||||
LPDWORD pcchEscaped,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("(%s %p %p 0x%08lx)stub\n",debugstr_a(pszUrl),
|
||||
pszEscaped, pcchEscaped, dwFlags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* UrlEscapeW [SHLWAPI]
|
||||
*/
|
||||
HRESULT WINAPI UrlEscapeW(
|
||||
LPCWSTR pszUrl,
|
||||
LPWSTR pszEscaped,
|
||||
LPDWORD pcchEscaped,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("(%s %p %p 0x%08lx)stub\n",debugstr_w(pszUrl),
|
||||
pszEscaped, pcchEscaped, dwFlags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHELL32_714 [SHELL32]
|
||||
*/
|
||||
|
@ -1031,13 +968,3 @@ DWORD WINAPI SHELL32_714(LPVOID x)
|
|||
FIXME("(%s)stub\n", debugstr_w(x));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHIsLowMemoryMachine [SHLWAPI.@]
|
||||
*/
|
||||
DWORD WINAPI SHIsLowMemoryMachine (DWORD x)
|
||||
{
|
||||
FIXME("0x%08lx\n", x);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -44,7 +44,7 @@ HRESULT WINAPI SHRegOpenKeyW (
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegQueryValueExA SHQueryValueExA [SHELL32.509][SHLWAPI.@]
|
||||
* SHRegQueryValueExA [SHELL32.509]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHRegQueryValueExA(
|
||||
|
@ -75,7 +75,7 @@ HRESULT WINAPI SHRegQueryValueW(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegQueryValueExW, SHQueryValueExW [NT4.0:SHELL32.511][SHLWAPI.@]
|
||||
* SHRegQueryValueExW [NT4.0:SHELL32.511]
|
||||
*
|
||||
* FIXME
|
||||
* if the datatype REG_EXPAND_SZ then expand the string and change
|
||||
|
@ -96,170 +96,8 @@ HRESULT WINAPI SHRegQueryValueExW (
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* SHGetValue: Gets a value from the registry */
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetValueA
|
||||
*
|
||||
* Gets a value from the registry
|
||||
*/
|
||||
DWORD WINAPI SHGetValueA(
|
||||
HKEY hkey,
|
||||
LPCSTR pSubKey,
|
||||
LPCSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData)
|
||||
{
|
||||
HKEY hSubKey;
|
||||
DWORD res;
|
||||
|
||||
TRACE("(%s %s)\n", pSubKey, pValue);
|
||||
|
||||
if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
|
||||
res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
|
||||
RegCloseKey( hSubKey );
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetValueW
|
||||
*
|
||||
* Gets a value from the registry
|
||||
*/
|
||||
DWORD WINAPI SHGetValueW(
|
||||
HKEY hkey,
|
||||
LPCWSTR pSubKey,
|
||||
LPCWSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData)
|
||||
{
|
||||
HKEY hSubKey;
|
||||
DWORD res;
|
||||
|
||||
TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
|
||||
|
||||
if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
|
||||
res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
|
||||
RegCloseKey( hSubKey );
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/* gets a user-specific registry value. */
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetUSValueA
|
||||
*
|
||||
* Gets a user-specific registry value
|
||||
*/
|
||||
LONG WINAPI SHRegGetUSValueA(
|
||||
LPCSTR pSubKey,
|
||||
LPCSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData,
|
||||
BOOL fIgnoreHKCU,
|
||||
LPVOID pDefaultData,
|
||||
DWORD wDefaultDataSize)
|
||||
{
|
||||
FIXME("(%p),stub!\n", pSubKey);
|
||||
return ERROR_SUCCESS; /* return success */
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetUSValueW
|
||||
*
|
||||
* Gets a user-specific registry value
|
||||
*/
|
||||
LONG WINAPI SHRegGetUSValueW(
|
||||
LPCWSTR pSubKey,
|
||||
LPCWSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData,
|
||||
BOOL flagIgnoreHKCU,
|
||||
LPVOID pDefaultData,
|
||||
DWORD wDefaultDataSize)
|
||||
{
|
||||
FIXME("(%p),stub!\n", pSubKey);
|
||||
return ERROR_SUCCESS; /* return success */
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetBoolUSValueA
|
||||
*/
|
||||
BOOL WINAPI SHRegGetBoolUSValueA(
|
||||
LPCSTR pszSubKey,
|
||||
LPCSTR pszValue,
|
||||
BOOL fIgnoreHKCU,
|
||||
BOOL fDefault)
|
||||
{
|
||||
FIXME("%s %s\n", pszSubKey,pszValue);
|
||||
return fDefault;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetBoolUSValueW
|
||||
*/
|
||||
BOOL WINAPI SHRegGetBoolUSValueW(
|
||||
LPCWSTR pszSubKey,
|
||||
LPCWSTR pszValue,
|
||||
BOOL fIgnoreHKCU,
|
||||
BOOL fDefault)
|
||||
{
|
||||
FIXME("%s %s\n", debugstr_w(pszSubKey),debugstr_w(pszValue));
|
||||
return fDefault;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegQueryUSValueA [SHLWAPI]
|
||||
*/
|
||||
LONG WINAPI SHRegQueryUSValueA(
|
||||
HKEY/*HUSKEY*/ hUSKey,
|
||||
LPCSTR pszValue,
|
||||
LPDWORD pdwType,
|
||||
void *pvData,
|
||||
LPDWORD pcbData,
|
||||
BOOL fIgnoreHKCU,
|
||||
void *pvDefaultData,
|
||||
DWORD dwDefaultDataSize)
|
||||
{
|
||||
FIXME("%s stub\n",pszValue);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetPathA
|
||||
*/
|
||||
DWORD WINAPI SHRegGetPathA(
|
||||
HKEY hKey,
|
||||
LPCSTR pcszSubKey,
|
||||
LPCSTR pcszValue,
|
||||
LPSTR pszPath,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("%s %s\n", pcszSubKey, pcszValue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetPathW
|
||||
*/
|
||||
DWORD WINAPI SHRegGetPathW(
|
||||
HKEY hKey,
|
||||
LPCWSTR pcszSubKey,
|
||||
LPCWSTR pcszValue,
|
||||
LPWSTR pszPath,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("%s %s\n", debugstr_w(pcszSubKey), debugstr_w(pcszValue));
|
||||
return 0;
|
||||
}
|
||||
/*************************************************************************
|
||||
* SHRegDeleteKeyA and SHDeleteKeyA
|
||||
* SHRegDeleteKeyA [SHELL32]
|
||||
*/
|
||||
HRESULT WINAPI SHRegDeleteKeyA(
|
||||
HKEY hkey,
|
||||
|
@ -270,7 +108,7 @@ HRESULT WINAPI SHRegDeleteKeyA(
|
|||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegDeleteKeyW and SHDeleteKeyA
|
||||
* SHRegDeleteKeyW [SHELL32]
|
||||
*/
|
||||
HRESULT WINAPI SHRegDeleteKeyW(
|
||||
HKEY hkey,
|
||||
|
@ -280,21 +118,6 @@ HRESULT WINAPI SHRegDeleteKeyW(
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHSetValueA [SHLWAPI]
|
||||
*/
|
||||
DWORD WINAPI SHSetValueA(
|
||||
HKEY hkey,
|
||||
LPCSTR pszSubKey,
|
||||
LPCSTR pszValue,
|
||||
DWORD dwType,
|
||||
LPCVOID pvData,
|
||||
DWORD cbData)
|
||||
{
|
||||
FIXME("(%s %s)stub\n",pszSubKey, pszValue);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegCloseKey [NT4.0:SHELL32.505]
|
||||
*
|
||||
|
|
|
@ -27,65 +27,14 @@ DEFAULT_DEBUG_CHANNEL(shell);
|
|||
*/
|
||||
HRESULT WINAPI StrRetToStrNA (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
|
||||
{
|
||||
TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
|
||||
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
|
||||
SHFree(src->u.pOleStr);
|
||||
break;
|
||||
|
||||
case STRRET_CSTRA:
|
||||
lstrcpynA((LPSTR)dest, src->u.cStr, len);
|
||||
break;
|
||||
|
||||
case STRRET_OFFSETA:
|
||||
lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len)
|
||||
{
|
||||
*(LPSTR)dest = '\0';
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
return S_OK;
|
||||
return StrRetToBufA( src, pidl, dest, len );
|
||||
}
|
||||
|
||||
HRESULT WINAPI StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
|
||||
{
|
||||
TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
|
||||
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
|
||||
SHFree(src->u.pOleStr);
|
||||
break;
|
||||
|
||||
case STRRET_CSTRA:
|
||||
lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
|
||||
break;
|
||||
|
||||
case STRRET_OFFSETA:
|
||||
if (pidl)
|
||||
{
|
||||
lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len)
|
||||
{ *(LPSTR)dest = '\0';
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
return S_OK;
|
||||
return StrRetToBufW( src, pidl, dest, len );
|
||||
}
|
||||
|
||||
HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)
|
||||
{
|
||||
if(VERSION_OsIsUnicode())
|
||||
|
@ -93,32 +42,6 @@ HRESULT WINAPI StrRetToStrNAW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIS
|
|||
return StrRetToStrNA (dest, len, src, pidl);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrRetToBufA [SHLWAPI.@]
|
||||
*
|
||||
* converts a STRRET to a normal string
|
||||
*
|
||||
* NOTES
|
||||
* the pidl is for STRRET OFFSET
|
||||
*/
|
||||
HRESULT WINAPI StrRetToBufA (LPSTRRET src, LPITEMIDLIST pidl, LPSTR dest, DWORD len)
|
||||
{
|
||||
return StrRetToStrNA(dest, len, src, pidl);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrRetToBufW [SHLWAPI.@]
|
||||
*
|
||||
* converts a STRRET to a normal string
|
||||
*
|
||||
* NOTES
|
||||
* the pidl is for STRRET OFFSET
|
||||
*/
|
||||
HRESULT WINAPI StrRetToBufW (LPSTRRET src, LPITEMIDLIST pidl, LPWSTR dest, DWORD len)
|
||||
{
|
||||
return StrRetToStrNW(dest, len, src, pidl);
|
||||
}
|
||||
|
||||
/************************* string functions ****************************/
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -176,202 +99,6 @@ int WINAPI StrCmpNIW ( LPCWSTR wstr1, LPCWSTR wstr2, int len)
|
|||
return strncmpiW(wstr1, wstr2, len);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrStrA(LPCSTR lpFirst, LPCSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
|
||||
if (!*p2) return (LPSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCWSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
|
||||
if (!*p2) return (LPWSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrIA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && toupper(*p1) == toupper(*p2)) { p1++; p2++; }
|
||||
if (!*p2) return (LPSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrIW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCWSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && toupperW(*p1) == toupperW(*p2)) { p1++; p2++; }
|
||||
if (!*p2) return (LPWSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrToIntA [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrToIntA(LPCSTR lpSrc)
|
||||
{
|
||||
TRACE("%s\n", lpSrc);
|
||||
return atol(lpSrc);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrToIntW [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrToIntW(LPCWSTR lpSrc)
|
||||
{
|
||||
int ret;
|
||||
LPSTR lpStr = HEAP_strdupWtoA(GetProcessHeap(),0,lpSrc);
|
||||
|
||||
TRACE("%s\n", debugstr_w(lpSrc));
|
||||
|
||||
ret = atol(lpStr);
|
||||
HeapFree(GetProcessHeap(),0,lpStr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrDupA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrDupA (LPCSTR lpSrc)
|
||||
{
|
||||
int len = strlen(lpSrc);
|
||||
LPSTR lpDest = (LPSTR) LocalAlloc(LMEM_FIXED, len+1);
|
||||
|
||||
TRACE("%s\n", lpSrc);
|
||||
|
||||
if (lpDest) strcpy(lpDest, lpSrc);
|
||||
return lpDest;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrDupW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrDupW (LPCWSTR lpSrc)
|
||||
{
|
||||
int len = lstrlenW(lpSrc);
|
||||
LPWSTR lpDest = (LPWSTR) LocalAlloc(LMEM_FIXED, sizeof(WCHAR) * (len+1));
|
||||
|
||||
TRACE("%s\n", debugstr_w(lpSrc));
|
||||
|
||||
if (lpDest) lstrcpyW(lpDest, lpSrc);
|
||||
return lpDest;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCSpnA [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrCSpnA (LPCSTR lpStr, LPCSTR lpSet)
|
||||
{
|
||||
int i,j, pos = strlen(lpStr);
|
||||
|
||||
TRACE("(%p %s %p %s)\n",
|
||||
lpStr, debugstr_a(lpStr), lpSet, debugstr_a(lpSet));
|
||||
|
||||
for (i=0; i < strlen(lpSet) ; i++ )
|
||||
{
|
||||
for (j = 0; j < pos;j++)
|
||||
{
|
||||
if (lpStr[j] == lpSet[i])
|
||||
{
|
||||
pos = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE("-- %u\n", pos);
|
||||
return pos;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCSpnW [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet)
|
||||
{
|
||||
int i,j, pos = lstrlenW(lpStr);
|
||||
|
||||
TRACE("(%p %s %p %s)\n",
|
||||
lpStr, debugstr_w(lpStr), lpSet, debugstr_w(lpSet));
|
||||
|
||||
for (i=0; i < lstrlenW(lpSet) ; i++ )
|
||||
{
|
||||
for (j = 0; j < pos;j++)
|
||||
{
|
||||
if (lpStr[j] == lpSet[i])
|
||||
{
|
||||
pos = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE("-- %u\n", pos);
|
||||
return pos;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCatBuffA [SHLWAPI]
|
||||
*
|
||||
* Appends back onto front, stopping when front is size-1 characters long.
|
||||
* Returns front.
|
||||
*
|
||||
*/
|
||||
LPSTR WINAPI StrCatBuffA(LPSTR front, LPCSTR back, INT size)
|
||||
{
|
||||
LPSTR dst = front + lstrlenA(front);
|
||||
LPCSTR src = back, end = front + size - 1;
|
||||
|
||||
while(dst < end && *src)
|
||||
*dst++ = *src++;
|
||||
*dst = '\0';
|
||||
return front;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCatBuffW [SHLWAPI]
|
||||
*
|
||||
* Appends back onto front, stopping when front is size-1 characters long.
|
||||
* Returns front.
|
||||
*
|
||||
*/
|
||||
LPWSTR WINAPI StrCatBuffW(LPWSTR front, LPCWSTR back, INT size)
|
||||
{
|
||||
LPWSTR dst = front + lstrlenW(front);
|
||||
LPCWSTR src = back, end = front + size - 1;
|
||||
|
||||
while(dst < end && *src)
|
||||
*dst++ = *src++;
|
||||
*dst = '\0';
|
||||
return front;
|
||||
}
|
||||
|
||||
/************************* OLESTR functions ****************************/
|
||||
|
||||
/************************************************************************
|
||||
|
@ -456,48 +183,3 @@ BOOL WINAPI OleStrToStrNAW (LPVOID lpOut, INT nOut, LPCVOID lpIn, INT nIn)
|
|||
return OleStrToStrNW (lpOut, nOut, lpIn, nIn);
|
||||
return OleStrToStrNA (lpOut, nOut, lpIn, nIn);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrFormatByteSizeA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf )
|
||||
{ char buf[64];
|
||||
TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
|
||||
if ( dw<1024L )
|
||||
{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
|
||||
}
|
||||
else if ( dw<1048576L)
|
||||
{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
|
||||
}
|
||||
else if ( dw < 1073741824L)
|
||||
{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
|
||||
}
|
||||
else
|
||||
{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
|
||||
}
|
||||
lstrcpynA (pszBuf, buf, cchBuf);
|
||||
return pszBuf;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrFormatByteSizeW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf )
|
||||
{ char buf[64];
|
||||
TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
|
||||
if ( dw<1024L )
|
||||
{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
|
||||
}
|
||||
else if ( dw<1048576L)
|
||||
{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
|
||||
}
|
||||
else if ( dw < 1073741824L)
|
||||
{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
|
||||
}
|
||||
else
|
||||
{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
|
||||
}
|
||||
lstrcpynAtoW (pszBuf, buf, cchBuf);
|
||||
return pszBuf;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,14 @@ SRCDIR = @srcdir@
|
|||
VPATH = @srcdir@
|
||||
MODULE = shlwapi
|
||||
SOVERSION = 1.0
|
||||
IMPORTS = shell32
|
||||
|
||||
C_SRCS = \
|
||||
ordinal.c \
|
||||
shlwapi_main.c
|
||||
path.c \
|
||||
reg.c \
|
||||
regstream.c \
|
||||
shlwapi_main.c \
|
||||
string.c
|
||||
|
||||
@MAKE_DLL_RULES@
|
||||
|
||||
|
|
|
@ -83,8 +83,13 @@ DWORD WINAPI SHLWAPI_24 (
|
|||
LPWSTR str, /* [out] buffer */
|
||||
INT cmax) /* [in] size of buffer */
|
||||
{
|
||||
TRACE("(%s %p 0x%08x)stub\n", debugstr_guid(guid), str, cmax);
|
||||
return StringFromGUID2(guid, str, cmax);
|
||||
char xguid[40];
|
||||
|
||||
sprintf( xguid, "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}",
|
||||
guid->Data1, guid->Data2, guid->Data3,
|
||||
guid->Data4[0], guid->Data4[1], guid->Data4[2], guid->Data4[3],
|
||||
guid->Data4[4], guid->Data4[5], guid->Data4[6], guid->Data4[7] );
|
||||
return MultiByteToWideChar( CP_ACP, 0, xguid, -1, str, cmax );
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
|
@ -388,3 +393,49 @@ DWORD WINAPI SHLWAPI_437 (DWORD x)
|
|||
return 0xabba1247;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* UrlEscapeA [SHLWAPI]
|
||||
*/
|
||||
HRESULT WINAPI UrlEscapeA(
|
||||
LPCSTR pszUrl,
|
||||
LPSTR pszEscaped,
|
||||
LPDWORD pcchEscaped,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("(%s %p %p 0x%08lx)stub\n",debugstr_a(pszUrl),
|
||||
pszEscaped, pcchEscaped, dwFlags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* UrlEscapeW [SHLWAPI]
|
||||
*/
|
||||
HRESULT WINAPI UrlEscapeW(
|
||||
LPCWSTR pszUrl,
|
||||
LPWSTR pszEscaped,
|
||||
LPDWORD pcchEscaped,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("(%s %p %p 0x%08lx)stub\n",debugstr_w(pszUrl),
|
||||
pszEscaped, pcchEscaped, dwFlags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* SHCreateShellPalette [SHLWAPI.@]
|
||||
*/
|
||||
HPALETTE WINAPI SHCreateShellPalette(HDC hdc)
|
||||
{
|
||||
FIXME("stub\n");
|
||||
return CreateHalftonePalette(hdc);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHIsLowMemoryMachine [SHLWAPI.@]
|
||||
*/
|
||||
DWORD WINAPI SHIsLowMemoryMachine (DWORD x)
|
||||
{
|
||||
FIXME("0x%08lx\n", x);
|
||||
return 0;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,244 @@
|
|||
/*
|
||||
* SHLWAPI registry functions
|
||||
*/
|
||||
|
||||
#include "windef.h"
|
||||
#include "winerror.h"
|
||||
#include "winreg.h"
|
||||
#include "wine/undocshell.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetUSValueA [SHLWAPI.@]
|
||||
*
|
||||
* Gets a user-specific registry value
|
||||
*/
|
||||
LONG WINAPI SHRegGetUSValueA(
|
||||
LPCSTR pSubKey,
|
||||
LPCSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData,
|
||||
BOOL fIgnoreHKCU,
|
||||
LPVOID pDefaultData,
|
||||
DWORD wDefaultDataSize)
|
||||
{
|
||||
FIXME("(%p),stub!\n", pSubKey);
|
||||
return ERROR_SUCCESS; /* return success */
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetUSValueW [SHLWAPI.@]
|
||||
*
|
||||
* Gets a user-specific registry value
|
||||
*/
|
||||
LONG WINAPI SHRegGetUSValueW(
|
||||
LPCWSTR pSubKey,
|
||||
LPCWSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData,
|
||||
BOOL flagIgnoreHKCU,
|
||||
LPVOID pDefaultData,
|
||||
DWORD wDefaultDataSize)
|
||||
{
|
||||
FIXME("(%p),stub!\n", pSubKey);
|
||||
return ERROR_SUCCESS; /* return success */
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetBoolUSValueA [SHLWAPI.@]
|
||||
*/
|
||||
BOOL WINAPI SHRegGetBoolUSValueA(
|
||||
LPCSTR pszSubKey,
|
||||
LPCSTR pszValue,
|
||||
BOOL fIgnoreHKCU,
|
||||
BOOL fDefault)
|
||||
{
|
||||
FIXME("%s %s\n", pszSubKey,pszValue);
|
||||
return fDefault;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetBoolUSValueW [SHLWAPI.@]
|
||||
*/
|
||||
BOOL WINAPI SHRegGetBoolUSValueW(
|
||||
LPCWSTR pszSubKey,
|
||||
LPCWSTR pszValue,
|
||||
BOOL fIgnoreHKCU,
|
||||
BOOL fDefault)
|
||||
{
|
||||
FIXME("%s %s\n", debugstr_w(pszSubKey),debugstr_w(pszValue));
|
||||
return fDefault;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegQueryUSValueA [SHLWAPI]
|
||||
*/
|
||||
LONG WINAPI SHRegQueryUSValueA(
|
||||
HKEY/*HUSKEY*/ hUSKey,
|
||||
LPCSTR pszValue,
|
||||
LPDWORD pdwType,
|
||||
void *pvData,
|
||||
LPDWORD pcbData,
|
||||
BOOL fIgnoreHKCU,
|
||||
void *pvDefaultData,
|
||||
DWORD dwDefaultDataSize)
|
||||
{
|
||||
FIXME("%s stub\n",pszValue);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetPathA [SHLWAPI.@]
|
||||
*/
|
||||
DWORD WINAPI SHRegGetPathA(
|
||||
HKEY hKey,
|
||||
LPCSTR pcszSubKey,
|
||||
LPCSTR pcszValue,
|
||||
LPSTR pszPath,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("%s %s\n", pcszSubKey, pcszValue);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHRegGetPathW [SHLWAPI.@]
|
||||
*/
|
||||
DWORD WINAPI SHRegGetPathW(
|
||||
HKEY hKey,
|
||||
LPCWSTR pcszSubKey,
|
||||
LPCWSTR pcszValue,
|
||||
LPWSTR pszPath,
|
||||
DWORD dwFlags)
|
||||
{
|
||||
FIXME("%s %s\n", debugstr_w(pcszSubKey), debugstr_w(pcszValue));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetValueA [SHLWAPI.@]
|
||||
*
|
||||
* Gets a value from the registry
|
||||
*/
|
||||
DWORD WINAPI SHGetValueA(
|
||||
HKEY hkey,
|
||||
LPCSTR pSubKey,
|
||||
LPCSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData)
|
||||
{
|
||||
HKEY hSubKey;
|
||||
DWORD res;
|
||||
|
||||
TRACE("(%s %s)\n", pSubKey, pValue);
|
||||
|
||||
if((res = RegOpenKeyA(hkey, pSubKey, &hSubKey))) return res;
|
||||
res = RegQueryValueExA(hSubKey, pValue, 0, pwType, pvData, pbData);
|
||||
RegCloseKey( hSubKey );
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHGetValueW [SHLWAPI.@]
|
||||
*
|
||||
* Gets a value from the registry
|
||||
*/
|
||||
DWORD WINAPI SHGetValueW(
|
||||
HKEY hkey,
|
||||
LPCWSTR pSubKey,
|
||||
LPCWSTR pValue,
|
||||
LPDWORD pwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pbData)
|
||||
{
|
||||
HKEY hSubKey;
|
||||
DWORD res;
|
||||
|
||||
TRACE("(%s %s)\n", debugstr_w(pSubKey), debugstr_w(pValue));
|
||||
|
||||
if((res = RegOpenKeyW(hkey, pSubKey, &hSubKey))) return res;
|
||||
res = RegQueryValueExW(hSubKey, pValue, 0, pwType, pvData, pbData);
|
||||
RegCloseKey( hSubKey );
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHSetValueA [SHLWAPI.@]
|
||||
*/
|
||||
DWORD WINAPI SHSetValueA(
|
||||
HKEY hkey,
|
||||
LPCSTR pszSubKey,
|
||||
LPCSTR pszValue,
|
||||
DWORD dwType,
|
||||
LPCVOID pvData,
|
||||
DWORD cbData)
|
||||
{
|
||||
FIXME("(%s %s)stub\n",pszSubKey, pszValue);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHQueryValueExA [SHLWAPI.@]
|
||||
*
|
||||
*/
|
||||
HRESULT WINAPI SHQueryValueExA(
|
||||
HKEY hkey,
|
||||
LPSTR lpValueName,
|
||||
LPDWORD lpReserved,
|
||||
LPDWORD lpType,
|
||||
LPBYTE lpData,
|
||||
LPDWORD lpcbData)
|
||||
{
|
||||
TRACE("0x%04x %s %p %p %p %p\n", hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
|
||||
return RegQueryValueExA (hkey, lpValueName, lpReserved, lpType, lpData, lpcbData);
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************
|
||||
* SHQueryValueExW [SHLWAPI.@]
|
||||
*
|
||||
* FIXME
|
||||
* if the datatype REG_EXPAND_SZ then expand the string and change
|
||||
* *pdwType to REG_SZ.
|
||||
*/
|
||||
HRESULT WINAPI SHQueryValueExW (
|
||||
HKEY hkey,
|
||||
LPWSTR pszValue,
|
||||
LPDWORD pdwReserved,
|
||||
LPDWORD pdwType,
|
||||
LPVOID pvData,
|
||||
LPDWORD pcbData)
|
||||
{
|
||||
WARN("0x%04x %s %p %p %p %p semi-stub\n",
|
||||
hkey, debugstr_w(pszValue), pdwReserved, pdwType, pvData, pcbData);
|
||||
return RegQueryValueExW ( hkey, pszValue, pdwReserved, pdwType, pvData, pcbData);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHDeleteKeyA [SHLWAPI.@]
|
||||
*/
|
||||
HRESULT WINAPI SHDeleteKeyA(
|
||||
HKEY hkey,
|
||||
LPCSTR pszSubKey)
|
||||
{
|
||||
FIXME("hkey=0x%08x, %s\n", hkey, debugstr_a(pszSubKey));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* SHDeleteKeyW [SHLWAPI.@]
|
||||
*/
|
||||
HRESULT WINAPI SHDeleteKeyW(
|
||||
HKEY hkey,
|
||||
LPCWSTR pszSubKey)
|
||||
{
|
||||
FIXME("hkey=0x%08x, %s\n", hkey, debugstr_w(pszSubKey));
|
||||
return 0;
|
||||
}
|
|
@ -3,16 +3,14 @@
|
|||
*/
|
||||
#include <string.h>
|
||||
|
||||
#include "wine/obj_storage.h"
|
||||
|
||||
#include "debugtools.h"
|
||||
#include "heap.h"
|
||||
#include "winerror.h"
|
||||
#include "winreg.h"
|
||||
#include "wine/obj_storage.h"
|
||||
|
||||
#include "shell32_main.h"
|
||||
#include "heap.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(shell)
|
||||
DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
typedef struct
|
||||
{ ICOM_VFIELD(IStream);
|
||||
|
@ -28,7 +26,7 @@ static struct ICOM_VTABLE(IStream) rstvt;
|
|||
/**************************************************************************
|
||||
* IStream_ConstructorA [internal]
|
||||
*/
|
||||
IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode)
|
||||
static IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWORD grfMode)
|
||||
{
|
||||
ISHRegStream* rstr;
|
||||
DWORD dwType;
|
||||
|
@ -49,7 +47,6 @@ IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWOR
|
|||
{
|
||||
if (dwType == REG_BINARY )
|
||||
{
|
||||
shell32_ObjCount++;
|
||||
TRACE ("%p\n", rstr);
|
||||
return (IStream*)rstr;
|
||||
}
|
||||
|
@ -66,7 +63,7 @@ IStream *IStream_ConstructorA(HKEY hKey, LPCSTR pszSubKey, LPCSTR pszValue, DWOR
|
|||
/**************************************************************************
|
||||
* IStream_ConstructorW [internal]
|
||||
*/
|
||||
IStream *IStream_ConstructorW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD grfMode)
|
||||
static IStream *IStream_ConstructorW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DWORD grfMode)
|
||||
{
|
||||
ISHRegStream* rstr;
|
||||
DWORD dwType;
|
||||
|
@ -87,7 +84,6 @@ IStream *IStream_ConstructorW(HKEY hKey, LPCWSTR pszSubKey, LPCWSTR pszValue, DW
|
|||
{
|
||||
if (dwType == REG_BINARY )
|
||||
{
|
||||
shell32_ObjCount++;
|
||||
TRACE ("%p\n", rstr);
|
||||
return (IStream*)rstr;
|
||||
}
|
||||
|
@ -138,7 +134,6 @@ static ULONG WINAPI IStream_fnAddRef(IStream *iface)
|
|||
|
||||
TRACE("(%p)->(count=%lu)\n",This, This->ref);
|
||||
|
||||
shell32_ObjCount++;
|
||||
return ++(This->ref);
|
||||
}
|
||||
|
||||
|
@ -151,8 +146,6 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface)
|
|||
|
||||
TRACE("(%p)->()\n",This);
|
||||
|
||||
shell32_ObjCount--;
|
||||
|
||||
if (!--(This->ref))
|
||||
{ TRACE(" destroying SHReg IStream (%p)\n",This);
|
||||
|
||||
|
@ -168,7 +161,7 @@ static ULONG WINAPI IStream_fnRelease(IStream *iface)
|
|||
return This->ref;
|
||||
}
|
||||
|
||||
HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRead)
|
||||
static HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRead)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -195,7 +188,7 @@ HRESULT WINAPI IStream_fnRead (IStream * iface, void* pv, ULONG cb, ULONG* pcbRe
|
|||
|
||||
return S_OK;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten)
|
||||
static HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG* pcbWritten)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -203,7 +196,7 @@ HRESULT WINAPI IStream_fnWrite (IStream * iface, const void* pv, ULONG cb, ULONG
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition)
|
||||
static HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER* plibNewPosition)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -211,7 +204,7 @@ HRESULT WINAPI IStream_fnSeek (IStream * iface, LARGE_INTEGER dlibMove, DWORD dw
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize)
|
||||
static HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -219,7 +212,7 @@ HRESULT WINAPI IStream_fnSetSize (IStream * iface, ULARGE_INTEGER libNewSize)
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
|
||||
static HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER cb, ULARGE_INTEGER* pcbRead, ULARGE_INTEGER* pcbWritten)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -227,7 +220,7 @@ HRESULT WINAPI IStream_fnCopyTo (IStream * iface, IStream* pstm, ULARGE_INTEGER
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags)
|
||||
static HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -235,7 +228,7 @@ HRESULT WINAPI IStream_fnCommit (IStream * iface, DWORD grfCommitFlags)
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnRevert (IStream * iface)
|
||||
static HRESULT WINAPI IStream_fnRevert (IStream * iface)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -243,7 +236,7 @@ HRESULT WINAPI IStream_fnRevert (IStream * iface)
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnLockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
|
||||
static HRESULT WINAPI IStream_fnLockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -251,7 +244,7 @@ HRESULT WINAPI IStream_fnLockRegion (IStream * iface, ULARGE_INTEGER libOffset,
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnUnlockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
|
||||
static HRESULT WINAPI IStream_fnUnlockRegion (IStream * iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -259,7 +252,7 @@ HRESULT WINAPI IStream_fnUnlockRegion (IStream * iface, ULARGE_INTEGER libOffset
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfStatFlag)
|
||||
static HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfStatFlag)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -267,7 +260,7 @@ HRESULT WINAPI IStream_fnStat (IStream * iface, STATSTG* pstatstg, DWORD grfSt
|
|||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm)
|
||||
static HRESULT WINAPI IStream_fnClone (IStream * iface, IStream** ppstm)
|
||||
{
|
||||
ICOM_THIS(ISHRegStream, iface);
|
||||
|
||||
|
@ -297,7 +290,7 @@ static struct ICOM_VTABLE(IStream) rstvt =
|
|||
};
|
||||
|
||||
/*************************************************************************
|
||||
* SHOpenRegStreamA [SHLWAPI.@][SHELL32.85]
|
||||
* SHOpenRegStreamA [SHLWAPI.@]
|
||||
*/
|
||||
IStream * WINAPI SHOpenRegStreamA(
|
||||
HKEY hkey,
|
|
@ -2,6 +2,10 @@ name shlwapi
|
|||
type win32
|
||||
init SHLWAPI_LibMain
|
||||
|
||||
import advapi32
|
||||
import user32
|
||||
import kernel32
|
||||
|
||||
1 stdcall @(ptr ptr) SHLWAPI_1
|
||||
2 stub @
|
||||
3 stub @
|
||||
|
@ -555,8 +559,8 @@ init SHLWAPI_LibMain
|
|||
@ stdcall SHCreateShellPalette(long)SHCreateShellPalette
|
||||
@ stub SHDeleteEmptyKeyA
|
||||
@ stub SHDeleteEmptyKeyW
|
||||
@ stdcall SHDeleteKeyA(long str)SHRegDeleteKeyA
|
||||
@ stdcall SHDeleteKeyW(long wstr)SHRegDeleteKeyW
|
||||
@ stdcall SHDeleteKeyA(long str) SHDeleteKeyA
|
||||
@ stdcall SHDeleteKeyW(long wstr) SHDeleteKeyW
|
||||
@ stub SHDeleteOrphanKeyA
|
||||
@ stub SHDeleteOrphanKeyW
|
||||
@ stub SHDeleteValueA
|
||||
|
@ -575,8 +579,8 @@ init SHLWAPI_LibMain
|
|||
@ stdcall SHOpenRegStream2W(long wstr str long)SHOpenRegStreamW
|
||||
@ stub SHQueryInfoKeyA
|
||||
@ stub SHQueryInfoKeyW
|
||||
@ stdcall SHQueryValueExA(long str ptr ptr ptr ptr)SHRegQueryValueExA
|
||||
@ stdcall SHQueryValueExW(long wstr ptr ptr ptr ptr)SHRegQueryValueExW
|
||||
@ stdcall SHQueryValueExA(long str ptr ptr ptr ptr) SHQueryValueExA
|
||||
@ stdcall SHQueryValueExW(long wstr ptr ptr ptr ptr) SHQueryValueExW
|
||||
@ stub SHRegCloseUSKey
|
||||
@ stub SHRegCreateUSKeyA
|
||||
@ stub SHRegCreateUSKeyW
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include "winbase.h"
|
||||
#include "winerror.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
@ -29,3 +30,39 @@ BOOL WINAPI SHLWAPI_LibMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID fImpLoad
|
|||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllGetVersion [SHLWAPI]
|
||||
*
|
||||
* Retrieves version information of the 'SHLWAPI.DLL'
|
||||
*
|
||||
* PARAMS
|
||||
* pdvi [O] pointer to version information structure.
|
||||
*
|
||||
* RETURNS
|
||||
* Success: S_OK
|
||||
* Failure: E_INVALIDARG
|
||||
*
|
||||
* NOTES
|
||||
* Returns version of a SHLWAPI.dll from IE5.01.
|
||||
*/
|
||||
|
||||
HRESULT WINAPI SHLWAPI_DllGetVersion (DLLVERSIONINFO *pdvi)
|
||||
{
|
||||
if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
|
||||
{
|
||||
WARN("wrong DLLVERSIONINFO size from app");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
pdvi->dwMajorVersion = 5;
|
||||
pdvi->dwMinorVersion = 0;
|
||||
pdvi->dwBuildNumber = 2314;
|
||||
pdvi->dwPlatformID = 1000;
|
||||
|
||||
TRACE("%lu.%lu.%lu.%lu\n",
|
||||
pdvi->dwMajorVersion, pdvi->dwMinorVersion,
|
||||
pdvi->dwBuildNumber, pdvi->dwPlatformID);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,413 @@
|
|||
#include <ctype.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "winerror.h"
|
||||
#include "wine/undocshell.h"
|
||||
#include "wine/unicode.h"
|
||||
#include "heap.h"
|
||||
#include "debugtools.h"
|
||||
|
||||
DEFAULT_DEBUG_CHANNEL(shell);
|
||||
|
||||
/*************************************************************************
|
||||
* StrChrA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrChrA (LPCSTR str, INT c)
|
||||
{
|
||||
TRACE("%s %i\n", str,c);
|
||||
return strchr(str, c);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrChrW [SHLWAPI]
|
||||
*
|
||||
*/
|
||||
LPWSTR WINAPI StrChrW (LPWSTR str, WCHAR x )
|
||||
{
|
||||
TRACE("%s 0x%04x\n",debugstr_w(str),x);
|
||||
return strchrW(str, x);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCmpNA [SHLWAPI]
|
||||
*/
|
||||
INT WINAPI StrCmpNA ( LPCSTR str1, LPCSTR str2, INT len)
|
||||
{
|
||||
TRACE("%s %s %i stub\n", str1,str2,len);
|
||||
return strncmp(str1, str2, len);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCmpNW [SHLWAPI]
|
||||
*/
|
||||
INT WINAPI StrCmpNW ( LPCWSTR wstr1, LPCWSTR wstr2, INT len)
|
||||
{
|
||||
TRACE("%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
|
||||
return strncmpW(wstr1, wstr2, len);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCmpNIA [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrCmpNIA ( LPCSTR str1, LPCSTR str2, int len)
|
||||
{
|
||||
TRACE("%s %s %i stub\n", str1,str2,len);
|
||||
return strncasecmp(str1, str2, len);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCmpNIW [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrCmpNIW ( LPCWSTR wstr1, LPCWSTR wstr2, int len)
|
||||
{
|
||||
TRACE("%s %s %i stub\n", debugstr_w(wstr1),debugstr_w(wstr2),len);
|
||||
return strncmpiW(wstr1, wstr2, len);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrStrA(LPCSTR lpFirst, LPCSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
|
||||
if (!*p2) return (LPSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrStrW(LPCWSTR lpFirst, LPCWSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCWSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && *p1 == *p2) { p1++; p2++; }
|
||||
if (!*p2) return (LPWSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrIA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrStrIA(LPCSTR lpFirst, LPCSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && toupper(*p1) == toupper(*p2)) { p1++; p2++; }
|
||||
if (!*p2) return (LPSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrStrIW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrStrIW(LPCWSTR lpFirst, LPCWSTR lpSrch)
|
||||
{
|
||||
while (*lpFirst)
|
||||
{
|
||||
LPCWSTR p1 = lpFirst, p2 = lpSrch;
|
||||
while (*p1 && *p2 && toupperW(*p1) == toupperW(*p2)) { p1++; p2++; }
|
||||
if (!*p2) return (LPWSTR)lpFirst;
|
||||
lpFirst++;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrToIntA [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrToIntA(LPCSTR lpSrc)
|
||||
{
|
||||
TRACE("%s\n", lpSrc);
|
||||
return atol(lpSrc);
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrToIntW [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrToIntW(LPCWSTR lpSrc)
|
||||
{
|
||||
int ret;
|
||||
LPSTR lpStr = HEAP_strdupWtoA(GetProcessHeap(),0,lpSrc);
|
||||
|
||||
TRACE("%s\n", debugstr_w(lpSrc));
|
||||
|
||||
ret = atol(lpStr);
|
||||
HeapFree(GetProcessHeap(),0,lpStr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrDupA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrDupA (LPCSTR lpSrc)
|
||||
{
|
||||
int len = strlen(lpSrc);
|
||||
LPSTR lpDest = (LPSTR) LocalAlloc(LMEM_FIXED, len+1);
|
||||
|
||||
TRACE("%s\n", lpSrc);
|
||||
|
||||
if (lpDest) strcpy(lpDest, lpSrc);
|
||||
return lpDest;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrDupW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrDupW (LPCWSTR lpSrc)
|
||||
{
|
||||
int len = lstrlenW(lpSrc);
|
||||
LPWSTR lpDest = (LPWSTR) LocalAlloc(LMEM_FIXED, sizeof(WCHAR) * (len+1));
|
||||
|
||||
TRACE("%s\n", debugstr_w(lpSrc));
|
||||
|
||||
if (lpDest) lstrcpyW(lpDest, lpSrc);
|
||||
return lpDest;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCSpnA [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrCSpnA (LPCSTR lpStr, LPCSTR lpSet)
|
||||
{
|
||||
int i,j, pos = strlen(lpStr);
|
||||
|
||||
TRACE("(%p %s %p %s)\n",
|
||||
lpStr, debugstr_a(lpStr), lpSet, debugstr_a(lpSet));
|
||||
|
||||
for (i=0; i < strlen(lpSet) ; i++ )
|
||||
{
|
||||
for (j = 0; j < pos;j++)
|
||||
{
|
||||
if (lpStr[j] == lpSet[i])
|
||||
{
|
||||
pos = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE("-- %u\n", pos);
|
||||
return pos;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCSpnW [SHLWAPI]
|
||||
*/
|
||||
int WINAPI StrCSpnW (LPCWSTR lpStr, LPCWSTR lpSet)
|
||||
{
|
||||
int i,j, pos = lstrlenW(lpStr);
|
||||
|
||||
TRACE("(%p %s %p %s)\n",
|
||||
lpStr, debugstr_w(lpStr), lpSet, debugstr_w(lpSet));
|
||||
|
||||
for (i=0; i < lstrlenW(lpSet) ; i++ )
|
||||
{
|
||||
for (j = 0; j < pos;j++)
|
||||
{
|
||||
if (lpStr[j] == lpSet[i])
|
||||
{
|
||||
pos = j;
|
||||
}
|
||||
}
|
||||
}
|
||||
TRACE("-- %u\n", pos);
|
||||
return pos;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCatBuffA [SHLWAPI]
|
||||
*
|
||||
* Appends back onto front, stopping when front is size-1 characters long.
|
||||
* Returns front.
|
||||
*
|
||||
*/
|
||||
LPSTR WINAPI StrCatBuffA(LPSTR front, LPCSTR back, INT size)
|
||||
{
|
||||
LPSTR dst = front + lstrlenA(front);
|
||||
LPCSTR src = back, end = front + size - 1;
|
||||
|
||||
while(dst < end && *src)
|
||||
*dst++ = *src++;
|
||||
*dst = '\0';
|
||||
return front;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrCatBuffW [SHLWAPI]
|
||||
*
|
||||
* Appends back onto front, stopping when front is size-1 characters long.
|
||||
* Returns front.
|
||||
*
|
||||
*/
|
||||
LPWSTR WINAPI StrCatBuffW(LPWSTR front, LPCWSTR back, INT size)
|
||||
{
|
||||
LPWSTR dst = front + lstrlenW(front);
|
||||
LPCWSTR src = back, end = front + size - 1;
|
||||
|
||||
while(dst < end && *src)
|
||||
*dst++ = *src++;
|
||||
*dst = '\0';
|
||||
return front;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrRetToBufA [SHLWAPI.@]
|
||||
*
|
||||
* converts a STRRET to a normal string
|
||||
*
|
||||
* NOTES
|
||||
* the pidl is for STRRET OFFSET
|
||||
*/
|
||||
HRESULT WINAPI StrRetToBufA (LPSTRRET src, LPITEMIDLIST pidl, LPSTR dest, DWORD len)
|
||||
{
|
||||
TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
|
||||
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
WideCharToMultiByte(CP_ACP, 0, src->u.pOleStr, -1, (LPSTR)dest, len, NULL, NULL);
|
||||
/* SHFree(src->u.pOleStr); FIXME: is this right? */
|
||||
break;
|
||||
|
||||
case STRRET_CSTRA:
|
||||
lstrcpynA((LPSTR)dest, src->u.cStr, len);
|
||||
break;
|
||||
|
||||
case STRRET_OFFSETA:
|
||||
lstrcpynA((LPSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len)
|
||||
{
|
||||
*(LPSTR)dest = '\0';
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrRetToBufW [SHLWAPI.@]
|
||||
*
|
||||
* converts a STRRET to a normal string
|
||||
*
|
||||
* NOTES
|
||||
* the pidl is for STRRET OFFSET
|
||||
*/
|
||||
HRESULT WINAPI StrRetToBufW (LPSTRRET src, LPITEMIDLIST pidl, LPWSTR dest, DWORD len)
|
||||
{
|
||||
TRACE("dest=0x%p len=0x%lx strret=0x%p pidl=%p stub\n",dest,len,src,pidl);
|
||||
|
||||
switch (src->uType)
|
||||
{
|
||||
case STRRET_WSTR:
|
||||
lstrcpynW((LPWSTR)dest, src->u.pOleStr, len);
|
||||
/* SHFree(src->u.pOleStr); FIXME: is this right? */
|
||||
break;
|
||||
|
||||
case STRRET_CSTRA:
|
||||
lstrcpynAtoW((LPWSTR)dest, src->u.cStr, len);
|
||||
break;
|
||||
|
||||
case STRRET_OFFSETA:
|
||||
if (pidl)
|
||||
{
|
||||
lstrcpynAtoW((LPWSTR)dest, ((LPCSTR)&pidl->mkid)+src->u.uOffset, len);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
FIXME("unknown type!\n");
|
||||
if (len)
|
||||
{ *(LPSTR)dest = '\0';
|
||||
}
|
||||
return(FALSE);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrFormatByteSizeA [SHLWAPI]
|
||||
*/
|
||||
LPSTR WINAPI StrFormatByteSizeA ( DWORD dw, LPSTR pszBuf, UINT cchBuf )
|
||||
{ char buf[64];
|
||||
TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
|
||||
if ( dw<1024L )
|
||||
{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
|
||||
}
|
||||
else if ( dw<1048576L)
|
||||
{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
|
||||
}
|
||||
else if ( dw < 1073741824L)
|
||||
{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
|
||||
}
|
||||
else
|
||||
{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
|
||||
}
|
||||
lstrcpynA (pszBuf, buf, cchBuf);
|
||||
return pszBuf;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* StrFormatByteSizeW [SHLWAPI]
|
||||
*/
|
||||
LPWSTR WINAPI StrFormatByteSizeW ( DWORD dw, LPWSTR pszBuf, UINT cchBuf )
|
||||
{ char buf[64];
|
||||
TRACE("%lx %p %i\n", dw, pszBuf, cchBuf);
|
||||
if ( dw<1024L )
|
||||
{ sprintf (buf,"%3.1f bytes", (FLOAT)dw);
|
||||
}
|
||||
else if ( dw<1048576L)
|
||||
{ sprintf (buf,"%3.1f KB", (FLOAT)dw/1024);
|
||||
}
|
||||
else if ( dw < 1073741824L)
|
||||
{ sprintf (buf,"%3.1f MB", (FLOAT)dw/1048576L);
|
||||
}
|
||||
else
|
||||
{ sprintf (buf,"%3.1f GB", (FLOAT)dw/1073741824L);
|
||||
}
|
||||
lstrcpynAtoW (pszBuf, buf, cchBuf);
|
||||
return pszBuf;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* wnsprintfA [SHLWAPI]
|
||||
*/
|
||||
int WINAPIV wnsprintfA(LPSTR lpOut, int cchLimitIn, LPCSTR lpFmt, ...)
|
||||
{
|
||||
va_list valist;
|
||||
INT res;
|
||||
|
||||
va_start( valist, lpFmt );
|
||||
res = wvsnprintfA( lpOut, cchLimitIn, lpFmt, valist );
|
||||
va_end( valist );
|
||||
return res;
|
||||
}
|
||||
|
||||
/*************************************************************************
|
||||
* wnsprintfW [SHLWAPI]
|
||||
*/
|
||||
int WINAPIV wnsprintfW(LPWSTR lpOut, int cchLimitIn, LPCWSTR lpFmt, ...)
|
||||
{
|
||||
va_list valist;
|
||||
INT res;
|
||||
|
||||
va_start( valist, lpFmt );
|
||||
res = wvsnprintfW( lpOut, cchLimitIn, lpFmt, valist );
|
||||
va_end( valist );
|
||||
return res;
|
||||
}
|
Loading…
Reference in New Issue