gdiplus: Added GdipCreateStreamOnFile.

This commit is contained in:
Evan Stade 2007-08-07 18:42:00 -07:00 committed by Alexandre Julliard
parent 7a9a30d95c
commit 3ea77f5cfd
6 changed files with 45 additions and 2 deletions

View file

@ -4,7 +4,7 @@ SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = gdiplus.dll
IMPORTLIB = libgdiplus.$(IMPLIBEXT)
IMPORTS = oleaut32 ole32 user32 gdi32 advapi32 kernel32 ntdll
IMPORTS = shlwapi oleaut32 ole32 user32 gdi32 advapi32 kernel32 ntdll
EXTRALIBS = -luuid
C_SRCS = \

View file

@ -27,6 +27,9 @@
#include "objbase.h"
#include "winreg.h"
#include "shlwapi.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
@ -246,3 +249,17 @@ REAL gdiplus_atan2(REAL dy, REAL dx)
return atan2(dy, dx);
}
GpStatus hresult_to_status(HRESULT res)
{
switch(res){
case S_OK:
return Ok;
case E_OUTOFMEMORY:
return OutOfMemory;
case E_INVALIDARG:
return InvalidParameter;
default:
return GenericError;
}
}

View file

@ -129,7 +129,7 @@
@ stub GdipCreateRegionRectI
@ stub GdipCreateRegionRgnData
@ stdcall GdipCreateSolidFill(long ptr)
@ stub GdipCreateStreamOnFile
@ stdcall GdipCreateStreamOnFile(ptr long ptr)
@ stub GdipCreateStringFormat
@ stub GdipCreateTexture2
@ stub GdipCreateTexture2I

View file

@ -41,6 +41,7 @@ COLORREF ARGB2COLORREF(ARGB color);
extern INT arc2polybezier(GpPointF * points, REAL x1, REAL y1, REAL x2, REAL y2,
REAL startAngle, REAL sweepAngle);
extern REAL gdiplus_atan2(REAL dy, REAL dx);
extern GpStatus hresult_to_status(HRESULT res);
static inline INT roundr(REAL x)
{

View file

@ -30,6 +30,9 @@
#include "olectl.h"
#include "ole2.h"
#include "winreg.h"
#include "shlwapi.h"
#include "gdiplus.h"
#include "gdiplus_private.h"
#include "wine/debug.h"
@ -873,6 +876,27 @@ end:
return retval;
}
GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR * filename,
UINT access, IStream **stream)
{
DWORD dwMode;
HRESULT ret;
if(!stream || !filename)
return InvalidParameter;
if(access & GENERIC_WRITE)
dwMode = STGM_SHARE_DENY_WRITE | STGM_WRITE | STGM_CREATE;
else if(access & GENERIC_READ)
dwMode = STGM_SHARE_DENY_WRITE | STGM_READ | STGM_FAILIFTHERE;
else
return InvalidParameter;
ret = SHCreateStreamOnFileW(filename, dwMode, stream);
return hresult_to_status(ret);
}
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
{
if(!graphics) return InvalidParameter;

View file

@ -52,6 +52,7 @@ GpStatus WINGDIPAPI GdipCreateFromHWND(HWND,GpGraphics**);
GpStatus WINGDIPAPI GdipCreateMetafileFromEmf(HENHMETAFILE,BOOL,GpMetafile**);
GpStatus WINGDIPAPI GdipCreateMetafileFromWmf(HMETAFILE,BOOL,
GDIPCONST WmfPlaceableFileHeader*,GpMetafile**);
GpStatus WINGDIPAPI GdipCreateStreamOnFile(GDIPCONST WCHAR*,UINT,IStream**);
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *);
GpStatus WINGDIPAPI GdipDrawArc(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,REAL);
GpStatus WINGDIPAPI GdipDrawBezier(GpGraphics*,GpPen*,REAL,REAL,REAL,REAL,REAL,