Implemented GetCompressedFileSize[AW].

This commit is contained in:
Pavel Roskin 2003-10-03 03:31:46 +00:00 committed by Alexandre Julliard
parent d65071963e
commit c8160055e8
2 changed files with 59 additions and 31 deletions

View File

@ -987,6 +987,65 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes)
}
/******************************************************************************
* GetCompressedFileSizeA [KERNEL32.@]
*/
DWORD WINAPI GetCompressedFileSizeA(
LPCSTR lpFileName,
LPDWORD lpFileSizeHigh)
{
UNICODE_STRING filenameW;
DWORD ret;
if (RtlCreateUnicodeStringFromAsciiz(&filenameW, lpFileName))
{
ret = GetCompressedFileSizeW(filenameW.Buffer, lpFileSizeHigh);
RtlFreeUnicodeString(&filenameW);
}
else
{
ret = INVALID_FILE_SIZE;
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
}
return ret;
}
/******************************************************************************
* GetCompressedFileSizeW [KERNEL32.@]
*
* RETURNS
* Success: Low-order doubleword of number of bytes
* Failure: INVALID_FILE_SIZE
*/
DWORD WINAPI GetCompressedFileSizeW(
LPCWSTR lpFileName, /* [in] Pointer to name of file */
LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
{
DOS_FULL_NAME full_name;
struct stat st;
DWORD low;
TRACE("(%s,%p)\n",debugstr_w(lpFileName),lpFileSizeHigh);
if (!DOSFS_GetFullName( lpFileName, TRUE, &full_name )) return INVALID_FILE_SIZE;
if (stat(full_name.long_name, &st) != 0)
{
FILE_SetDosError();
return INVALID_FILE_SIZE;
}
#if HAVE_STRUCT_STAT_ST_BLOCKS
/* blocks are 512 bytes long */
if (lpFileSizeHigh) *lpFileSizeHigh = (st.st_blocks >> 23);
low = (DWORD)(st.st_blocks << 9);
#else
if (lpFileSizeHigh) *lpFileSizeHigh = (st.st_size >> 32);
low = (DWORD)st.st_size;
#endif
return low;
}
/***********************************************************************
* GetFileTime (KERNEL32.@)
*/

View File

@ -45,37 +45,6 @@ at a later date. */
WINE_DEFAULT_DEBUG_CHANNEL(win32);
/******************************************************************************
* GetCompressedFileSizeA [KERNEL32.@]
*
* NOTES
* This should call the W function below
*/
DWORD WINAPI GetCompressedFileSizeA(
LPCSTR lpFileName,
LPDWORD lpFileSizeHigh)
{
FIXME("(...): stub\n");
return 0xffffffff;
}
/******************************************************************************
* GetCompressedFileSizeW [KERNEL32.@]
*
* RETURNS
* Success: Low-order doubleword of number of bytes
* Failure: 0xffffffff
*/
DWORD WINAPI GetCompressedFileSizeW(
LPCWSTR lpFileName, /* [in] Pointer to name of file */
LPDWORD lpFileSizeHigh) /* [out] Receives high-order doubleword of size */
{
FIXME("(%s,%p): stub\n",debugstr_w(lpFileName),lpFileSizeHigh);
return 0xffffffff;
}
/******************************************************************************
* CreateIoCompletionPort (KERNEL32.@)
*/