Author: dchapyshev
Date: Thu Feb 26 13:24:00 2009
New Revision: 39761
URL:
http://svn.reactos.org/svn/reactos?rev=39761&view=rev
Log:
- Sync gdiplus, hhctrl and inetcomm with Wine head
Modified:
trunk/reactos/dll/win32/gdiplus/graphics.c
trunk/reactos/dll/win32/gdiplus/graphicspath.c
trunk/reactos/dll/win32/gdiplus/image.c
trunk/reactos/dll/win32/gdiplus/region.c
trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c
trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild
trunk/reactos/dll/win32/inetcomm/inetcomm_private.h
trunk/reactos/dll/win32/inetcomm/internettransport.c
trunk/reactos/dll/win32/inetcomm/mimeintl.c
trunk/reactos/dll/win32/inetcomm/mimeole.c
trunk/reactos/dll/win32/inetcomm/smtptransport.c
Modified: trunk/reactos/dll/win32/gdiplus/graphics.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/graphics.c [iso-8859-1] Thu Feb 26 13:24:00 2009
@@ -1901,7 +1901,6 @@
j++;
}
- stringdup[j] = 0;
length = j;
while(sum < length){
Modified: trunk/reactos/dll/win32/gdiplus/graphicspath.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/graphics…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/graphicspath.c [iso-8859-1] Thu Feb 26 13:24:00 2009
@@ -1384,16 +1384,33 @@
return GdipIsVisiblePathPoint(path, x, y, graphics, result);
}
+/*****************************************************************************
+ * GdipIsVisiblePathPoint [GDIPLUS.@]
+ */
GpStatus WINGDIPAPI GdipIsVisiblePathPoint(GpPath* path, REAL x, REAL y, GpGraphics
*graphics, BOOL *result)
{
- static int calls;
-
- if(!path) return InvalidParameter;
-
- if(!(calls++))
- FIXME("not implemented\n");
-
- return NotImplemented;
+ GpRegion *region;
+ HRGN hrgn;
+ GpStatus status;
+
+ if(!path || !result) return InvalidParameter;
+
+ status = GdipCreateRegionPath(path, ®ion);
+ if(status != Ok)
+ return status;
+
+ status = GdipGetRegionHRgn(region, graphics, &hrgn);
+ if(status != Ok){
+ GdipDeleteRegion(region);
+ return status;
+ }
+
+ *result = PtInRegion(hrgn, roundr(x), roundr(y));
+
+ DeleteObject(hrgn);
+ GdipDeleteRegion(region);
+
+ return Ok;
}
GpStatus WINGDIPAPI GdipStartPathFigure(GpPath *path)
Modified: trunk/reactos/dll/win32/gdiplus/image.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/image.c?…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/image.c [iso-8859-1] Thu Feb 26 13:24:00 2009
@@ -496,12 +496,6 @@
if(scan0 && !stride)
return InvalidParameter;
- /* FIXME: windows allows negative stride (reads backwards from scan0) */
- if(stride < 0){
- FIXME("negative stride\n");
- return InvalidParameter;
- }
-
*bitmap = GdipAlloc(sizeof(GpBitmap));
if(!*bitmap) return OutOfMemory;
@@ -527,16 +521,29 @@
bmih->biSize = sizeof(BITMAPINFOHEADER);
bmih->biWidth = width;
- bmih->biHeight = -height;
/* FIXME: use the rest of the data from format */
bmih->biBitCount = PIXELFORMATBPP(format);
bmih->biCompression = BI_RGB;
bmih->biSizeImage = datalen;
- if(scan0)
- memcpy(bmih + 1, scan0, datalen);
+ if (scan0)
+ {
+ if (stride > 0)
+ {
+ bmih->biHeight = -height;
+ memcpy(bmih + 1, scan0, datalen);
+ }
+ else
+ {
+ bmih->biHeight = height;
+ memcpy(bmih + 1, scan0 + stride * (height - 1), datalen);
+ }
+ }
else
+ {
+ bmih->biHeight = height;
memset(bmih + 1, 0, datalen);
+ }
if(CreateStreamOnHGlobal(buff, TRUE, &stream) != S_OK){
ERR("could not make stream\n");
@@ -1492,6 +1499,7 @@
BITMAP bm;
GpStatus retval;
PixelFormat format;
+ BYTE* bits;
TRACE("%p %p %p\n", hbm, hpal, bitmap);
@@ -1532,8 +1540,16 @@
return InvalidParameter;
}
- retval = GdipCreateBitmapFromScan0(bm.bmWidth, bm.bmHeight, bm.bmWidthBytes,
- format, bm.bmBits, bitmap);
+ if (bm.bmBits)
+ bits = (BYTE*)bm.bmBits + (bm.bmHeight - 1) * bm.bmWidthBytes;
+ else
+ {
+ FIXME("can only get image data from DIB sections\n");
+ bits = NULL;
+ }
+
+ retval = GdipCreateBitmapFromScan0(bm.bmWidth, bm.bmHeight, -bm.bmWidthBytes,
+ format, bits, bitmap);
return retval;
}
Modified: trunk/reactos/dll/win32/gdiplus/region.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdiplus/region.c…
==============================================================================
--- trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdiplus/region.c [iso-8859-1] Thu Feb 26 13:24:00 2009
@@ -339,6 +339,9 @@
return GdipCombineRegionRect(region, &rectf, mode);
}
+/*****************************************************************************
+ * GdipCombineRegionRegion [GDIPLUS.@]
+ */
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1,
GpRegion *region2, CombineMode mode)
{
@@ -544,6 +547,9 @@
return Ok;
}
+/*****************************************************************************
+ * GdipCreateRegionRectI [GDIPLUS.@]
+ */
GpStatus WINGDIPAPI GdipCreateRegionRectI(GDIPCONST GpRect *rect,
GpRegion **region)
{
@@ -621,6 +627,9 @@
return stat;
}
+/*****************************************************************************
+ * GdipDeleteRegion [GDIPLUS.@]
+ */
GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
{
TRACE("%p\n", region);
@@ -799,7 +808,7 @@
*
* RETURNS
* SUCCESS: Ok
- * FAILURE: InvalidParamter
+ * FAILURE: InvalidParameter
*
* NOTES
* The header contains the size, a checksum, a version string, and the number
Modified: trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/hhctrl.ocx/hhctr…
==============================================================================
--- trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/hhctrl.ocx/hhctrl.c [iso-8859-1] Thu Feb 26 13:24:00 2009
@@ -249,11 +249,28 @@
int WINAPI doWinMain(HINSTANCE hInstance, LPSTR szCmdLine)
{
MSG msg;
+ int len, buflen;
+ WCHAR *filename;
+ char *endq = NULL;
hh_process = TRUE;
/* FIXME: Check szCmdLine for bad arguments */
- HtmlHelpA(GetDesktopWindow(), szCmdLine, HH_DISPLAY_TOPIC, 0);
+ if (*szCmdLine == '\"')
+ endq = strchr(++szCmdLine, '\"');
+
+ if (endq)
+ len = endq - szCmdLine;
+ else
+ len = strlen(szCmdLine);
+ buflen = MultiByteToWideChar(CP_ACP, 0, szCmdLine, len, NULL, 0) + 1;
+ filename = heap_alloc(buflen * sizeof(WCHAR));
+ MultiByteToWideChar(CP_ACP, 0, szCmdLine, len, filename, buflen);
+ filename[buflen-1] = 0;
+
+ HtmlHelpW(GetDesktopWindow(), filename, HH_DISPLAY_TOPIC, 0);
+
+ heap_free(filename);
while (GetMessageW(&msg, 0, 0, 0))
{
Modified: trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
==============================================================================
--- trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/inetcomm/inetcomm.rbuild [iso-8859-1] Thu Feb 26 13:24:00
2009
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group>
-<module name="inetcomm" type="win32dll"
baseaddress="${BASEADDRESS_INETCOMM}" installbase="system32"
installname="inetcomm.dll">
+<module name="inetcomm" type="win32dll"
baseaddress="${BASEADDRESS_INETCOMM}" installbase="system32"
installname="inetcomm.dll" allowwarnings="true">
<autoregister infsection="OleControlDlls"
type="DllRegisterServer" />
<importlibrary definition="inetcomm.spec" />
<include base="inetcomm">.</include>
Modified: trunk/reactos/dll/win32/inetcomm/inetcomm_private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/inetcom…
==============================================================================
--- trunk/reactos/dll/win32/inetcomm/inetcomm_private.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/inetcomm/inetcomm_private.h [iso-8859-1] Thu Feb 26 13:24:00
2009
@@ -61,8 +61,6 @@
HRESULT InternetTransport_GetStatus(InternetTransport *This,
IXPSTATUS *pCurrentStatus);
HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status);
-HRESULT InternetTransport_Read(InternetTransport *This, int cbBuffer,
- INETXPORT_COMPLETION_FUNCTION fnCompletion);
HRESULT InternetTransport_ReadLine(InternetTransport *This,
INETXPORT_COMPLETION_FUNCTION fnCompletion);
HRESULT InternetTransport_Write(InternetTransport *This, const char *pvData,
Modified: trunk/reactos/dll/win32/inetcomm/internettransport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/interne…
==============================================================================
--- trunk/reactos/dll/win32/inetcomm/internettransport.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/inetcomm/internettransport.c [iso-8859-1] Thu Feb 26 13:24:00
2009
@@ -204,29 +204,6 @@
return S_OK;
}
-HRESULT InternetTransport_Read(InternetTransport *This, int cbBuffer,
- INETXPORT_COMPLETION_FUNCTION fnCompletion)
-{
- if (This->Status == IXP_DISCONNECTED)
- return IXP_E_NOT_CONNECTED;
-
- if (This->fnCompletion)
- return IXP_E_BUSY;
-
- This->fnCompletion = fnCompletion;
-
- This->cbBuffer = cbBuffer;
- This->pBuffer = HeapAlloc(GetProcessHeap(), 0, This->cbBuffer);
- This->iCurrentBufferOffset = 0;
-
- if (WSAAsyncSelect(This->Socket, This->hwnd, IX_READ, FD_READ) ==
SOCKET_ERROR)
- {
- ERR("WSAAsyncSelect failed with error %d\n", WSAGetLastError());
- /* FIXME: handle error */
- }
- return S_OK;
-}
-
HRESULT InternetTransport_ReadLine(InternetTransport *This,
INETXPORT_COMPLETION_FUNCTION fnCompletion)
{
Modified: trunk/reactos/dll/win32/inetcomm/mimeintl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeint…
==============================================================================
--- trunk/reactos/dll/win32/inetcomm/mimeintl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/inetcomm/mimeintl.c [iso-8859-1] Thu Feb 26 13:24:00 2009
@@ -119,7 +119,7 @@
if(hCharset == NULL) return E_INVALIDARG;
/* FIXME check hCharset is valid */
- (void)InterlockedExchangePointer(&This->default_charset, hCharset);
+ InterlockedExchangePointer(&This->default_charset, hCharset);
return S_OK;
}
@@ -136,7 +136,7 @@
HCHARSET hcs;
hr = IMimeInternational_GetCodePageCharset(iface, GetACP(), CHARSET_BODY,
&hcs);
if(SUCCEEDED(hr))
- (void)InterlockedCompareExchangePointer(&This->default_charset, hcs,
NULL);
+ InterlockedCompareExchangePointer(&This->default_charset, hcs, NULL);
}
*phCharset = This->default_charset;
Modified: trunk/reactos/dll/win32/inetcomm/mimeole.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/mimeole…
==============================================================================
--- trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/inetcomm/mimeole.c [iso-8859-1] Thu Feb 26 13:24:00 2009
@@ -1125,7 +1125,7 @@
body_offsets.cbBodyStart = body_offsets.cbBodyEnd = 0;
MimeBody_set_offsets(This, &body_offsets);
- *obj = (IMimeBody *)&This->lpVtbl;
+ *obj = &This->lpVtbl;
return S_OK;
}
@@ -2563,7 +2563,7 @@
list_init(&This->body_tree);
This->next_hbody = (HBODY)1;
- *obj = (IMimeMessage *)&This->lpVtbl;
+ *obj = &This->lpVtbl;
return S_OK;
}
@@ -2774,7 +2774,7 @@
This->lpVtbl = &MimeSecurityVtbl;
This->refs = 1;
- *obj = (IMimeSecurity *)&This->lpVtbl;
+ *obj = &This->lpVtbl;
return S_OK;
}
Modified: trunk/reactos/dll/win32/inetcomm/smtptransport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/inetcomm/smtptra…
==============================================================================
--- trunk/reactos/dll/win32/inetcomm/smtptransport.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/inetcomm/smtptransport.c [iso-8859-1] Thu Feb 26 13:24:00
2009
@@ -735,7 +735,7 @@
int len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszEmailFrom);
HRESULT hr;
- TRACE("(%s)\n", pszEmailFrom);
+ TRACE("(%s)\n", debugstr_a(pszEmailFrom));
if (!pszEmailFrom)
return E_INVALIDARG;
@@ -761,7 +761,7 @@
int len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszEmailTo);
HRESULT hr;
- TRACE("(%s)\n", pszEmailTo);
+ TRACE("(%s)\n", debugstr_a(pszEmailTo));
if (!pszEmailTo)
return E_INVALIDARG;
@@ -836,7 +836,7 @@
int len = sizeof(szCommandFormat) - 2 /* "%s" */ + strlen(pszAuthType);
HRESULT hr;
- TRACE("(%s)\n", pszAuthType);
+ TRACE("(%s)\n", debugstr_a(pszAuthType));
if (!pszAuthType)
return E_INVALIDARG;