From c91df67f1116c4b75a0eaa6232caad5e6a4f63ac Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 27 Mar 2005 18:17:19 +0000 Subject: [PATCH] Format VT_UI1, VT_I1, VT_UI2, VT_I2 correctly. --- dlls/oleaut32/tmarshal.c | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/dlls/oleaut32/tmarshal.c b/dlls/oleaut32/tmarshal.c index b0c885c744..6286dd90bd 100644 --- a/dlls/oleaut32/tmarshal.c +++ b/dlls/oleaut32/tmarshal.c @@ -504,14 +504,24 @@ serialize_param( case VT_ERROR: case VT_UINT: case VT_I4: - case VT_I2: - case VT_I1: case VT_R4: case VT_UI4: + hres = S_OK; + if (debugout) TRACE_(olerelay)("%lx",*arg); + if (writeit) + hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD)); + return hres; + case VT_I2: case VT_UI2: + hres = S_OK; + if (debugout) TRACE_(olerelay)("%04lx",*arg & 0xffff); + if (writeit) + hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD)); + return hres; + case VT_I1: case VT_UI1: hres = S_OK; - if (debugout) TRACE_(olerelay)("%lx",*arg); + if (debugout) TRACE_(olerelay)("%02lx",*arg & 0xff); if (writeit) hres = xbuf_add(buf,(LPBYTE)arg,sizeof(DWORD)); return hres; @@ -1043,19 +1053,35 @@ deserialize_param( case VT_ERROR: case VT_BOOL: case VT_I4: - case VT_I2: - case VT_I1: case VT_UINT: case VT_R4: case VT_UI4: - case VT_UI2: - case VT_UI1: if (readit) { hres = xbuf_get(buf,(LPBYTE)arg,sizeof(DWORD)); if (hres) ERR("Failed to read integer 4 byte\n"); } if (debugout) TRACE_(olerelay)("%lx",*arg); return hres; + case VT_I2: + case VT_UI2: + if (readit) { + DWORD x; + hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD)); + if (hres) ERR("Failed to read integer 4 byte\n"); + memcpy(arg,&x,2); + } + if (debugout) TRACE_(olerelay)("%04lx",*arg & 0xffff); + return hres; + case VT_I1: + case VT_UI1: + if (readit) { + DWORD x; + hres = xbuf_get(buf,(LPBYTE)&x,sizeof(DWORD)); + if (hres) ERR("Failed to read integer 4 byte\n"); + memcpy(arg,&x,1); + } + if (debugout) TRACE_(olerelay)("%02lx",*arg & 0xff); + return hres; case VT_BSTR|VT_BYREF: { BSTR **bstr = (BSTR **)arg; WCHAR *str; -- 2.32.0.93.g670b81a890