Skip to content

Commit 9cd60e1

Browse files
committed
Implement OLESVR.DLL
1 parent f5e1649 commit 9cd60e1

File tree

14 files changed

+330
-222
lines changed

14 files changed

+330
-222
lines changed

krnl386/global.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,12 @@ HGLOBAL16 WINAPI GlobalAlloc16(
274274
STACK16FRAME *frame = CURRENT_STACK16;
275275
owner = GetExePtr( frame->cs );
276276
}
277-
return GLOBAL_Alloc( flags, size, owner, WINE_LDT_FLAGS_DATA );
277+
HGLOBAL16 handle = GLOBAL_Alloc( flags, size, owner, WINE_LDT_FLAGS_DATA );
278+
if (!handle)
279+
{
280+
ERR("Could not allocate %04X,%08X\n", flags, size);
281+
}
282+
return handle;
278283
}
279284

280285

olecli/olecli.c

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,30 @@
2222
*/
2323

2424
#include "config.h"
25-
25+
//?????
26+
#define __oleidl_h__
27+
#define _OLE2_H_
2628
#include <stdarg.h>
2729

28-
#include "windef.h"
30+
#include <windows.h>
31+
#include <ole.h>
32+
//#include "windef.h"
2933
#include "wine/windef16.h"
3034
#include "wine/winbase16.h"
3135
#include "winbase.h"
3236
#include "wingdi.h"
3337
#include "wownt32.h"
3438
#include "objbase.h"
35-
#include "olecli.h"
39+
//#include "olecli.h"
3640
#include "wine/debug.h"
3741

42+
typedef LONG LHCLIENTDOC;
43+
typedef struct _OLEOBJECT *_LPOLEOBJECT;
44+
typedef struct _OLECLIENT *LPOLECLIENT;
45+
typedef OLEOPT_UPDATE *LPOLEOPT_UPDATE;
46+
typedef LPCSTR LPCOLESTR16;
47+
48+
struct _OLESTREAM;
3849
WINE_DEFAULT_DEBUG_CHANNEL(ole);
3950

4051
typedef struct _OLEOBJECTVTBL16 {
@@ -76,12 +87,12 @@ typedef struct _OLEOBJECTVTBL16 {
7687
OLE_RELEASE_METHOD (CALLBACK *QueryReleaseMethod)(_LPOLEOBJECT);
7788
OLESTATUS (CALLBACK *RequestData)(_LPOLEOBJECT,OLECLIPFORMAT);
7889
OLESTATUS (CALLBACK *ObjectLong)(_LPOLEOBJECT,UINT16,LPLONG);
79-
} OLEOBJECTVTBL;
80-
typedef OLEOBJECTVTBL *LPOLEOBJECTVTBL;
90+
} OLEOBJECTVTBL16;
91+
typedef OLEOBJECTVTBL16 *LPOLEOBJECTVTBL16;
8192

82-
typedef struct _OLEOBJECT
93+
typedef struct _OLEOBJECT16
8394
{
84-
const OLEOBJECTVTBL *lpvtbl;
95+
const OLEOBJECTVTBL16 *lpvtbl;
8596
} OLEOBJECT16;
8697

