ReactOS  0.4.14-dev-55-g2da92ac
jscript_main.c File Reference
#include "initguid.h"
#include "jscript.h"
#include "winreg.h"
#include "advpub.h"
#include "activaut.h"
#include "objsafe.h"
#include "mshtmhst.h"
#include "rpcproxy.h"
#include "jscript_classes.h"
#include "wine/debug.h"
Include dependency graph for jscript_main.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (jscript)
 
 DEFINE_GUID (GUID_NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL fLock)
 
static HRESULT WINAPI JScriptFactory_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
static HRESULT WINAPI JScriptEncodeFactory_CreateInstance (IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

LONG module_ref = 0
 
HINSTANCE jscript_hinstance
 
static const IClassFactoryVtbl JScriptFactoryVtbl
 
static IClassFactory JScriptFactory = { &JScriptFactoryVtbl }
 
static const IClassFactoryVtbl JScriptEncodeFactoryVtbl
 
static IClassFactory JScriptEncodeFactory = { &JScriptEncodeFactoryVtbl }
 

Function Documentation

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 62 of file jscript_main.c.

63 {
64  TRACE("(%p)\n", iface);
65  return 2;
66 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  fLock 
)
static

Definition at line 74 of file jscript_main.c.

75 {
76  TRACE("(%p)->(%x)\n", iface, fLock);
77 
78  if(fLock)
79  lock_module();
80  else
81  unlock_module();
82 
83  return S_OK;
84 }
#define TRACE(s)
Definition: solgame.cpp:4
static void unlock_module(void)
Definition: ieframe.h:339
#define S_OK
Definition: intsafe.h:59
static void lock_module(void)
Definition: ieframe.h:335

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 41 of file jscript_main.c.

42 {
43  *ppv = NULL;
44 
46  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
47  *ppv = iface;
48  }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
49  TRACE("(%p)->(IID_IClassFactory %p)\n", iface, ppv);
50  *ppv = iface;
51  }
52 
53  if(*ppv) {
54  IUnknown_AddRef((IUnknown*)*ppv);
55  return S_OK;
56  }
57 
58  FIXME("(%p)->(%s %p)\n", iface, debugstr_guid(riid), ppv);
59  return E_NOINTERFACE;
60 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
const GUID IID_IClassFactory

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 68 of file jscript_main.c.

