Changeset 6711 for trunk/src/oleaut32/ole2disp.c
- Timestamp:
- Sep 15, 2001, 11:32:00 AM (24 years ago)
- File:
-
- 1 edited
-
trunk/src/oleaut32/ole2disp.c (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/oleaut32/ole2disp.c
r6689 r6711 1 1 /* 2 * OLE2DISP library2 * OLE2DISP library 3 3 * 4 * Copyright 1995Martin von Loewis4 * Copyright 1995 Martin von Loewis 5 5 */ 6 6 #ifdef __WIN32OS2__ … … 31 31 32 32 /****************************************************************************** 33 * BSTR_AllocBytes[Internal]33 * BSTR_AllocBytes [Internal] 34 34 */ 35 35 static BSTR16 BSTR_AllocBytes(int n) … … 56 56 57 57 /****************************************************************************** 58 * SysAllocString16[OLE2DISP.2]58 * SysAllocString16 [OLE2DISP.2] 59 59 */ 60 60 BSTR16 WINAPI SysAllocString16(LPCOLESTR16 in) 61 61 { 62 BSTR16 out; 63 62 BSTR16 out; 63 64 if (!in) return 0; 65 66 out = BSTR_AllocBytes(strlen(in)+1); 67 if(!out)return 0; 68 strcpy(BSTR_GetAddr(out),in); 69 return out; 70 } 71 #endif 72 73 /****************************************************************************** 74 * SysAllocString [OLEAUT32.2] 75 */ 76 BSTR WINAPI SysAllocString(LPCOLESTR in) 77 { 64 78 if (!in) return 0; 65 66 out = BSTR_AllocBytes(strlen(in)+1); 67 if(!out)return 0; 68 strcpy(BSTR_GetAddr(out),in); 69 return out; 70 } 71 #endif 72 73 /****************************************************************************** 74 * SysAllocString [OLEAUT32.2] 75 */ 76 BSTR WINAPI SysAllocString(LPCOLESTR in) 77 { 78 if (!in) return 0; 79 79 80 80 /* Delegate this to the SysAllocStringLen32 method. */ 81 81 return SysAllocStringLen(in, lstrlenW(in)); … … 84 84 #ifndef __WIN32OS2__ 85 85 /****************************************************************************** 86 * SysReAllocString16[OLE2DISP.3]86 * SysReAllocString16 [OLE2DISP.3] 87 87 */ 88 88 INT16 WINAPI SysReAllocString16(LPBSTR16 old,LPCOLESTR16 in) 89 89 { 90 BSTR16 new=SysAllocString16(in);91 BSTR_Free(*old);92 *old=new;93 return 1;94 } 95 #endif 96 97 /****************************************************************************** 98 * SysReAllocString[OLEAUT32.3]90 BSTR16 new=SysAllocString16(in); 91 BSTR_Free(*old); 92 *old=new; 93 return 1; 94 } 95 #endif 96 97 /****************************************************************************** 98 * SysReAllocString [OLEAUT32.3] 99 99 */ 100 100 INT WINAPI SysReAllocString(LPBSTR old,LPCOLESTR in) … … 103 103 * Sanity check 104 104 */ 105 if (old==NULL) 105 if (old==NULL) 106 106 return 0; 107 107 … … 109 109 * Make sure we free the old string. 110 110 */ 111 if (*old!=NULL) 111 if (*old!=NULL) 112 112 SysFreeString(*old); 113 113 … … 122 122 #ifndef __WIN32OS2__ 123 123 /****************************************************************************** 124 * SysAllocStringLen16[OLE2DISP.4]124 * SysAllocStringLen16 [OLE2DISP.4] 125 125 */ 126 126 BSTR16 WINAPI SysAllocStringLen16(const char *in, int len) 127 127 { 128 BSTR16 out=BSTR_AllocBytes(len+1);129 130 if (!out)131 return 0;128 BSTR16 out=BSTR_AllocBytes(len+1); 129 130 if (!out) 131 return 0; 132 132 133 133 /* … … 137 137 */ 138 138 if (in != 0) 139 strcpy(BSTR_GetAddr(out),in);139 strcpy(BSTR_GetAddr(out),in); 140 140 else 141 141 memset(BSTR_GetAddr(out), 0, len+1); 142 142 143 return out;143 return out; 144 144 } 145 145 #endif … … 152 152 * he describes it as a "DWORD count of characters". By experimenting with 153 153 * a windows application, this count seems to be a DWORD count of bytes in 154 * the string. Meaning that the count is double the number of wide 154 * the string. Meaning that the count is double the number of wide 155 155 * characters in the string. 156 156 */ … … 214 214 #ifndef __WIN32OS2__ 215 215 /****************************************************************************** 216 * SysReAllocStringLen16[OLE2DISP.5]216 * SysReAllocStringLen16 [OLE2DISP.5] 217 217 */ 218 218 int WINAPI SysReAllocStringLen16(BSTR16 *old,const char *in,int len) 219 219 { 220 BSTR16 new=SysAllocStringLen16(in,len); 221 BSTR_Free(*old); 222 *old=new; 220 BSTR16 new=SysAllocStringLen16(in,len); 221 BSTR_Free(*old); 222 *old=new; 223 return 1; 224 } 225 #endif 226 227 228 /****************************************************************************** 229 * SysReAllocStringLen [OLEAUT32.5] 230 */ 231 int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* in, unsigned int len) 232 { 233 /* 234 * Sanity check 235 */ 236 if (old==NULL) 237 return 0; 238 239 /* 240 * Make sure we free the old string. 241 */ 242 if (*old!=NULL) 243 SysFreeString(*old); 244 245 /* 246 * Allocate the new string 247 */ 248 *old = SysAllocStringLen(in, len); 249 223 250 return 1; 224 251 } 225 #endif 226 227 228 /****************************************************************************** 229 * SysReAllocStringLen [OLEAUT32.5] 230 */ 231 int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* in, unsigned int len) 232 { 233 /* 234 * Sanity check 235 */ 236 if (old==NULL) 237 return 0; 238 239 /* 240 * Make sure we free the old string. 241 */ 242 if (*old!=NULL) 243 SysFreeString(*old); 244 245 /* 246 * Allocate the new string 247 */ 248 *old = SysAllocStringLen(in, len); 249 250 return 1; 251 } 252 253 #ifndef __WIN32OS2__ 254 /****************************************************************************** 255 * SysFreeString16 [OLE2DISP.6] 252 253 #ifndef __WIN32OS2__ 254 /****************************************************************************** 255 * SysFreeString16 [OLE2DISP.6] 256 256 */ 257 257 void WINAPI SysFreeString16(BSTR16 in) 258 258 { 259 BSTR_Free(in);260 } 261 #endif 262 263 /****************************************************************************** 264 * SysFreeString[OLEAUT32.6]259 BSTR_Free(in); 260 } 261 #endif 262 263 /****************************************************************************** 264 * SysFreeString [OLEAUT32.6] 265 265 */ 266 266 void WINAPI SysFreeString(BSTR in) 267 267 { 268 268 DWORD* bufferPointer; 269 269 270 270 /* NULL is a valid parameter */ 271 271 if(!in) return; … … 288 288 #ifndef __WIN32OS2__ 289 289 /****************************************************************************** 290 * SysStringLen16[OLE2DISP.7]290 * SysStringLen16 [OLE2DISP.7] 291 291 */ 292 292 int WINAPI SysStringLen16(BSTR16 str) 293 293 { 294 return strlen(BSTR_GetAddr(str));294 return strlen(BSTR_GetAddr(str)); 295 295 } 296 296 #endif … … 310 310 if (!str) return 0; 311 311 /* 312 * The length of the string (in bytes) is contained in a DWORD placed 312 * The length of the string (in bytes) is contained in a DWORD placed 313 313 * just before the BSTR pointer 314 314 */ … … 334 334 if (!str) return 0; 335 335 /* 336 * The length of the string (in bytes) is contained in a DWORD placed 336 * The length of the string (in bytes) is contained in a DWORD placed 337 337 * just before the BSTR pointer 338 338 */ … … 349 349 */ 350 350 HRESULT WINAPI CreateDispTypeInfo16( 351 INTERFACEDATA *pidata,352 LCID lcid,353 ITypeInfo **pptinfo)354 { 355 FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo);356 return 0;351 INTERFACEDATA *pidata, 352 LCID lcid, 353 ITypeInfo **pptinfo) 354 { 355 FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo); 356 return 0; 357 357 } 358 358 #endif … … 362 362 */ 363 363 HRESULT WINAPI CreateDispTypeInfo( 364 INTERFACEDATA *pidata,365 LCID lcid,366 ITypeInfo **pptinfo)367 { 368 FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo);369 return 0;364 INTERFACEDATA *pidata, 365 LCID lcid, 366 ITypeInfo **pptinfo) 367 { 368 FIXME("(%p,%ld,%p),stub\n",pidata,lcid,pptinfo); 369 return 0; 370 370 } 371 371 … … 377 377 IUnknown* punkOuter, 378 378 void* pvThis, 379 ITypeInfo* ptinfo,380 IUnknown** ppunkStdDisp)381 { 382 FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo,379 ITypeInfo* ptinfo, 380 IUnknown** ppunkStdDisp) 381 { 382 FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo, 383 383 ppunkStdDisp); 384 return 0;384 return 0; 385 385 } 386 386 #endif … … 392 392 IUnknown* punkOuter, 393 393 void* pvThis, 394 ITypeInfo* ptinfo,395 IUnknown** ppunkStdDisp)396 { 397 FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo,394 ITypeInfo* ptinfo, 395 IUnknown** ppunkStdDisp) 396 { 397 FIXME("(%p,%p,%p,%p),stub\n",punkOuter, pvThis, ptinfo, 398 398 ppunkStdDisp); 399 return 0;399 return 0; 400 400 } 401 401 … … 405 405 */ 406 406 HRESULT WINAPI RegisterActiveObject16( 407 IUnknown *punk, REFCLSID rclsid, DWORD dwFlags, unsigned long *pdwRegister407 IUnknown *punk, REFCLSID rclsid, DWORD dwFlags, unsigned long *pdwRegister 408 408 ) { 409 FIXME("(%p,%s,0x%08lx,%p):stub\n",punk,debugstr_guid(rclsid),dwFlags,pdwRegister);410 return 0;411 } 412 #endif 413 414 /****************************************************************************** 415 * OleTranslateColor[OLEAUT32.421]409 FIXME("(%p,%s,0x%08lx,%p):stub\n",punk,debugstr_guid(rclsid),dwFlags,pdwRegister); 410 return 0; 411 } 412 #endif 413 414 /****************************************************************************** 415 * OleTranslateColor [OLEAUT32.421] 416 416 * 417 417 * Converts an OLE_COLOR to a COLORREF. 418 418 * See the documentation for conversion rules. 419 * pColorRef can be NULL. In that case the user only wants to test the 419 * pColorRef can be NULL. In that case the user only wants to test the 420 420 * conversion. 421 421 */
Note:
See TracChangeset
for help on using the changeset viewer.
