Skip to content

Commit

Permalink
Implement OLESVR.DLL
Browse files Browse the repository at this point in the history
  • Loading branch information
otya128 committed Jul 16, 2018
1 parent f5e1649 commit 9cd60e1
Show file tree
Hide file tree
Showing 14 changed files with 330 additions and 222 deletions.
7 changes: 6 additions & 1 deletion krnl386/global.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,12 @@ HGLOBAL16 WINAPI GlobalAlloc16(
STACK16FRAME *frame = CURRENT_STACK16;
owner = GetExePtr( frame->cs );
}
return GLOBAL_Alloc( flags, size, owner, WINE_LDT_FLAGS_DATA );
HGLOBAL16 handle = GLOBAL_Alloc( flags, size, owner, WINE_LDT_FLAGS_DATA );
if (!handle)
{
ERR("Could not allocate %04X,%08X\n", flags, size);
}
return handle;
}


Expand Down
50 changes: 36 additions & 14 deletions olecli/olecli.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,30 @@
*/

#include "config.h"

//?????
#define __oleidl_h__
#define _OLE2_H_
#include <stdarg.h>

#include "windef.h"
#include <windows.h>
#include <ole.h>
//#include "windef.h"
#include "wine/windef16.h"
#include "wine/winbase16.h"
#include "winbase.h"
#include "wingdi.h"
#include "wownt32.h"
#include "objbase.h"
#include "olecli.h"
//#include "olecli.h"
#include "wine/debug.h"

typedef LONG LHCLIENTDOC;
typedef struct _OLEOBJECT *_LPOLEOBJECT;
typedef struct _OLECLIENT *LPOLECLIENT;
typedef OLEOPT_UPDATE *LPOLEOPT_UPDATE;
typedef LPCSTR LPCOLESTR16;

struct _OLESTREAM;
WINE_DEFAULT_DEBUG_CHANNEL(ole);

typedef struct _OLEOBJECTVTBL16 {
Expand Down Expand Up @@ -76,12 +87,12 @@ typedef struct _OLEOBJECTVTBL16 {
OLE_RELEASE_METHOD (CALLBACK *QueryReleaseMethod)(_LPOLEOBJECT);
OLESTATUS (CALLBACK *RequestData)(_LPOLEOBJECT,OLECLIPFORMAT);
OLESTATUS (CALLBACK *ObjectLong)(_LPOLEOBJECT,UINT16,LPLONG);
} OLEOBJECTVTBL;
typedef OLEOBJECTVTBL *LPOLEOBJECTVTBL;
} OLEOBJECTVTBL16;
typedef OLEOBJECTVTBL16 *LPOLEOBJECTVTBL16;

typedef struct _OLEOBJECT
typedef struct _OLEOBJECT16
{
const OLEOBJECTVTBL *lpvtbl;
const OLEOBJECTVTBL16 *lpvtbl;
} OLEOBJECT16;

