Commit c8160055 authored by Pavel Roskin's avatar Pavel Roskin Committed by Alexandre Julliard

Implemented GetCompressedFileSize[AW].

parent d6507196
...@@ -987,6 +987,65 @@ BOOL WINAPI SetFileAttributesA(LPCSTR lpFileName, DWORD attributes) ...@@ -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.@) * GetFileTime (KERNEL32.@)
*/ */
......
...@@ -46,37 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(win32); ...@@ -46,37 +46,6 @@ 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.@) * CreateIoCompletionPort (KERNEL32.@)
*/ */
HANDLE WINAPI CreateIoCompletionPort(HANDLE hFileHandle, HANDLE WINAPI CreateIoCompletionPort(HANDLE hFileHandle,
......
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