diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ole32/olethunk/ole16/storage | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/ole32/olethunk/ole16/storage')
-rw-r--r-- | private/ole32/olethunk/ole16/storage/headers.cxx | 21 | ||||
-rw-r--r-- | private/ole32/olethunk/ole16/storage/makefile | 44 | ||||
-rw-r--r-- | private/ole32/olethunk/ole16/storage/stgdthk.c | 307 | ||||
-rw-r--r-- | private/ole32/olethunk/ole16/storage/storage.c | 87 | ||||
-rw-r--r-- | private/ole32/olethunk/ole16/storage/storage.def | 49 | ||||
-rw-r--r-- | private/ole32/olethunk/ole16/storage/storage.rc | 33 |
6 files changed, 541 insertions, 0 deletions
diff --git a/private/ole32/olethunk/ole16/storage/headers.cxx b/private/ole32/olethunk/ole16/storage/headers.cxx new file mode 100644 index 000000000..f4a35afba --- /dev/null +++ b/private/ole32/olethunk/ole16/storage/headers.cxx @@ -0,0 +1,21 @@ +//+--------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1992 - 1993. +// +// File: headers.cxx +// +// Contents: Precompiled header file +// +// History: 18-Feb-94 DrewB Created +// +//---------------------------------------------------------------------------- + +#include <windows.h> +#include <string.h> +#include <compobj.h> +#include <storage.h> + +#include <interop.hxx> +#include <wow16fn.h> +#include <io16.h> diff --git a/private/ole32/olethunk/ole16/storage/makefile b/private/ole32/olethunk/ole16/storage/makefile new file mode 100644 index 000000000..622f7f913 --- /dev/null +++ b/private/ole32/olethunk/ole16/storage/makefile @@ -0,0 +1,44 @@ +# storage Thunk DLL makefile +# +# Copyright (c) 1991, Microsoft Corporation +# +# History: +# +# 18-Feb-1994 BobDay Adapted from MVDM\WOW16\GDI\MAKEFILE +# + +!IFDEF USEBUILD + +# If using BUILD.EXE, edit .\sources. if you want to add a new source +# file to this component. This file merely indirects to the real make file +# that is shared by all the components of NT OS/2. + +!INCLUDE $(NTMAKEENV)\makefile.def + +!ELSE + +default: copy_bin + +TARGET = storage.dll +CFILES = \ + .\storage.c\ + .\stgdthk.c +RCFILES = .\storage.rc +LIBS = $(LIBS) ..\lib\compobj.lib + +!if "$(NTDEBUG)" != "" && "$(NTDEBUG)" != "retail" +LIBS = $(LIBS) $(OLETHUNK)\debnot\$(OBJDIR)\debnot.lib +!endif + +!include ..\makefile.inc + +copy_bin: all + -binplace $(OBJDIR)\storage.dll + -binplace $(OBJDIR)\storage.sym + -binplace $(OBJDIR)\storage.map + +storage.obj: storage.c + +stgdthk.obj: stgdthk.c + +!ENDIF diff --git a/private/ole32/olethunk/ole16/storage/stgdthk.c b/private/ole32/olethunk/ole16/storage/stgdthk.c new file mode 100644 index 000000000..a706ead1b --- /dev/null +++ b/private/ole32/olethunk/ole16/storage/stgdthk.c @@ -0,0 +1,307 @@ +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1992 - 1993. +// +// File: stgdthk.cxx (16 bit target) +// +// Contents: Storage APIs that are directly thunked +// +// History: 17-Dec-93 JohannP Created +// +//-------------------------------------------------------------------------- + +#include <headers.cxx> +#pragma hdrstop + +#include <call32.hxx> +#include <apilist.hxx> + +//+--------------------------------------------------------------------------- +// +// Function: Straight thunk routines +// +// Synopsis: The following routines thunk straight through +// +// History: 24-Feb-94 DrewB Created +// +//---------------------------------------------------------------------------- + +STDAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void FAR* FAR* ppv) +{ + /* Relies on the fact that storage and ole2.dll both use the + same DllGetClassObject in ole32.dll */ + return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_DllGetClassObject), + PASCAL_STACK_PTR(clsid)); +} + +//+--------------------------------------------------------------------------- +// +// Function: StgCreateDocfile, Remoted +// +// Synopsis: +// +// Effects: +// +// Arguments: [pwcsName] -- +// [grfMode] -- +// [reserved] -- +// [ppstgOpen] -- +// +// Requires: +// +// Returns: +// +// Signals: +// +// Modifies: +// +// Algorithm: +// +// History: 2-28-94 DrewB Created +// +// Notes: +// +//---------------------------------------------------------------------------- +STDAPI StgCreateDocfile(const char FAR* pwcsName, + DWORD grfMode, + DWORD reserved, + IStorage FAR * FAR *ppstgOpen) +{ + return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgCreateDocfile), + PASCAL_STACK_PTR(pwcsName)); +} + +//+--------------------------------------------------------------------------- +// +// Function: StgCreateDocfileOnILockBytes, Remoted +// +// Synopsis: +// +// Effects: +// +// Arguments: [plkbyt] -- +// [grfMode] -- +// [reserved] -- +// [ppstgOpen] -- +// +// Requires: +// +// Returns: +// +// Signals: +// +// Modifies: +// +// Algorithm: +// +// History: 2-28-94 DrewB Created +// +// Notes: +// +//---------------------------------------------------------------------------- +STDAPI StgCreateDocfileOnILockBytes(ILockBytes FAR *plkbyt, + DWORD grfMode, + DWORD reserved, + IStorage FAR * FAR *ppstgOpen) +{ + return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgCreateDocfileOnILockBytes), + PASCAL_STACK_PTR(plkbyt)); +} + +//+--------------------------------------------------------------------------- +// +// Function: StgOpenStorage, Remoted +// +// Synopsis: +// +// Effects: +// +// Arguments: [pwcsName] -- +// [pstgPriority] -- +// [grfMode] -- +// [snbExclude] -- +// [reserved] -- +// [ppstgOpen] -- +// +// Requires: +// +// Returns: +// +// Signals: +// +// Modifies: +// +// Algorithm: +// +// History: 2-28-94 DrewB Created +// +// Notes: +// +//---------------------------------------------------------------------------- +STDAPI StgOpenStorage(const char FAR* pwcsName, + IStorage FAR *pstgPriority, + DWORD grfMode, + SNB snbExclude, + DWORD reserved, + IStorage FAR * FAR *ppstgOpen) +{ + // STGM_CREATE and STGM_CONVERT are illegal for open calls + // 16-bit code did not enforce this, so mask out these flags + // before passing grfMode on + grfMode &= ~(STGM_CREATE | STGM_CONVERT); + + return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgOpenStorage), + PASCAL_STACK_PTR(pwcsName)); +} + +//+--------------------------------------------------------------------------- +// +// Function: StgOpenStorageOnILockBytes, Remoted +// +// Synopsis: +// +// Effects: +// +// Arguments: [plkbyt] -- +// [pstgPriority] -- +// [grfMode] -- +// [snbExclude] -- +// [reserved] -- +// [ppstgOpen] -- +// +// Requires: +// +// Returns: +// +// Signals: +// +// Modifies: +// +// Algorithm: +// +// History: 2-28-94 DrewB Created +// +// Notes: +// +//---------------------------------------------------------------------------- +STDAPI StgOpenStorageOnILockBytes(ILockBytes FAR *plkbyt, + IStorage FAR *pstgPriority, + DWORD grfMode, + SNB snbExclude, + DWORD reserved, + IStorage FAR * FAR *ppstgOpen) +{ + // STGM_CREATE and STGM_CONVERT are illegal for open calls + // 16-bit code did not enforce this, so mask out these flags + // before passing grfMode on + grfMode &= ~(STGM_CREATE | STGM_CONVERT); + + return + (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgOpenStorageOnILockBytes), + PASCAL_STACK_PTR(plkbyt)); +} + +//+--------------------------------------------------------------------------- +// +// Function: StgIsStorageFile, Remoted +// +// Synopsis: +// +// Effects: +// +// Arguments: [pwcsName] -- +// +// Requires: +// +// Returns: +// +// Signals: +// +// Modifies: +// +// Algorithm: +// +// History: 2-28-94 DrewB Created +// +// Notes: +// +//---------------------------------------------------------------------------- +STDAPI StgIsStorageFile(const char FAR* pwcsName) +{ + // + // MSPUB 2.0a hack - We call the "CheckInit" version because they forgot + // to call CoInitialize/OleInitialize first. + // + return + (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgIsStorageFile), + PASCAL_STACK_PTR(pwcsName)); +} + +//+--------------------------------------------------------------------------- +// +// Function: StgIsStorageILockBytes, Remoted +// +// Synopsis: +// +// Effects: +// +// Arguments: [plkbyt] -- +// +// Requires: +// +// Returns: +// +// Signals: +// +// Modifies: +// +// Algorithm: +// +// History: 2-28-94 DrewB Created +// +// Notes: +// +//---------------------------------------------------------------------------- +STDAPI StgIsStorageILockBytes(ILockBytes FAR* plkbyt) +{ + return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgIsStorageILockBytes), + PASCAL_STACK_PTR(plkbyt)); +} + +//+--------------------------------------------------------------------------- +// +// Function: StgSetTimes, Remoted +// +// Synopsis: +// +// Effects: +// +// Arguments: [lpszName] -- +// [pctime] -- +// [patime] -- +// [pmtime] -- +// +// Requires: +// +// Returns: +// +// Signals: +// +// Modifies: +// +// Algorithm: +// +// History: 2-28-94 DrewB Created +// +// Notes: +// +//---------------------------------------------------------------------------- +STDAPI StgSetTimes(char const FAR* lpszName, + FILETIME const FAR* pctime, + FILETIME const FAR* patime, + FILETIME const FAR* pmtime) +{ + return (HRESULT)CallObjectInWOWCheckThkMgr(THK_API_METHOD(THK_API_StgSetTimes), + PASCAL_STACK_PTR(lpszName)); +} diff --git a/private/ole32/olethunk/ole16/storage/storage.c b/private/ole32/olethunk/ole16/storage/storage.c new file mode 100644 index 000000000..b449d2e71 --- /dev/null +++ b/private/ole32/olethunk/ole16/storage/storage.c @@ -0,0 +1,87 @@ +//+------------------------------------------------------------------------- +// +// Microsoft Windows +// Copyright (C) Microsoft Corporation, 1992 - 1993. +// +// File: storage.c (16 bit target) +// +// Contents: Storage.dll common code +// +// History: 17-Dec-93 JohannP Created +// +//-------------------------------------------------------------------------- + +#include <headers.cxx> +#pragma hdrstop + +#include <call32.hxx> +#include <apilist.hxx> + +DECLARE_INFOLEVEL(thk1); + +//+--------------------------------------------------------------------------- +// +// Function: LibMain, public +// +// Synopsis: DLL initialization function +// +// Arguments: [hinst] - Instance handle +// [wDataSeg] - Current DS +// [cbHeapSize] - Heap size for the DLL +// [lpszCmdLine] - Command line information +// +// Returns: One for success, zero for failure +// +// History: 21-Feb-94 DrewB Created +// +//---------------------------------------------------------------------------- + +#if DBG == 1 +static char achInfoLevel[32]; +#endif + +int CALLBACK LibMain(HINSTANCE hinst, + WORD wDataSeg, + WORD cbHeapSize, + LPSTR lpszCmdLine) +{ +#if DBG == 1 + if (GetProfileString("olethk32", "InfoLevel", "3", achInfoLevel, + sizeof(achInfoLevel)) > 0) + { + thk1InfoLevel = strtoul(achInfoLevel, NULL, 0); + } +#endif + +#if defined(_CHICAGO_) + // + // BUGBUGCHICAGO + // + // The Chicago debugger doesn't like hinst not being wired. + // + GlobalWire(hinst); +#endif + + return 1; +} + +//+--------------------------------------------------------------------------- +// +// Function: WEP, public +// +// Synopsis: Windows Exit Point routine, for receiving DLL unload +// notification +// +// Arguments: [nExitType] - Type of exit occurring +// +// Returns: One for success, zero for failure +// +// History: 21-Feb-94 DrewB Created +// +//---------------------------------------------------------------------------- + +int CALLBACK WEP(int nExitType) +{ + // BUGBUG - Clean up thunk objects? + return 1; +} diff --git a/private/ole32/olethunk/ole16/storage/storage.def b/private/ole32/olethunk/ole16/storage/storage.def new file mode 100644 index 000000000..0d3fd4cab --- /dev/null +++ b/private/ole32/olethunk/ole16/storage/storage.def @@ -0,0 +1,49 @@ +;//+------------------------------------------------------------------------- +;// +;// Microsoft Windows +;// Copyright (C) Microsoft Corporation, 1992 - 1993. +;// +;// File: storage.def +;// +;// Contents: storage.dll module definition file +;// +;// History: 23-Sep-92 DrewB Created from multiple def files +;// 09-Oct-92 AlexT Added HEAPSIZE to 16-bit definitions +;// 03-Feb-93 DrewB Changed docfile.def to storage.def +;// +;// Note: $(OLE)\storage.def is used for 16-bit and OLE32 32-bit builds +;// $(COMMON)\ilib\storage.def is used for Cairo 32-bit builds +;// +;//-------------------------------------------------------------------------- + +LIBRARY STORAGE +DESCRIPTION 'Storage DLL' +;EXETYPE WINDOWS 3.1 + +CODE DISCARDABLE LOADONCALL MOVABLE SHARED +DATA LOADONCALL SINGLE MOVABLE + +; HEAPSIZE is required for RETAIL 16-bit builds where +; we do some local allocations. + +HEAPSIZE 1024 + +EXPORTS + WEP @0 RESIDENTNAME + + STGCREATEDOCFILE @1 + STGCREATEDOCFILEONILOCKBYTES @2 + STGOPENSTORAGE @3 + STGOPENSTORAGEONILOCKBYTES @4 + STGISSTORAGEFILE @5 + STGISSTORAGEILOCKBYTES @6 + STGSETTIMES @7 + + DLLGETCLASSOBJECT @103 + +IMPORTS + KERNEL.LOADLIBRARYEX32W ;;@513 NODATA ;; + KERNEL.FREELIBRARY32W ;;@514 NODATA ;; + KERNEL.GETPROCADDRESS32W ;;@515 NODATA ;; + KERNEL.GETVDMPOINTER32W ;;@516 NODATA ;; + KERNEL.CALLPROC32W ;;@517 NODATA ;; diff --git a/private/ole32/olethunk/ole16/storage/storage.rc b/private/ole32/olethunk/ole16/storage/storage.rc new file mode 100644 index 000000000..266736186 --- /dev/null +++ b/private/ole32/olethunk/ole16/storage/storage.rc @@ -0,0 +1,33 @@ +#include <windows.h> + +#include "verinfo.h" + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_PRODUCTVERSION +FILEFLAGSMASK VER_FILEFLAGSMASK +FILEFLAGS VER_FILEFLAGS +FILEOS VER_FILEOS +FILETYPE VER_FILETYPE +FILESUBTYPE VER_FILESUBTYPE +{ + BLOCK "StringFileInfo" + { + BLOCK "040904E4" + { + VALUE "CompanyName", VER_COMPANYNAME_STR + VALUE "FileDescription", VER_FILEDESCRIPTION_STR + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "InternalName", "STORAGE.DLL\0" + VALUE "LegalCopyright", VER_LEGALCOPYRIGHT_STR + VALUE "LegalTrademarks", VER_LEGALTRADEMARKS_STR + VALUE "ProductName", VER_PRODUCTNAME_STR + VALUE "ProductVersion", VER_PRODUCTVERSION_STR + VALUE "Comments", VER_COMMENT_STR + } + } + BLOCK "VarFileInfo" + { + VALUE "Translation", 0x409, 1252 + } +} |