mirror of
https://github.com/reactos/reactos.git
synced 2024-12-30 19:14:31 +00:00
- Sync gdiplus, hhctrl and inetcomm with Wine head
svn path=/trunk/; revision=39761
This commit is contained in:
parent
81ccdcd42b
commit
b0aef63d27
11 changed files with 86 additions and 53 deletions
|
@ -1901,7 +1901,6 @@ GpStatus WINGDIPAPI GdipDrawString(GpGraphics *graphics, GDIPCONST WCHAR *string
|
|||
j++;
|
||||
}
|
||||
|
||||
stringdup[j] = 0;
|
||||
length = j;
|
||||
|
||||
while(sum < length){
|
||||
|
|
|
@ -1384,16 +1384,33 @@ GpStatus WINGDIPAPI GdipIsVisiblePathPointI(GpPath* path, INT x, INT y, GpGraphi
|
|||
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;
|
||||
GpRegion *region;
|
||||
HRGN hrgn;
|
||||
GpStatus status;
|
||||
|
||||
if(!path) return InvalidParameter;
|
||||
if(!path || !result) return InvalidParameter;
|
||||
|
||||
if(!(calls++))
|
||||
FIXME("not implemented\n");
|
||||
status = GdipCreateRegionPath(path, ®ion);
|
||||
if(status != Ok)
|
||||
return status;
|
||||
|
||||
return NotImplemented;
|
||||
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)
|
||||
|
|
|
@ -496,12 +496,6 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
|
|||
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 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
|
|||
|
||||
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 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
|
|||
BITMAP bm;
|
||||
GpStatus retval;
|
||||
PixelFormat format;
|
||||
BYTE* bits;
|
||||
|
||||
TRACE("%p %p %p\n", hbm, hpal, bitmap);
|
||||
|
||||
|
@ -1532,8 +1540,16 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBi
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -339,6 +339,9 @@ GpStatus WINGDIPAPI GdipCombineRegionRectI(GpRegion *region,
|
|||
return GdipCombineRegionRect(region, &rectf, mode);
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* GdipCombineRegionRegion [GDIPLUS.@]
|
||||
*/
|
||||
GpStatus WINGDIPAPI GdipCombineRegionRegion(GpRegion *region1,
|
||||
GpRegion *region2, CombineMode mode)
|
||||
{
|
||||
|
@ -544,6 +547,9 @@ GpStatus WINGDIPAPI GdipCreateRegionRect(GDIPCONST GpRectF *rect,
|
|||
return Ok;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* GdipCreateRegionRectI [GDIPLUS.@]
|
||||
*/
|
||||
GpStatus WINGDIPAPI GdipCreateRegionRectI(GDIPCONST GpRect *rect,
|
||||
GpRegion **region)
|
||||
{
|
||||
|
@ -621,6 +627,9 @@ GpStatus WINGDIPAPI GdipCreateRegionHrgn(HRGN hrgn, GpRegion **region)
|
|||
return stat;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
* GdipDeleteRegion [GDIPLUS.@]
|
||||
*/
|
||||
GpStatus WINGDIPAPI GdipDeleteRegion(GpRegion *region)
|
||||
{
|
||||
TRACE("%p\n", region);
|
||||
|
@ -799,7 +808,7 @@ static void write_element(const region_element* element, DWORD *buffer,
|
|||
*
|
||||
* RETURNS
|
||||
* SUCCESS: Ok
|
||||
* FAILURE: InvalidParamter
|
||||
* FAILURE: InvalidParameter
|
||||
*
|
||||
* NOTES
|
||||
* The header contains the size, a checksum, a version string, and the number
|
||||
|
|
|
@ -249,11 +249,28 @@ HWND WINAPI HtmlHelpA(HWND caller, LPCSTR filename, UINT command, DWORD_PTR data
|
|||
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))
|
||||
{
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -61,8 +61,6 @@ HRESULT InternetTransport_DropConnection(InternetTransport *This);
|
|||
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,
|
||||
|
|
|
@ -204,29 +204,6 @@ HRESULT InternetTransport_ChangeStatus(InternetTransport *This, IXPSTATUS Status
|
|||
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)
|
||||
{
|
||||
|
|
|
@ -119,7 +119,7 @@ static HRESULT WINAPI MimeInternat_SetDefaultCharset(IMimeInternational *iface,
|
|||
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 @@ static HRESULT WINAPI MimeInternat_GetDefaultCharset(IMimeInternational *iface,
|
|||
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;
|
||||
|
||||
|
|
|
@ -1125,7 +1125,7 @@ HRESULT MimeBody_create(IUnknown *outer, void **obj)
|
|||
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 @@ HRESULT MimeMessage_create(IUnknown *outer, void **obj)
|
|||
list_init(&This->body_tree);
|
||||
This->next_hbody = (HBODY)1;
|
||||
|
||||
*obj = (IMimeMessage *)&This->lpVtbl;
|
||||
*obj = &This->lpVtbl;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
@ -2774,7 +2774,7 @@ HRESULT MimeSecurity_create(IUnknown *outer, void **obj)
|
|||
This->lpVtbl = &MimeSecurityVtbl;
|
||||
This->refs = 1;
|
||||
|
||||
*obj = (IMimeSecurity *)&This->lpVtbl;
|
||||
*obj = &This->lpVtbl;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -735,7 +735,7 @@ static HRESULT WINAPI SMTPTransport_CommandMAIL(ISMTPTransport2 *iface, LPSTR ps
|
|||
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 @@ static HRESULT WINAPI SMTPTransport_CommandRCPT(ISMTPTransport2 *iface, LPSTR ps
|
|||
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 @@ static HRESULT WINAPI SMTPTransport_CommandAUTH(ISMTPTransport2 *iface,
|
|||
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;
|
||||
|
|
Loading…
Reference in a new issue