Changeset 4258 for trunk/src/ole32/bindctx.cpp
- Timestamp:
- Sep 14, 2000, 4:57:01 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/ole32/bindctx.cpp
r3497 r4258 1 /* $Id: bindctx.cpp,v 1. 3 2000-05-05 18:21:36 sandervlExp $ */1 /* $Id: bindctx.cpp,v 1.4 2000-09-14 14:57:00 davidr Exp $ */ 2 2 /* 3 3 * BindCtx implementation … … 300 300 HRESULT WINAPI BindCtxImpl_SetBindOptions(IBindCtx* iface,LPBIND_OPTS2 pbindopts) 301 301 { 302 DWORD size = sizeof(BIND_OPTS2); 303 302 304 ICOM_THIS(BindCtxImpl,iface); 303 305 … … 306 308 if (pbindopts==NULL) 307 309 return E_POINTER; 308 309 if (pbindopts->cbStruct > sizeof(BIND_OPTS2)) 310 { 311 WARN("invalid size"); 312 return E_INVALIDARG; /* FIXME : not verified */ 313 } 314 memcpy(&This->bindOption2, pbindopts, pbindopts->cbStruct); 310 311 /* make sure we don't copy more bytes than we can */ 312 if (pbindopts->cbStruct < size) 313 size = pbindopts->cbStruct; 314 315 memcpy(&This->bindOption2, pbindopts, size); 315 316 316 317 return S_OK; … … 322 323 HRESULT WINAPI BindCtxImpl_GetBindOptions(IBindCtx* iface,LPBIND_OPTS2 pbindopts) 323 324 { 325 DWORD size = sizeof(BIND_OPTS2); 326 324 327 ICOM_THIS(BindCtxImpl,iface); 325 328 … … 329 332 return E_POINTER; 330 333 331 if (pbindopts->cbStruct > sizeof(BIND_OPTS2)) 332 { 333 WARN("invalid size"); 334 return E_INVALIDARG; /* FIXME : not verified */ 335 } 336 memcpy(pbindopts, &This->bindOption2, pbindopts->cbStruct); 334 /* make sure we don't copy more bytes than we can */ 335 if (pbindopts->cbStruct < size) 336 size = pbindopts->cbStruct; 337 338 memcpy(pbindopts, &This->bindOption2, size); 337 339 338 340 return S_OK;
Note:
See TracChangeset
for help on using the changeset viewer.