69 {
70  TRACE("(%p)\n", iface);
71  return 1;
72 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ DEFINE_GUID()

DEFINE_GUID ( GUID_NULL  ,
,
,
,
,
,
,
,
,
,
,
 
)

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 176 of file jscript_main.c.

177 {
178  TRACE("() ref=%d\n", module_ref);
179 
180  return module_ref ? S_FALSE : S_OK;
181 }
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
LONG module_ref
Definition: jscript_main.c:35
#define S_OK
Definition: intsafe.h:59

◆ DllGetClassObject()

HRESULT WINAPI DllGetClassObject ( REFCLSID  rclsid,
REFIID  riid,
LPVOID ppv 
)

Definition at line 157 of file jscript_main.c.

158 {
159  if(IsEqualGUID(&CLSID_JScript, rclsid)) {
160  TRACE("(CLSID_JScript %s %p)\n", debugstr_guid(riid), ppv);
161  return IClassFactory_QueryInterface(&JScriptFactory, riid, ppv);
162  }
163 
164  if(IsEqualGUID(&CLSID_JScriptEncode, rclsid)) {
165  TRACE("(CLSID_JScriptEncode %s %p)\n", debugstr_guid(riid), ppv);
166  return IClassFactory_QueryInterface(&JScriptEncodeFactory, riid, ppv);
167  }
168 
169  FIXME("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
171 }
REFIID riid
Definition: precomp.h:44
static IClassFactory JScriptFactory
Definition: jscript_main.c:107
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const CLSID CLSID_JScript
Definition: activex.c:57
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static IClassFactory JScriptEncodeFactory
Definition: jscript_main.c:130
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
static const CLSID CLSID_JScriptEncode
Definition: jscript.c:50

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hInstDLL,
DWORD  fdwReason,
LPVOID  lpv 
)

Definition at line 135 of file jscript_main.c.

136 {
137  TRACE("(%p %d %p)\n", hInstDLL, fdwReason, lpv);
138 
139  switch(fdwReason) {
140  case DLL_PROCESS_ATTACH:
141  DisableThreadLibraryCalls(hInstDLL);
142  jscript_hinstance = hInstDLL;
143  if(!init_strings())
144  return FALSE;
145  break;
146  case DLL_PROCESS_DETACH:
147  if (lpv) break;
148  free_strings();
149  }
150 
151  return TRUE;
152 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
#define DLL_PROCESS_DETACH
Definition: compat.h:119
HINSTANCE jscript_hinstance
Definition: jscript_main.c:39
#define TRACE(s)
Definition: solgame.cpp:4
void free_strings(void)
Definition: jsstr.c:325
BOOL init_strings(void)
Definition: jsstr.c:308

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 186 of file jscript_main.c.

187 {
188  TRACE("()\n");
190 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE jscript_hinstance
Definition: jscript_main.c:39
#define TRACE(s)
Definition: solgame.cpp:4

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 195 of file jscript_main.c.

196 {
197  TRACE("()\n");
199 }
HINSTANCE jscript_hinstance
Definition: jscript_main.c:39
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110

◆ JScriptEncodeFactory_CreateInstance()

static HRESULT WINAPI JScriptEncodeFactory_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 109 of file jscript_main.c.

111 {
112  TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
113 
114  if(outer) {
115  *ppv = NULL;
116  return CLASS_E_NOAGGREGATION;
117  }
118 
120 }
#define TRUE
Definition: types.h:120
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT create_jscript_object(BOOL is_encode, REFIID riid, void **ppv)
Definition: jscript.c:1072
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ JScriptFactory_CreateInstance()

static HRESULT WINAPI JScriptFactory_CreateInstance ( IClassFactory iface,
IUnknown outer,
REFIID  riid,
void **  ppv 
)
static

Definition at line 86 of file jscript_main.c.

88 {
89  TRACE("(%p %s %p)\n", outer, debugstr_guid(riid), ppv);
90 
91  if(outer) {
92  *ppv = NULL;
93  return CLASS_E_NOAGGREGATION;
94  }
95 
97 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
HRESULT create_jscript_object(BOOL is_encode, REFIID riid, void **ppv)
Definition: jscript.c:1072
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( jscript  )

Variable Documentation

◆ jscript_hinstance

HINSTANCE jscript_hinstance

Definition at line 39 of file jscript_main.c.

Referenced by DllMain(), DllRegisterServer(), DllUnregisterServer(), and throw_error().

◆ JScriptEncodeFactory

IClassFactory JScriptEncodeFactory = { &JScriptEncodeFactoryVtbl }
static

Definition at line 130 of file jscript_main.c.

Referenced by DllGetClassObject().

◆ JScriptEncodeFactoryVtbl

const IClassFactoryVtbl JScriptEncodeFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: jscript_main.c:74
static HRESULT WINAPI JScriptEncodeFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: jscript_main.c:109
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: jscript_main.c:62
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: jscript_main.c:68
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: jscript_main.c:41

Definition at line 122 of file jscript_main.c.

◆ JScriptFactory

IClassFactory JScriptFactory = { &JScriptFactoryVtbl }
static

Definition at line 107 of file jscript_main.c.

Referenced by DllGetClassObject().

◆ JScriptFactoryVtbl

const IClassFactoryVtbl JScriptFactoryVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL fLock)
Definition: jscript_main.c:74
static HRESULT WINAPI JScriptFactory_CreateInstance(IClassFactory *iface, IUnknown *outer, REFIID riid, void **ppv)
Definition: jscript_main.c:86
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: jscript_main.c:62
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: jscript_main.c:68
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: jscript_main.c:41

Definition at line 99 of file jscript_main.c.

◆ module_ref

LONG module_ref = 0

Definition at line 35 of file jscript_main.c.

Referenced by DllCanUnloadNow().