24#define NONAMELESSUNION
31#define NO_SHLWAPI_PATH
37#define STGM_ACCESS_MODE(stgm) ((stgm)&0x0000f)
38#define STGM_SHARE_MODE(stgm) ((stgm)&0x000f0)
39#define STGM_CREATE_MODE(stgm) ((stgm)&0x0f000)
75 IStream_AddRef(iface);
90 TRACE(
"(%p)->(ref before=%u)\n",
This, refCount - 1);
103 TRACE(
"(%p)->(ref before=%u)\n",
This, refCount + 1);
124 TRACE(
"(%p,%p,0x%08x,%p)\n",
This, pv,
cb, pcbRead);
144 TRACE(
"(%p,%p,0x%08x,%p)\n",
This, pv,
cb, pcbWritten);
159 *pcbWritten = dwWritten;
172 TRACE(
"(%p,%d,%d,%p)\n",
This, dlibMove.
u.LowPart, dwOrigin, pNewPos);
181 pNewPos->
u.HighPart = 0;
182 pNewPos->
u.LowPart = dwPos;
194 TRACE(
"(%p,%d)\n",
This, libNewSize.
u.LowPart);
217 TRACE(
"(%p,%p,%d,%p,%p)\n",
This, pstm,
cb.u.LowPart, pcbRead, pcbWritten);
230 ulSize =
cb.QuadPart;
233 ULONG ulLeft, ulRead, ulWritten;
235 ulLeft = ulSize >
sizeof(copyBuff) ?
sizeof(copyBuff) : ulSize;
239 if (
FAILED(hRet) || ulRead == 0)
248 if (
FAILED(hRet) || ulWritten != ulLeft)
263 TRACE(
"(%p,%d)\n",
This, grfCommitFlags);
286 TRACE(
"(%p,%d,%d,%d)\n",
This, libOffset.
u.LowPart,
cb.u.LowPart, dwLockType);
299 TRACE(
"(%p,%p,%d)\n",
This, lpStat, grfStatFlag);
304 memset(&fi, 0,
sizeof(fi));
307 if (grfStatFlag & STATFLAG_NONAME)
308 lpStat->pwcsName =
NULL;
311 lpStat->type =
This->type;
317 lpStat->grfMode =
This->dwMode;
318 lpStat->grfLocksSupported = 0;
319 memcpy(&lpStat->clsid, &IID_IStream,
sizeof(
CLSID));
320 lpStat->grfStateBits =
This->grfStateBits;
321 lpStat->reserved = 0;
367 if (!fileStream)
return NULL;
372 fileStream->
dwMode = dwMode;
374 fileStream->
type = 0;
377 TRACE (
"Returning %p\n", fileStream);
405 DWORD dwAccess, dwShare, dwCreate;
411 if (!lpszPath || !lppStream || lpTemplate)
489 if (!lpszPath || !lppStream)
546 TRACE(
"(%p,%p,%d)\n", lpStream, lpvDest, ulSize);
548 hRet = IStream_Read(lpStream, lpvDest, ulSize, &ulRead);
572 TRACE(
"(%p)\n", lpStream);
574 memset(&statstg, 0,
sizeof(statstg));
576 if(
SUCCEEDED(IStream_Stat(lpStream, &statstg, 1)))
578 if(statstg.cbSize.QuadPart)
591 IStream_Seek(lpStream,
zero, 0,
NULL);
618 TRACE(
"(%p,%p,%d)\n", lpStream, lpvSrc, ulSize);
620 hRet = IStream_Write(lpStream, lpvSrc, ulSize, &ulWritten);
622 if (
SUCCEEDED(hRet) && ulWritten != ulSize)
643 TRACE(
"(%p)\n", lpStream);
645 return IStream_Seek(lpStream,
zero, 0,
NULL);
666 TRACE(
"(%p,%p)\n", lpStream, lpulSize);
668 memset(&statstg, 0,
sizeof(statstg));
670 hRet = IStream_Stat(lpStream, &statstg, 1);
673 *lpulSize = statstg.cbSize;
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
void shell(int argc, const char *argv[])
#define INVALID_SET_FILE_POINTER
#define ReadFile(a, b, c, d, e)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
#define MultiByteToWideChar
BOOL WINAPI GetFileInformationByHandle(HANDLE hFile, LPBY_HANDLE_FILE_INFORMATION lpFileInformation)
BOOL WINAPI SetEndOfFile(HANDLE hFile)
BOOL WINAPI WriteFile(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, OUT LPDWORD lpNumberOfBytesWritten, IN LPOVERLAPPED lpOverlapped OPTIONAL)
static HRESULT WINAPI IStream_fnSetSize(IStream *iface, ULARGE_INTEGER libNewSize)
HRESULT WINAPI IStream_Size(IStream *lpStream, ULARGE_INTEGER *lpulSize)
static const IStreamVtbl SHLWAPI_fsVTable
static IStream * IStream_Create(LPCWSTR lpszPath, HANDLE hFile, DWORD dwMode)
static HRESULT WINAPI IStream_fnCopyTo(IStream *iface, IStream *pstm, ULARGE_INTEGER cb, ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
#define STGM_CREATE_MODE(stgm)
static HRESULT WINAPI IStream_fnQueryInterface(IStream *iface, REFIID riid, LPVOID *ppvObj)
static HRESULT WINAPI IStream_fnStat(IStream *iface, STATSTG *lpStat, DWORD grfStatFlag)
HRESULT WINAPI IStream_Reset(IStream *lpStream)
static HRESULT WINAPI IStream_fnWrite(IStream *iface, const void *pv, ULONG cb, ULONG *pcbWritten)
HRESULT WINAPI SHCreateStreamOnFileA(LPCSTR lpszPath, DWORD dwMode, IStream **lppStream)
static ULONG WINAPI IStream_fnRelease(IStream *iface)
BOOL WINAPI SHIsEmptyStream(IStream *lpStream)
static HRESULT WINAPI IStream_fnCommit(IStream *, DWORD)
#define STGM_SHARE_MODE(stgm)
static HRESULT WINAPI IStream_fnRevert(IStream *iface)
static HRESULT WINAPI IStream_fnSeek(IStream *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *pNewPos)
static HRESULT WINAPI IStream_fnLockUnlockRegion(IStream *iface, ULARGE_INTEGER libOffset, ULARGE_INTEGER cb, DWORD dwLockType)
HRESULT WINAPI SHCreateStreamOnFileEx(LPCWSTR lpszPath, DWORD dwMode, DWORD dwAttributes, BOOL bCreate, IStream *lpTemplate, IStream **lppStream)
#define STGM_ACCESS_MODE(stgm)
HRESULT WINAPI SHCreateStreamOnFileW(LPCWSTR lpszPath, DWORD dwMode, IStream **lppStream)
HRESULT WINAPI SHIStream_Write(IStream *lpStream, LPCVOID lpvSrc, ULONG ulSize)
static HRESULT WINAPI IStream_fnRead(IStream *iface, void *pv, ULONG cb, ULONG *pcbRead)
HRESULT WINAPI SHIStream_Read(IStream *lpStream, LPVOID lpvDest, ULONG ulSize)
static HRESULT WINAPI IStream_fnClone(IStream *iface, IStream **ppstm)
static ISHFileStream * impl_from_IStream(IStream *iface)
static ULONG WINAPI IStream_fnAddRef(IStream *iface)
LPWSTR WINAPI StrDupW(LPCWSTR lpszStr)
HLOCAL NTAPI LocalFree(HLOCAL hMem)
#define memcpy(s1, s2, n)
static HMODULE MODULEINFO DWORD cb
#define STGM_SHARE_DENY_NONE
#define STGM_SHARE_EXCLUSIVE
#define STGM_DELETEONRELEASE
#define STGM_SHARE_DENY_WRITE
#define STGM_SHARE_DENY_READ
#define IsEqualIID(riid1, riid2)
_In_ int _In_ BOOL bCreate
struct _ULARGE_INTEGER::@4142 u
#define CONTAINING_RECORD(address, type, field)
struct _LARGE_INTEGER::@2304 u
DWORD WINAPI GetLastError(void)
#define STG_E_INVALIDPOINTER
#define ERROR_PATH_NOT_FOUND
#define STG_E_ACCESSDENIED
#define HRESULT_FROM_WIN32(x)