ReactOS  0.4.14-dev-552-g2fad488
main.c File Reference
#include "config.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "objbase.h"
#include "rpcproxy.h"
#include "httprequest.h"
#include "winhttp.h"
#include "wine/debug.h"
#include "winhttp_private.h"
Include dependency graph for main.c:

Go to the source code of this file.

Classes

struct  winhttp_cf
 

Macros

#define COBJMACROS
 

Typedefs

typedef HRESULT(* fnCreateInstance) (void **obj)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (winhttp)
 
BOOL WINAPI DllMain (HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
 
static struct winhttp_cfimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI requestcf_QueryInterface (IClassFactory *iface, REFIID riid, void **obj)
 
static ULONG WINAPI requestcf_AddRef (IClassFactory *iface)
 
static ULONG WINAPI requestcf_Release (IClassFactory *iface)
 
static HRESULT WINAPI requestcf_CreateInstance (IClassFactory *iface, LPUNKNOWN outer, REFIID riid, void **obj)
 
static HRESULT WINAPI requestcf_LockServer (IClassFactory *iface, BOOL dolock)
 
HRESULT WINAPI DllGetClassObject (REFCLSID rclsid, REFIID riid, LPVOID *ppv)
 
HRESULT WINAPI DllCanUnloadNow (void)
 
HRESULT WINAPI DllRegisterServer (void)
 
HRESULT WINAPI DllUnregisterServer (void)
 

Variables

HINSTANCE winhttp_instance
 
static const struct IClassFactoryVtbl winhttp_cf_vtbl
 
static struct winhttp_cf request_cf = { { &winhttp_cf_vtbl }, WinHttpRequest_create }
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 19 of file main.c.

Typedef Documentation

◆ fnCreateInstance

typedef HRESULT(* fnCreateInstance) (void **obj)

Definition at line 57 of file main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 162 of file main.c.

163 {
164  return S_FALSE;
165 }
#define S_FALSE
Definition: winerror.h:2357

◆ DllGetClassObject()

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

Definition at line 145 of file main.c.

146 {
147  IClassFactory *cf = NULL;
148 
149  TRACE("%s, %s, %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
150 
151  if (IsEqualGUID( rclsid, &CLSID_WinHttpRequest ))
152  {
153  cf = &request_cf.IClassFactory_iface;
154  }
155  if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
156  return IClassFactory_QueryInterface( cf, riid, ppv );
157 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static struct winhttp_cf request_cf
Definition: main.c:140

◆ DllMain()

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

Definition at line 40 of file main.c.

41 {
42  switch(fdwReason)
43  {
44  case DLL_PROCESS_ATTACH:
45  winhttp_instance = hInstDLL;
46  DisableThreadLibraryCalls(hInstDLL);
47  break;
48  case DLL_PROCESS_DETACH:
49  if (lpv) break;
52  break;
53  }
54  return TRUE;
55 }
#define TRUE
Definition: types.h:120
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
#define DLL_PROCESS_ATTACH
Definition: compat.h:120
void netconn_unload(void)
Definition: net.c:289
#define DLL_PROCESS_DETACH
Definition: compat.h:119
void release_typelib(void)
Definition: apps.c:159
HINSTANCE winhttp_instance
Definition: main.c:33

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 170 of file main.c.

171 {
173 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE winhttp_instance
Definition: main.c:33

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 178 of file main.c.

179 {
181 }
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HINSTANCE winhttp_instance
Definition: main.c:33

◆ impl_from_IClassFactory()

static struct winhttp_cf* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 65 of file main.c.

66 {
67  return CONTAINING_RECORD( iface, struct winhttp_cf, IClassFactory_iface );
68 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by requestcf_CreateInstance().

◆ requestcf_AddRef()

static ULONG WINAPI requestcf_AddRef ( IClassFactory iface)
static

Definition at line 86 of file main.c.

88 {
89  return 2;
90 }

◆ requestcf_CreateInstance()

static HRESULT WINAPI requestcf_CreateInstance ( IClassFactory iface,
LPUNKNOWN  outer,
REFIID  riid,
void **  obj 
)
static

Definition at line 98 of file main.c.

103 {
104  struct winhttp_cf *cf = impl_from_IClassFactory( iface );
105  IUnknown *unknown;
106  HRESULT hr;
107 
108  TRACE("%p, %s, %p\n", outer, debugstr_guid(riid), obj);
109 
110  *obj = NULL;
111  if (outer)
112  return CLASS_E_NOAGGREGATION;
113 
114  hr = cf->pfnCreateInstance( (void **)&unknown );
115  if (FAILED(hr))
116  return hr;
117 
118  hr = IUnknown_QueryInterface( unknown, riid, obj );
119  IUnknown_Release( unknown );
120  return hr;
121 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
static struct winhttp_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:65
Definition: id3.c:18
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ requestcf_LockServer()

static HRESULT WINAPI requestcf_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 123 of file main.c.

126 {
127  FIXME("%p, %d\n", iface, dolock);
128  return S_OK;
129 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define S_OK
Definition: intsafe.h:59

◆ requestcf_QueryInterface()

static HRESULT WINAPI requestcf_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  obj 
)
static

Definition at line 70 of file main.c.

74 {
75  if (IsEqualGUID( riid, &IID_IUnknown ) ||
77  {
78  IClassFactory_AddRef( iface );
79  *obj = iface;
80  return S_OK;
81  }
82  FIXME("interface %s not implemented\n", debugstr_guid(riid));
83  return E_NOINTERFACE;
84 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:110
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
const GUID IID_IClassFactory

◆ requestcf_Release()

static ULONG WINAPI requestcf_Release ( IClassFactory iface)
static

Definition at line 92 of file main.c.

94 {
95  return 1;
96 }

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( winhttp  )

Variable Documentation

◆ request_cf

struct winhttp_cf request_cf = { { &winhttp_cf_vtbl }, WinHttpRequest_create }
static

Definition at line 140 of file main.c.

Referenced by DllGetClassObject().

◆ winhttp_cf_vtbl

const struct IClassFactoryVtbl winhttp_cf_vtbl
static
Initial value:
=
{
}
static ULONG WINAPI requestcf_AddRef(IClassFactory *iface)
Definition: main.c:86
static ULONG WINAPI requestcf_Release(IClassFactory *iface)
Definition: main.c:92
static HRESULT WINAPI requestcf_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
Definition: main.c:70
static HRESULT WINAPI requestcf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:123
static HRESULT WINAPI requestcf_CreateInstance(IClassFactory *iface, LPUNKNOWN outer, REFIID riid, void **obj)
Definition: main.c:98

Definition at line 131 of file main.c.

◆ winhttp_instance

HINSTANCE winhttp_instance