Debian Codegraph @

src/tools/file/ole.cpp

raw
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2
3 /* libmwaw: tools
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2011, 2012 Alonso Laurent ([email protected])
18 *
19 *
20 * All Rights Reserved.
21 *
22 * For minor contributions see the git repository.
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
26 * in which case the provisions of the LGPLv2+ are applicable
27 * instead of those above.
28 */
29
30 #include <string.h>
31
32 #include <cstring>
33 #include <iostream>
34 #include <list>
35 #include <sstream>
36 #include <set>
37 #include <string>
38
39 #include "file_internal.h"
40 #include "input.h"
41 #include "ole.h"
42
43 namespace libmwaw_tools
44 {
45 unsigned short OLE::readU16(InputStream &input, bool inverted)
46 {
47 unsigned long nRead;
48 unsigned char const *data = input.read(2, nRead);
49 if (!data || nRead != 2) return 0;
50 return inverted ?
51 static_cast<unsigned short>(data[0]+(data[1]<<8)) :
52 static_cast<unsigned short>(data[1]+(data[0]<<8));
53 }
54
55 unsigned int OLE::readU32(InputStream &input, bool inverted)
56 {
57 unsigned long nRead;
58 unsigned char const *data = input.read(4, nRead);
59 if (!data || nRead != 4) return 0;
60 return inverted ?
61 static_cast<unsigned int>(data[0]+(data[1]<<8)+(data[2]<<16)+(data[3]<<24)):
62 static_cast<unsigned int>(data[3]+(data[2]<<8)+(data[1]<<16)+(data[0]<<24));
63 }
64
65 // header functions
66 bool OLE::Header::read(InputStream &input)
67 {
68 if (input.length() < 512)
69 return false;
70 input.seek(0, InputStream::SK_SET);
71 unsigned long nRead;
72 unsigned char const *magic=input.read(8, nRead);
73 if (!magic || nRead != 8)
74 return false;
75 const unsigned char oleMagic[] =
76 { 0xd0, 0xcf, 0x11, 0xe0, 0xa1, 0xb1, 0x1a, 0xe1 };
77 for (int i = 0; i < 8; i++) {
78 if (magic[i] != oleMagic[i])
79 return false;
80 }
81 input.seek(0x1e, InputStream::SK_SET);
82 unsigned shift;
83 shift = static_cast<unsigned>(readU16(input));
84 if (shift <= 6 || shift >= 31)
85 return false;
86 m_sizeBats[BigBat] = static_cast<unsigned>(1) << shift;
87 shift = static_cast<unsigned>(readU16(input));
88 m_sizeBats[SmallBat] = static_cast<unsigned>(1) << shift;
89 if (shift >= 31 || m_sizeBats[SmallBat] >= m_sizeBats[BigBat])
90 return false;
91
92 input.seek(0x2c, InputStream::SK_SET);
93 m_numBats[BigBatAlloc] = static_cast<unsigned>(readU32(input));
94 m_startBats[Dirent] = static_cast<unsigned>(readU32(input));
95 input.seek(0x38, InputStream::SK_SET);
96 m_threshold = static_cast<unsigned>(readU32(input));
97 m_startBats[SmallBat] = static_cast<unsigned>(readU32(input));
98 m_numBats[SmallBat] = static_cast<unsigned>(readU32(input));
99 m_startBats[MetaBat] = static_cast<unsigned>(readU32(input));
100 m_numBats[MetaBat] = static_cast<unsigned>(readU32(input));
101
102 if (m_threshold != 4096 || !m_numBats[BigBatAlloc] ||
103 (m_numBats[BigBatAlloc]<= 109 && m_numBats[MetaBat]) ||
104 (m_numBats[BigBatAlloc]> 109 && m_numBats[BigBatAlloc] > m_numBats[MetaBat] * (m_sizeBats[BigBat]/4-1) + 109))
105 return false;
106
107 auto numBigBatInHeader=size_t(m_numBats[BigBatAlloc]>109 ? 109 : m_numBats[BigBatAlloc]);
108 m_bigBatAlloc.resize(numBigBatInHeader);
109 for (size_t i=0; i < numBigBatInHeader; i++)
110 m_bigBatAlloc[i] = static_cast<unsigned long>(readU32(input));
111 return true;
112 }
113
114 // direntry function
115 bool OLE::DirEntry::read(InputStream &input)
116 {
117 long pos = input.tell();
118 input.seek(pos+128, InputStream::SK_SET);
119 if (input.tell()!=pos+128) {
120 MWAW_DEBUG_MSG(("OLE::DirEntry::read: file entry is too short\n"));
121 return false;
122 }
123 input.seek(pos+0x40, InputStream::SK_SET);
124 auto name_len = static_cast<unsigned>(readU16(input));
125 if (name_len > 64) name_len = 64;
126 // 2 = file (aka stream), 1 = directory (aka storage), 5 = root
127 m_type = static_cast<unsigned>(input.readU8());
128
129 input.seek(pos, InputStream::SK_SET);
130 // parse name of this entry, which stored as Unicode 16-bit
131 m_name=std::string("");
132 for (unsigned j=0; j<name_len; j+= 2) {
133 unsigned val = readU16(input);
134 if (!val) break;
135 if (val==0x5200 && name_len==2 && m_type==5) {
136 m_name="R";
137 m_macRootEntry=true;
138 break;
139 }
140 m_name.append(1, char(val));
141 }
142 input.seek(pos+0x44, InputStream::SK_SET);
143 m_left = static_cast<unsigned>(readU32(input));
144 m_right = static_cast<unsigned>(readU32(input));
145 m_child = static_cast<unsigned>(readU32(input));
146 for (auto &id : m_clsid) id=static_cast<unsigned>(readU32(input));
147
148 input.seek(pos+0x74, InputStream::SK_SET);
149 m_start = static_cast<unsigned long>(readU32(input));
150 m_size = static_cast<unsigned long>(readU32(input));
151
152 // sanity checks
153 m_valid = true;
154 if ((m_type != 2) && (m_type != 1) && (m_type != 5)) m_valid = false;
155 if (name_len < 1) m_valid = false;
156 return true;
157 }
158
159 ////////////////////////////////////////////////////////////
160 // dirtree function
161 ////////////////////////////////////////////////////////////
162 void OLE::DirTree::DirTree::clear()
163 {
164 m_entries.resize(1);
165 m_entries[0]=DirEntry();
166 m_entries[0].m_valid = true;
167 m_entries[0].setName("Root Entry");
168 m_entries[0].m_type = 5;
169 }
170
171 unsigned OLE::DirTree::index(const std::string &name) const
172 {
173
174 if (name.length()==0) return DirEntry::End;
175
176 // quick check for "/" (that's root)
177 if (name == "/") return 0;
178
179 // split the names, e.g "/ObjectPool/_1020961869" will become:
180 // "ObjectPool" and "_1020961869"
181 std::list<std::string> names;
182 std::string::size_type start = 0, end = 0;
183 if (name[0] == '/') start++;
184 while (start < name.length()) {
185 end = name.find_first_of('/', start);
186 if (end == std::string::npos) end = name.length();
187 names.push_back(name.substr(start, end-start));
188 start = end+1;
189 }
190
191 // start from root
192 unsigned ind = 0 ;
193
194 // trace one by one
195 for (auto &childName : names) {
196 if (childName.length() && childName[0]<32)
197 childName= childName.substr(1);
198
199 unsigned child = find_child(ind, childName);
200 // traverse to the child
201 if (child > 0) {
202 ind = child;
203 continue;
204 }
205 return DirEntry::End;
206 }
207
208 return ind;
209 }
210
211 unsigned OLE::DirTree::find_child(unsigned ind, const std::string &name) const
212 {
213 DirEntry const *p = entry(ind);
214 if (!p || !p->m_valid) return 0;
215 auto siblingsList = get_siblings(p->m_child);
216 for (auto id : siblingsList) {
217 p = entry(id);
218 if (!p) continue;
219 if (p->name()==name)
220 return id;
221 }
222 return 0;
223 }
224
225 void OLE::DirTree::get_siblings(unsigned ind, std::set<unsigned> &seens) const
226 {
227 if (seens.find(ind) != seens.end())
228 return;
229 seens.insert(ind);
230 DirEntry const *e = entry(ind);
231 if (!e) return;
232 unsigned cnt = size();
233 if (e->m_left>0&& e->m_left < cnt)
234 get_siblings(e->m_left, seens);
235 if (e->m_right>0 && e->m_right < cnt)
236 get_siblings(e->m_right, seens);
237 }
238
239 ////////////////////////////////////////////////////////////
240 // alloc table function
241 ////////////////////////////////////////////////////////////
242 std::vector<unsigned long> OLE::AllocTable::follow(unsigned long start) const
243 {
244 std::vector<unsigned long> chain;
245 if (start >= count()) return chain;
246
247 std::set<unsigned long> seens;
248 unsigned long p = start;
249 while (p < count()) {
250 if (p >= 0xfffffffc) break;
251 if (seens.find(p) != seens.end()) break;
252 seens.insert(p);
253 chain.push_back(p);
254 p = m_data[ p ];
255 }
256
257 return chain;
258 }
259
260 ////////////////////////////////////////////////////////////
261 // OLE
262 ////////////////////////////////////////////////////////////
263 bool OLE::initAllocTables()
264 {
265 auto const maxN = size_t(m_header.m_sizeBats[BigBat]/4);
266 auto const numBats = size_t(m_header.m_numBats[BigBatAlloc]);
267 // first we need to find the file position of the big bat alloc table
268 auto bigBatAlloc = m_header.m_bigBatAlloc;
269 if (numBats > 109) {
270 bigBatAlloc.resize(numBats, Eof);
271 size_t k = 109;
272 unsigned sector=m_header.m_startBats[MetaBat];
273 for (unsigned r = 0; r < m_header.m_numBats[MetaBat]; r++) {
274 if (sector >= 0xfffffffc) {
275 MWAW_DEBUG_MSG(("OLE::initAllocTables: can not find meta block position\n"));
276 return false;
277 }
278 m_input.seek(long(m_header.getBigBlockPos(sector)), InputStream::SK_SET);
279 if (m_input.atEOS()) {
280 MWAW_DEBUG_MSG(("OLE::initAllocTables: can not read a meta block\n"));
281 return false;
282 }
283
284 for (size_t s=0; s < maxN; s++) {
285 if (k >= numBats)
286 break;
287 if (s==maxN-1)
288 sector = static_cast<unsigned>(readU32(m_input));
289 else
290 bigBatAlloc[k++] = static_cast<unsigned long>(readU32(m_input));
291 }
292 if (k >= numBats)
293 break;
294 }
295 if (k != numBats) {
296 MWAW_DEBUG_MSG(("OLE::initAllocTables: can not read all bigbat position\n"));
297 return false;
298 }
299 }
300
301 // read the big block alloc table
302 unsigned long numBBats=static_cast<unsigned long>(numBats) * static_cast<unsigned long>(maxN);
303 m_allocTable[BigBat].resize(numBBats);
304 unsigned long pos = 0;
305 for (size_t k=0; k < numBats; k++) {
306 m_input.seek(long(m_header.getBigBlockPos(static_cast<unsigned>(bigBatAlloc[k]))), InputStream::SK_SET);
307 for (size_t s=0; s < maxN; s++) {
308 if (m_input.atEOS()) {
309 MWAW_DEBUG_MSG(("OLE::initAllocTables: can not read a big alloc table block\n"));
310 return false;
311 }
312 auto val = static_cast<unsigned long>(readU32(m_input));
313 if (val >= 0xfffffffc)
314 m_allocTable[BigBat][pos++] = Eof;
315 else
316 m_allocTable[BigBat][pos++] = val;
317 }
318 }
319 // read the small bat alloc table
320 auto smallBlocks = m_allocTable[BigBat].follow(m_header.m_startBats[SmallBat]);
321 unsigned long numSBats=static_cast<unsigned long>(smallBlocks.size()) * static_cast<unsigned long>(maxN);
322 m_allocTable[SmallBat].resize(numSBats);
323 pos = 0;
324 for (auto id : smallBlocks) {
325 m_input.seek(long(m_header.getBigBlockPos(static_cast<unsigned>(id))), InputStream::SK_SET);
326 for (size_t s=0; s < maxN; s++) {
327 if (m_input.atEOS()) {
328 MWAW_DEBUG_MSG(("OLE::initAllocTables: can not read a small alloc table block\n"));
329 return false;
330 }
331 auto val = static_cast<unsigned long>(readU32(m_input));
332 if (val >= 0xfffffffc)
333 m_allocTable[SmallBat][pos++] = Eof;
334 else
335 m_allocTable[SmallBat][pos++] = val;
336 }
337 }
338 return true;
339 }
340
341 bool OLE::init()
342 {
343 if (m_status!=S_Unchecked)
344 return m_status==S_Ok;
345 m_status=S_Bad;
346 if (!m_header.read(m_input) || !initAllocTables())
347 return false;
348
349 // load directory tree
350 auto dirBlocks = m_allocTable[BigBat].follow(m_header.m_startBats[Dirent]);
351 if (!dirBlocks.size())
352 return false;
353 auto const maxDir = size_t(m_header.m_sizeBats[BigBat]/128);
354 unsigned numDBats=static_cast<unsigned>(dirBlocks.size()) * static_cast<unsigned>(maxDir);
355 m_dirTree.resize(numDBats);
356 unsigned pos = 0;
357 for (auto id : dirBlocks) {
358 auto fPos = long(m_header.getBigBlockPos(static_cast<unsigned>(id)));
359 for (size_t s=0; s < maxDir; s++) {
360 m_input.seek(fPos+long(128*s), InputStream::SK_SET);
361 if (m_input.atEOS() || !m_dirTree.entry(pos++)->read(m_input)) {
362 MWAW_DEBUG_MSG(("OLE::init: can not read a dir block\n"));
363 return false;
364 }
365 }
366 }
367 m_smallBlockPos = m_allocTable[BigBat].follow(m_dirTree.entry(0)->m_start);
368 m_status=S_Ok;
369 return true;
370 }
371
372 std::string OLE::getCLSIDType()
373 {
374 if (!init())
375 return "";
376 // get the root dir entry and the main clsid
377 DirEntry *entry=m_dirTree.entry(0);
378 if (!entry) return "";
379 return getCLSIDType(entry->m_clsid);
380 }
381
382 std::string OLE::getCompObjType()
383 {
384 if (!init())
385 return "";
386 std::vector<unsigned char> buf;
387 if (!load("/CompObj", buf))
388 return "";
389 if (buf.size() < 28)
390 return "";
391 StringStream stream(&buf[0], static_cast<unsigned long>(buf.size()));
392 stream.seek(12, InputStream::SK_SET);
393 unsigned clsId[4];
394 for (auto &id : clsId) id=static_cast<unsigned>(readU32(stream));
395 MWAW_DEBUG_MSG(("Find: %x %x %x %x\n", clsId[0], clsId[1], clsId[2], clsId[3]));
396 return getCLSIDType(clsId);
397 }
398
399 std::string OLE::getClipName()
400 {
401 if (!init())
402 return "";
403 std::vector<unsigned char> buf;
404 if (!load("/SummaryInformation", buf))
405 return "";
406 if (buf.size() < 50)
407 return "";
408 StringStream stream(&buf[0], static_cast<unsigned long>(buf.size()));
409 stream.seek(0, InputStream::SK_SET);
410 // first check header
411 unsigned short sVal=readU16(stream);
412 bool inverted=true;
413 if (sVal==0xfeff)
414 inverted=false;
415 else if (sVal!=0xfffe)
416 return "";
417 stream.seek(44, InputStream::SK_SET);
418 // find the first data position
419 auto dataPos=readU32(stream, inverted);
420 auto streamLen = static_cast<unsigned int>(stream.length());
421 if (streamLen<50 || dataPos>=streamLen-8)
422 return "";
423 stream.seek(dataPos, InputStream::SK_SET);
424 auto dataLen=readU32(stream, inverted);
425 auto N=readU32(stream, inverted);
426 if (dataLen>streamLen-dataPos || dataLen<8 || (dataLen-8)/8<N)
427 return "";
428 for (unsigned int v=0; v<N; ++v) {
429 auto id=readU32(stream, inverted);
430 auto depl=readU32(stream, inverted);
431 if (id != 18) // this is not the clipname
432 continue;
433 if (depl<8+8*N || depl+4>dataLen) // we have a problem, stop
434 return "";
435 stream.seek(dataPos+depl, InputStream::SK_SET);
436 auto fieldType=readU32(stream, inverted);
437 if (fieldType!=0x1e) // not a string field
438 return "";
439 auto fieldSize=readU32(stream, inverted);
440 if (fieldSize==0 || fieldSize>=dataLen || dataLen-depl<8+fieldSize)
441 return "";
442 unsigned long nRead;
443 unsigned char const *data = stream.read(fieldSize, nRead);
444 if (!data || nRead!=static_cast<unsigned long>(fieldSize)) return "";
445 std::string res("OLE ");
446 bool ok=false;
447 for (unsigned int c=0; c<fieldSize; ++c) {
448 auto ch=*(data++);
449 if (ch==0) break;
450 if (ch>=0x20 && ch<0x7f) {
451 ok=true;
452 res+=char(ch);
453 }
454 else
455 res+="_";
456 }
457 return ok ? res : "";
458 }
459 return "";
460 }
461 bool OLE::load(std::string const &name, std::vector<unsigned char> &buffer)
462 {
463 if (!init())
464 return false;
465 DirEntry *e = name.length() ? m_dirTree.entry(name) : 0;
466 if (!e || e->is_dir() || !e->m_size) {
467 buffer.resize(0);
468 return false;
469 }
470 buffer.resize(size_t(e->m_size));
471 bool useBig=useBigBlockFor(e->m_size);
472 auto blocks=m_allocTable[useBig ? BigBat : SmallBat].follow(e->m_start);
473 auto blockSize=static_cast<unsigned long>(m_header.m_sizeBats[useBig ? BigBat : SmallBat]);
474 unsigned long wPos = 0;
475 for (auto id : blocks) {
476 long pos=getDataAddress(static_cast<unsigned>(id), useBig);
477 if (pos <= 0) {
478 MWAW_DEBUG_MSG(("OLE::load: oops can not find block address\n"));
479 buffer.resize(0);
480 return false;
481 }
482 m_input.seek(pos, InputStream::SK_SET);
483 if (m_input.atEOS() || m_input.tell()!=pos) {
484 MWAW_DEBUG_MSG(("OLE::load: oops can not go to file position\n"));
485 buffer.resize(0);
486 return false;
487 }
488 unsigned long toRead=e->m_size-wPos, read;
489 if (toRead>blockSize) toRead=blockSize;
490 unsigned char const *buf=m_input.read(toRead, read);
491 if (!buf || read!=toRead) {
492 MWAW_DEBUG_MSG(("OLE::load: oops can not read data\n"));
493 buffer.resize(0);
494 return false;
495 }
496 memcpy(&buffer[wPos], buf, size_t(read));
497 wPos += read;
498 if (wPos >= e->m_size) break;
499 }
500 return true;
501 }
502
503 std::string OLE::getCLSIDType(unsigned const(&clsid)[4])
504 {
505 // do not accept not standart ole
506 if (clsid[1] != 0 || clsid[2] != 0xC0 || clsid[3] != 0x46000000L)
507 return "";
508
509 switch (clsid[0]) {
510 case 0x00000319:
511 return "OLE file(EMH-picture?)"; // addon Enhanced Metafile ( find in some file)
512
513 case 0x00020906:
514 return "OLE file(MSWord mac)";
515 case 0x00021290:
516 return "OLE file(MSClipArtGalley2)";
517 case 0x000212F0:
518 return "OLE file(MSWordArt)"; // or MSWordArt.2
519 case 0x00021302:
520 return "OLE file(MSWorksWPDoc)"; // addon
521
522 // MS Apps
523 case 0x00030000:
524 return "OLE file(ExcelWorksheet)";
525 case 0x00030001:
526 return "OLE file(ExcelChart)";
527 case 0x00030002:
528 return "OLE file(ExcelMacrosheet)";
529 case 0x00030003:
530 return "OLE file(WordDocument)";
531 case 0x00030004:
532 return "OLE file(MSPowerPoint)";
533 case 0x00030005:
534 return "OLE file(MSPowerPointSho)";
535 case 0x00030006:
536 return "OLE file(MSGraph)";
537 case 0x00030007:
538 return "OLE file(MSDraw)"; // find also ca003 ?
539 case 0x00030008:
540 return "OLE file(Note-It)";
541 case 0x00030009:
542 return "OLE file(WordArt)";
543 case 0x0003000a:
544 return "OLE file(PBrush)";
545 case 0x0003000b:
546 return "OLE file(Microsoft Equation)"; // "Microsoft Equation Editor"
547 case 0x0003000c:
548 return "OLE file(Package)";
549 case 0x0003000d:
550 return "OLE file(SoundRec)";
551 case 0x0003000e:
552 return "OLE file(MPlayer)";
553 // MS Demos
554 case 0x0003000f:
555 return "OLE file(ServerDemo)"; // "OLE 1.0 Server Demo"
556 case 0x00030010:
557 return "OLE file(Srtest)"; // "OLE 1.0 Test Demo"
558 case 0x00030011:
559 return "OLE file(SrtInv)"; // "OLE 1.0 Inv Demo"
560 case 0x00030012:
561 return "OLE file(OleDemo)"; //"OLE 1.0 Demo"
562
563 // Coromandel / Dorai Swamy / 718-793-7963
564 case 0x00030013:
565 return "OLE file(CoromandelIntegra)";
566 case 0x00030014:
567 return "OLE file(CoromandelObjServer)";
568
569 // 3-d Visions Corp / Peter Hirsch / 310-325-1339
570 case 0x00030015:
571 return "OLE file(StanfordGraphics)";
572
573 // Deltapoint / Nigel Hearne / 408-648-4000
574 case 0x00030016:
575 return "OLE file(DGraphCHART)";
576 case 0x00030017:
577 return "OLE file(DGraphDATA)";
578
579 // Corel / Richard V. Woodend / 613-728-8200 x1153
580 case 0x00030018:
581 return "OLE file(CorelPhotoPaint)"; // "Corel PhotoPaint"
582 case 0x00030019:
583 return "OLE file(CorelShow)"; // "Corel Show"
584 case 0x0003001a:
585 return "OLE file(CorelChart)";
586 case 0x0003001b:
587 return "OLE file(CorelDraw)"; // "Corel Draw"
588
589 // Inset Systems / Mark Skiba / 203-740-2400
590 case 0x0003001c:
591 return "OLE file(HJWIN1.0)"; // "Inset Systems"
592
593 // Mark V Systems / Mark McGraw / 818-995-7671
594 case 0x0003001d:
595 return "OLE file(MarkV ObjMakerOLE)"; // "MarkV Systems Object Maker"
596
597 // IdentiTech / Mike Gilger / 407-951-9503
598 case 0x0003001e:
599 return "OLE file(IdentiTech FYI)"; // "IdentiTech FYI"
600 case 0x0003001f:
601 return "OLE file(IdentiTech FYIView)"; // "IdentiTech FYI Viewer"
602
603 // Inventa Corporation / Balaji Varadarajan / 408-987-0220
604 case 0x00030020:
605 return "OLE file(Stickynote)";
606
607 // ShapeWare Corp. / Lori Pearce / 206-467-6723
608 case 0x00030021:
609 return "OLE file(ShapewareVISIO10)";
610 case 0x00030022:
611 return "OLE file(Shapeware ImportServer)"; // "Spaheware Import Server"
612
613 // test app SrTest
614 case 0x00030023:
615 return "OLE file(SrvrTest)"; // "OLE 1.0 Server Test"
616
617 // test app ClTest. Doesn't really work as a server but is in reg db
618 case 0x00030025:
619 return "OLE file(Cltest)"; // "OLE 1.0 Client Test"
620
621 // Microsoft ClipArt Gallery Sherry Larsen-Holmes
622 case 0x00030026:
623 return "OLE file(MS_ClipArt_Gallery)";
624 // Microsoft Project Cory Reina
625 case 0x00030027:
626 return "OLE file(MSProject)";
627
628 // Microsoft Works Chart
629 case 0x00030028:
630 return "OLE file(MSWorksChart)";
631
632 // Microsoft Works Spreadsheet
633 case 0x00030029:
634 return "OLE file(MSWorksSpreadsheet)";
635
636 // AFX apps - Dean McCrory
637 case 0x0003002A:
638 return "OLE file(MinSvr)"; // "AFX Mini Server"
639 case 0x0003002B:
640 return "OLE file(HierarchyList)"; // "AFX Hierarchy List"
641 case 0x0003002C:
642 return "OLE file(BibRef)"; // "AFX BibRef"
643 case 0x0003002D:
644 return "OLE file(MinSvrMI)"; // "AFX Mini Server MI"
645 case 0x0003002E:
646 return "OLE file(TestServ)"; // "AFX Test Server"
647
648 // Ami Pro
649 case 0x0003002F:
650 return "OLE file(AmiProDocument)";
651
652 // WordPerfect Presentations For Windows
653 case 0x00030030:
654 return "OLE file(WPGraphics)";
655 case 0x00030031:
656 return "OLE file(WPCharts)";
657
658 // MicroGrafx Charisma
659 case 0x00030032:
660 return "OLE file(Charisma)";
661 case 0x00030033:
662 return "OLE file(Charisma_30)"; // v 3.0
663 case 0x00030034:
664 return "OLE file(CharPres_30)"; // v 3.0 Pres
665 // MicroGrafx Draw
666 case 0x00030035:
667 return "OLE file(MicroGrafx Draw)"; //"MicroGrafx Draw"
668 // MicroGrafx Designer
669 case 0x00030036:
670 return "OLE file(MicroGrafx Designer_40)"; // "MicroGrafx Designer 4.0"
671
672 // STAR DIVISION
673 case 0x000424CA:
674 return "OLE file(StarMath)"; // "StarMath 1.0"
675 case 0x00043AD2:
676 return "OLE file(Star FontWork)"; // "Star FontWork"
677 case 0x000456EE:
678 return "OLE file(StarMath2)"; // "StarMath 2.0"
679 default:
680 MWAW_DEBUG_MSG(("OLE::getCLSIDType: Find unknown clsid=%ux\n", clsid[0]));
681 case 0:
682 break;
683 }
684
685 return "";
686 }
687 }
688
689 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab: