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

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

Created (WINE Port of OLEAUT32)

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