static LONG OLE_current_handle;
Expand Down Expand Up @@ -185,9 +196,14 @@ BOOL16 WINAPI OleIsDcMeta16(HDC16 hdc)
/******************************************************************************
* OleQueryType [OLECLI.14]
*/
OLESTATUS WINAPI OleQueryType16(_LPOLEOBJECT oleob, SEGPTR xlong) {
FIXME("(%p, %p): stub!\n", oleob, MapSL(xlong));
return OLE_OK;
OLESTATUS WINAPI OleQueryType16(OLEOBJECT16 *oleob, SEGPTR xlong) {
OLEOBJECT oleobject32;
oleobject32.lpvtbl = MapSL(oleob->lpvtbl);
OLESTATUS result = OleQueryType(&oleobject32, MapSL(xlong));
oleob->lpvtbl = MapLS(oleobject32.lpvtbl);
return result;
//FIXME("(%p, %p): stub!\n", oleob, MapSL(xlong));
//return OLE_OK;
}

/******************************************************************************
Expand All @@ -197,8 +213,14 @@ OLESTATUS WINAPI OleCreateFromClip16( LPCSTR name, SEGPTR olecli, LHCLIENTDOC hc
LPCSTR xname, SEGPTR lpoleob,
UINT16 render, UINT16 clipformat )
{
FIXME("(%s, %04x:%04x, %d, %s, %04x:%04x, %d, %d): stub!\n",
name, HIWORD(olecli), LOWORD(olecli), hclientdoc, xname, HIWORD(lpoleob),
LOWORD(lpoleob), render, clipformat);
return OLE_OK;
return OleCreateFromClip(name, MapSL(olecli), MapSL(hclientdoc), xname, MapSL(lpoleob), render, clipformat);
//FIXME("(%s, %04x:%04x, %d, %s, %04x:%04x, %d, %d): stub!\n",
// name, HIWORD(olecli), LOWORD(olecli), hclientdoc, xname, HIWORD(lpoleob),
// LOWORD(lpoleob), render, clipformat);
//return OLE_OK;
}

DWORD WINAPI OleQueryClientVersion16()
{
return OleQueryClientVersion();
}
42 changes: 21 additions & 21 deletions olecli/olecli.dll16.asm
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ _wine_spec_dos_header:
.short 57
.byte 0x12,0x4f,0x4c,0x45,0x43,0x52,0x45,0x41,0x54,0x45,0x49,0x4e,0x56,0x49,0x53,0x49,0x42,0x4c,0x45 /* OLECREATEINVISIBLE */
.short 58
.byte 0x15,0x4f,0x4c,0x45,0x51,0x55,0x45,0x52,0x59,0x43,0x4c,0x49,0x45,0x4e,0x54,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e /* OLEQUERYCLIENTVERSION */
.byte 0x15,0x4f,0x4c,0x45,0x51,0x55,0x45,0x52,0x59,0x43,0x4c,0x49,0x45,0x4e,0x54,0x56,0x45,0x52,0x53,0x49,0x4f,0x4e /* OleQueryClientVersion */
.short 59
.byte 0x0b,0x4f,0x4c,0x45,0x49,0x53,0x44,0x43,0x4d,0x45,0x54,0x41 /* OleIsDcMeta */
.short 60
Expand Down Expand Up @@ -928,6 +928,15 @@ _wine_spec_dos_header:

.align 2
.L__wine_spec_code_segment:
.L__wine_spec_callfrom16_p_long_:
pushl $.L__wine_spec_call16_p_
lcall $0,$0
shld $16,%eax,%edx
orl %eax,%eax
lretw
.byte 0x89,0xf6
.short 0x86c7
.long 0x00000000,0x00000000
.L__wine_spec_callfrom16_p_long_l:
pushl $.L__wine_spec_call16_p_l
lcall $0,$0
Expand Down Expand Up @@ -1229,8 +1238,8 @@ _wine_spec_dos_header:
callw .L__wine_spec_callfrom16_c_long_
.L__wine_OLECLI_59:
pushw %bp
pushl $___wine_stub_OLEQUERYCLIENTVERSION
callw .L__wine_spec_callfrom16_c_long_
pushl $_OleQueryClientVersion16@0
callw .L__wine_spec_callfrom16_p_long_
.L__wine_OLECLI_60:
pushw %bp
pushl $_OleIsDcMeta16@4
Expand Down Expand Up @@ -1744,6 +1753,15 @@ _wine_spec_dos_header:
leave
ret
.align 4
.def .L__wine_spec_call16_p_; .scl 2; .type 32; .endef
.L__wine_spec_call16_p_:
pushl %ebp
movl %esp,%ebp
subl $8,%esp
call *8(%ebp)
leave
ret
.align 4
.def .L__wine_spec_call16_p_l; .scl 2; .type 32; .endef
.L__wine_spec_call16_p_l:
pushl %ebp
Expand Down Expand Up @@ -2576,22 +2594,6 @@ ___wine_stub_OLECREATEINVISIBLE:
movl $.L__wine_spec_file_name,(%esp)
call ___wine_spec_unimplemented_stub
.align 4
.def ___wine_stub_OLEQUERYCLIENTVERSION; .scl 2; .type 32; .endef
___wine_stub_OLEQUERYCLIENTVERSION:
nop
nop
nop
nop
nop
nop
nop
nop
nop
subl $12,%esp
movl $.L__wine_stub_OLEQUERYCLIENTVERSION_string,4(%esp)
movl $.L__wine_spec_file_name,(%esp)
call ___wine_spec_unimplemented_stub
.align 4
.def ___wine_stub_DOCWNDPROC; .scl 2; .type 32; .endef
___wine_stub_DOCWNDPROC:
nop
Expand Down Expand Up @@ -4628,8 +4630,6 @@ ___wine_stub_GETTASKVISIBLEWINDOW:
.string "OLEEXECUTE"
.L__wine_stub_OLECREATEINVISIBLE_string:
.string "OLECREATEINVISIBLE"
.L__wine_stub_OLEQUERYCLIENTVERSION_string:
.string "OLEQUERYCLIENTVERSION"
.L__wine_stub_DOCWNDPROC_string:
.string "DOCWNDPROC"
.L__wine_stub_SRVRWNDPROC_string:
Expand Down
2 changes: 1 addition & 1 deletion olecli/olecli.dll16.spec
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
56 stub OLEQUERYSIZE
57 stub OLEEXECUTE
58 stub OLECREATEINVISIBLE
59 stub OLEQUERYCLIENTVERSION
59 pascal OleQueryClientVersion() OleQueryClientVersion16
60 pascal -ret16 OleIsDcMeta(word) OleIsDcMeta16
100 stub DOCWNDPROC
101 stub SRVRWNDPROC
Expand Down
5 changes: 2 additions & 3 deletions olecli/olecli.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
<AdditionalDependencies>olecli32.lib;ole32.lib;$(OutDir)winecrt0.lib;$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<GenerateDebugInformation>true</GenerateDebugInformation>
<ModuleDefinitionFile>
Expand Down Expand Up @@ -91,13 +91,12 @@ olecli.def
<ModuleDefinitionFile>
olecli.def
</ModuleDefinitionFile>
<AdditionalDependencies>$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
<AdditionalDependencies>olecli32.lib;ole32.lib;$(OutDir)winecrt0.lib;$(OutDir)libwine.lib;$(OutDir)wow32.lib;$(OutDir)krnl386.lib;
gdi32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="olecli.c" />
<ClCompile Include="stub.c" />
</ItemGroup>
<ItemGroup>
<Object Include="olecli.dll16.obj" />
Expand Down
15 changes: 0 additions & 15 deletions olecli/stub.c

This file was deleted.

Loading

0 comments on commit 9cd60e1

Please sign in to comment.