Changeset 7916 for trunk/src/oleaut32/olefont.c
- Timestamp:
- Feb 15, 2002, 4:07:41 PM (24 years ago)
- File:
-
- 1 edited
-
trunk/src/oleaut32/olefont.c (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/oleaut32/olefont.c
r6711 r7916 26 26 #include "olectl.h" 27 27 #include "debugtools.h" 28 #include "heap.h"29 28 #include "connpt.h" /* for CreateConnectionPoint */ 30 29 … … 292 291 *ppvObj = 0; 293 292 293 if (lpFontDesc == 0) 294 return NO_ERROR; /* MSDN Oct 2001 */ 295 294 296 /* 295 297 * Try to construct a new instance of the class. … … 1341 1343 BYTE bAttributes; 1342 1344 BYTE bStringSize; 1345 INT len; 1343 1346 1344 1347 _ICOM_THIS_From_IPersistStream(OLEFontImpl, iface); … … 1399 1402 return E_FAIL; 1400 1403 1401 memset(readBuffer, 0, 0x100);1402 1404 IStream_Read(pLoadStream, readBuffer, bStringSize, &cbRead); 1403 1405 … … 1408 1410 HeapFree(GetProcessHeap(), 0, this->description.lpstrName); 1409 1411 1410 this->description.lpstrName = HEAP_strdupAtoW(GetProcessHeap(), 1411 HEAP_ZERO_MEMORY, 1412 readBuffer); 1412 len = MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, NULL, 0 ); 1413 this->description.lpstrName = HeapAlloc( GetProcessHeap(), 0, (len+1) * sizeof(WCHAR) ); 1414 MultiByteToWideChar( CP_ACP, 0, readBuffer, bStringSize, this->description.lpstrName, len ); 1415 this->description.lpstrName[len] = 0; 1413 1416 1414 1417 return S_OK; … … 1488 1491 */ 1489 1492 if (this->description.lpstrName!=0) 1490 bStringSize = lstrlenW(this->description.lpstrName); 1493 bStringSize = WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, 1494 strlenW(this->description.lpstrName), NULL, 0, NULL, NULL ); 1491 1495 else 1492 1496 bStringSize = 0; … … 1499 1503 if (bStringSize!=0) 1500 1504 { 1501 writeBuffer = HEAP_strdupWtoA(GetProcessHeap(), 1502 HEAP_ZERO_MEMORY, 1503 this->description.lpstrName); 1504 1505 if (writeBuffer==0) 1506 return E_OUTOFMEMORY; 1505 if (!(writeBuffer = HeapAlloc( GetProcessHeap(), 0, bStringSize ))) return E_OUTOFMEMORY; 1506 WideCharToMultiByte( CP_ACP, 0, this->description.lpstrName, 1507 strlenW(this->description.lpstrName), 1508 writeBuffer, bStringSize, NULL, NULL ); 1507 1509 1508 1510 IStream_Write(pOutStream, writeBuffer, bStringSize, &cbWritten); 1509 1510 1511 HeapFree(GetProcessHeap(), 0, writeBuffer); 1511 1512 … … 1660 1661 LPCLASSFACTORY iface,LPUNKNOWN pOuter,REFIID riid,LPVOID *ppobj 1661 1662 ) { 1662 ICOM_THIS(IClassFactoryImpl,iface); 1663 1664 if (IsEqualGUID(riid,&IID_IFont)) { 1665 FONTDESC fd; 1666 1667 WCHAR fname[] = { 'S','y','s','t','e','m',0 }; 1668 1669 fd.cbSizeofstruct = sizeof(fd); 1670 fd.lpstrName = fname; 1671 fd.cySize.s.Lo = 80000; 1672 fd.cySize.s.Hi = 0; 1673 fd.sWeight = 0; 1674 fd.sCharset = 0; 1675 fd.fItalic = 0; 1676 fd.fUnderline = 0; 1677 fd.fStrikethrough = 0; 1678 return OleCreateFontIndirect(&fd,riid,ppobj); 1679 } 1680 1681 FIXME("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); 1682 return E_NOINTERFACE; 1663 FONTDESC fd; 1664 1665 WCHAR fname[] = { 'S','y','s','t','e','m',0 }; 1666 1667 fd.cbSizeofstruct = sizeof(fd); 1668 fd.lpstrName = fname; 1669 fd.cySize.s.Lo = 80000; 1670 fd.cySize.s.Hi = 0; 1671 fd.sWeight = 0; 1672 fd.sCharset = 0; 1673 fd.fItalic = 0; 1674 fd.fUnderline = 0; 1675 fd.fStrikethrough = 0; 1676 return OleCreateFontIndirect(&fd,riid,ppobj); 1677 1683 1678 } 1684 1679
Note:
See TracChangeset
for help on using the changeset viewer.