8798
static LONG OLE_current_handle;
@@ -185,9 +196,14 @@ BOOL16 WINAPI OleIsDcMeta16(HDC16 hdc)
185196
/******************************************************************************
186197
* OleQueryType [OLECLI.14]
187198
*/
188-
OLESTATUS WINAPI OleQueryType16(_LPOLEOBJECT oleob, SEGPTR xlong) {
189-
FIXME("(%p, %p): stub!\n", oleob, MapSL(xlong));
190-
return OLE_OK;
199+
OLESTATUS WINAPI OleQueryType16(OLEOBJECT16 *oleob, SEGPTR xlong) {
200+
OLEOBJECT oleobject32;
201+
oleobject32.lpvtbl = MapSL(oleob->lpvtbl);
202+
OLESTATUS result = OleQueryType(&oleobject32, MapSL(xlong));
203+
oleob->lpvtbl = MapLS(oleobject32.lpvtbl);
204+
return result;
205+
//FIXME("(%p, %p): stub!\n", oleob, MapSL(xlong));
206+
//return OLE_OK;
191207
}
192208

193209
/******************************************************************************
@@ -197,8 +213,14 @@ OLESTATUS WINAPI OleCreateFromClip16( LPCSTR name, SEGPTR olecli, LHCLIENTDOC hc
197213
LPCSTR xname, SEGPTR lpoleob,
198214
UINT16 render, UINT16 clipformat )
199215
{
200-
FIXME("(%s, %04x:%04x, %d, %s, %04x:%04x, %d, %d): stub!\n",
201-
name, HIWORD(olecli), LOWORD(olecli), hclientdoc, xname, HIWORD(lpoleob),
202-
LOWORD(lpoleob), render, clipformat);
203-
return OLE_OK;
216+
return OleCreateFromClip(name, MapSL(olecli), MapSL(hclientdoc), xname, MapSL(lpoleob), render, clipformat);
217+
//FIXME("(%s, %04x:%04x, %d, %s, %04x:%04x, %d, %d): stub!\n",
218+
// name, HIWORD(olecli), LOWORD(olecli), hclientdoc, xname, HIWORD(lpoleob),
219+
// LOWORD(lpoleob), render, clipformat);
220+
//return OLE_OK;
221+
}
222+
223+
DWORD WINAPI OleQueryClientVersion16()
224+
{
225+
return OleQueryClientVersion();
204226
}

olecli/olecli.dll16.asm

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ _wine_spec_dos_header:
257257
.short 57
258258
.byte 0x12,0x4f,0x4c,0x45,0x43,0x52,0x45,0x41,0x54,0x45,0x49,0x4e,0x56,0x49,0x53,0x49,0x42,0x4c,0x45 /* OLECREATEINVISIBLE */
259259
.short 58
260-
.byte 0x15,0x4f,0x4c,0x45,0x51,0x55,0x45,0x52,0x59,0x43,0x4c,0x49,0x45,0x4e,0x54,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e /* OLEQUERYCLIENTVERSION */
260+
.byte 0x15,0x4f,0x4c,0x45,0x51,0x55,0x45,0x52,0x59,0x43,0x4c,0x49,0x45,0x4e,0x54,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e /* OleQueryClientVersion */
261261
.short 59
262262
.byte 0x0b,0x4f,0x4c,0x45,0x49,0x53,0x44,0x43,0x4d,0x45,0x54,0x41 /* OleIsDcMeta */
263263
.short 60
@@ -928,6 +928,15 @@ _wine_spec_dos_header:
928928

929929
.align 2
930930
.L__wine_spec_code_segment:
931+
.L__wine_spec_callfrom16_p_long_:
932+
pushl $.L__wine_spec_call16_p_
933+
lcall $0,$0
934+
shld $16,%eax,%edx
935+
orl %eax,%eax
936+
lretw
937+
.byte 0x89,0xf6
938+
.short 0x86c7
939+
.long 0x00000000,0x00000000
931940
.L__wine_spec_callfrom16_p_long_l:
932941
pushl $.L__wine_spec_call16_p_l
933942
lcall $0,$0
@@ -1229,8 +1238,8 @@ _wine_spec_dos_header:
12291238
callw .L__wine_spec_callfrom16_c_long_
12301239
.L__wine_OLECLI_59:
12311240
pushw %bp
1232-
pushl $___wine_stub_OLEQUERYCLIENTVERSION
1233-
callw .L__wine_spec_callfrom16_c_long_
1241+
pushl $_OleQueryClientVersion16@0
1242+
callw .L__wine_spec_callfrom16_p_long_
12341243
.L__wine_OLECLI_60:
12351244
pushw %bp
12361245
pushl $_OleIsDcMeta16@4
@@ -1744,6 +1753,15 @@ _wine_spec_dos_header:
17441753
leave
17451754
ret
17461755
.align 4
1756+
.def .L__wine_spec_call16_p_; .scl 2; .type 32; .endef
1757+
.L__wine_spec_call16_p_:
1758+
pushl %ebp
1759+
movl %esp,%ebp
1760+
subl $8,%esp
1761+
call *8(%ebp)
1762+
leave
1763+
ret
1764+
.align 4
17471765
.def .L__wine_spec_call16_p_l; .scl 2; .type 32; .endef
17481766
.L__wine_spec_call16_p_l:
17491767
pushl %ebp
@@ -2576,22 +2594,6 @@ ___wine_stub_OLECREATEINVISIBLE:
25762594
movl $.L__wine_spec_file_name,(%esp)
25772595
call ___wine_spec_unimplemented_stub
25782596
.align 4
2579-
.def ___wine_stub_OLEQUERYCLIENTVERSION; .scl 2; .type 32; .endef
2580-
___wine_stub_OLEQUERYCLIENTVERSION:
2581-
nop
2582-
nop
2583-
nop
2584-
nop
2585-
nop
2586-
nop
2587-
nop
2588-
nop
2589-
nop
2590-
subl $12,%esp
2591-
movl $.L__wine_stub_OLEQUERYCLIENTVERSION_string,4(%esp)
2592-
movl $.L__wine_spec_file_name,(%esp)
2593-
call ___wine_spec_unimplemented_stub
2594-
.align 4
25952597
.def ___wine_stub_DOCWNDPROC; .scl 2; .type 32; .endef
25962598
___wine_stub_DOCWNDPROC:
25972599
nop
@@ -4628,8 +4630,6 @@ ___wine_stub_GETTASKVISIBLEWINDOW:
46284630
.string "OLEEXECUTE"
46294631
.L__wine_stub_OLECREATEINVISIBLE_string:
46304632
.string "OLECREATEINVISIBLE"
4631-
.L__wine_stub_OLEQUERYCLIENTVERSION_string:
4632-
.string "OLEQUERYCLIENTVERSION"
46334633
.L__wine_stub_DOCWNDPROC_string:
46344634
.string "DOCWNDPROC"
46354635
.L__wine_stub_SRVRWNDPROC_string:

olecli/olecli.dll16.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
56 stub OLEQUERYSIZE
5353
57 stub OLEEXECUTE
5454
58 stub OLECREATEINVISIBLE
55-
59 stub OLEQUERYCLIENTVERSION
55+
59 pascal OleQueryClientVersion() OleQueryClientVersion16
5656
60 pascal -ret16 OleIsDcMeta(word) OleIsDcMeta16
5757
100 stub DOCWNDPROC
5858
101 stub SRVRWNDPROC

olecli/olecli.vcxproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<Link>
6464
<SubSystem>Windows</SubSystem>
6565
<GenerateDebugInformation>true</GenerateDebugInformation>
66-
<AdditionalDependencies>$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
66+
<AdditionalDependencies>olecli32.lib;ole32.lib;$(OutDir)winecrt0.lib;$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
6767
gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
6868
<GenerateDebugInformation>true</GenerateDebugInformation>
6969
<ModuleDefinitionFile>
@@ -91,13 +91,12 @@ olecli.def
9191
<ModuleDefinitionFile>
9292
olecli.def
9393
</ModuleDefinitionFile>
94-
<AdditionalDependencies>$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
94+
<AdditionalDependencies>olecli32.lib;ole32.lib;$(OutDir)winecrt0.lib;$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
9595
gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
9696
</Link>
9797
</ItemDefinitionGroup>
9898
<ItemGroup>
9999
<ClCompile Include="olecli.c" />
100-
<ClCompile Include="stub.c" />
101100
</ItemGroup>
102101
<ItemGroup>
103102
<Object Include="olecli.dll16.obj" />

olecli/stub.c

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)