source: trunk/src/oleaut32/oleaut32.cpp@ 631

Last change on this file since 631 was 631, checked in by sandervl, 26 years ago

Created (WINE Port of OLEAUT32)

File size: 2.3 KB
Line 
1/*
2 * OLEAUT32
3 *
4 * Copyright 1999 Sander van Leeuwen (OS/2 Port 990815)
5 *
6 * Based on Wine code: (ole\compobj.c)
7 *
8 * Copyright 1995 Martin von Loewis
9 * Copyright 1998 Justin Bradford
10 * Copyright 1999 Francis Beaudet
11 * Copyright 1999 Sylvain St-Germain
12 *
13 * Project Odin Software License can be found in LICENSE.TXT
14 *
15 * TODO: WINE_StringFromCLSID should be imported from ole32.dll
16 * TODO: OaBuildVersion has to be changed (as well as GetVersion in kernel32)
17 */
18
19#include "oleaut32.h"
20#ifdef DEBUG
21#define DEBUG_RUNTIME
22#endif
23
24#include <debugdefs.h>
25
26
27/******************************************************************************
28 * WINE_StringFromCLSID [Internal]
29 * Converts a GUID into the respective string representation.
30 *
31 * NOTES
32 *
33 * RETURNS
34 * the string representation and OLESTATUS
35 */
36HRESULT WINE_StringFromCLSID(
37 const CLSID *id, /* [in] GUID to be converted */
38 LPSTR idstr /* [out] pointer to buffer to contain converted guid */
39) {
40 static const char *hex = "0123456789ABCDEF";
41 char *s;
42 int i;
43
44 if (!id)
45 { dprintf(("called with id=Null\n"));
46 *idstr = 0x00;
47 return E_FAIL;
48 }
49
50 sprintf(idstr, "{%08lX-%04X-%04X-%02X%02X-",
51 id->Data1, id->Data2, id->Data3,
52 id->Data4[0], id->Data4[1]);
53 s = &idstr[25];
54
55 /* 6 hex bytes */
56 for (i = 2; i < 8; i++) {
57 *s++ = hex[id->Data4[i]>>4];
58 *s++ = hex[id->Data4[i] & 0xf];
59 }
60
61 *s++ = '}';
62 *s++ = '\0';
63
64 dprintf(("%p->%s\n", id, idstr));
65
66 return OLE_OK;
67}
68
69
70/***********************************************************************
71 * OaBuildVersion [OLEAUT32.170]
72 */
73UINT WINAPI OaBuildVersion()
74{
75#if 1
76 return 0x141016;
77#else
78 WINDOWS_VERSION ver = VERSION_GetVersion();
79
80 FIXME("Please report to a.mohr@mailto.de if you get version error messages !\n");
81 switch(VersionData[ver].getVersion32)
82 {
83 case 0x80000a03: /* Win 3.1 */
84 return 0x140fd1; /* from Win32s 1.1e */
85 case 0xc0000004: /* Win 95 */
86 case 0xc0000a04: /* Win 98: verified same as Win95 */
87 return 0x1e10a9; /* some older version: 0x0a0bd3 */
88 case 0x04213303: /* NT 3.51 */
89 FIXME("NT 3.51 version value unknown !\n");
90 return 0x1e10a9; /* value borrowed from Win95 */
91 case 0x05650004: /* NT 4.0 */
92 return 0x141016;
93 default:
94 return 0x0;
95 }
96#endif
97}
Note: See TracBrowser for help on using the repository browser.