ReactOS  0.4.14-dev-1338-g0d187f7
main.c File Reference
#include "config.h"
#include "ws2tcpip.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 58 of file main.c.

Function Documentation

◆ DllCanUnloadNow()

HRESULT WINAPI DllCanUnloadNow ( void  )

Definition at line 163 of file main.c.

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

◆ DllGetClassObject()

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

Definition at line 146 of file main.c.

147 {
148  IClassFactory *cf = NULL;
149 
150  TRACE("%s, %s, %p\n", debugstr_guid(rclsid), debugstr_guid(riid), ppv);
151 
152  if (IsEqualGUID( rclsid, &CLSID_WinHttpRequest ))
153  {
154  cf = &request_cf.IClassFactory_iface;
155  }
156  if (!cf) return CLASS_E_CLASSNOTAVAILABLE;
157  return IClassFactory_QueryInterface( cf, riid, ppv );
158 }
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:141

◆ DllMain()

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

Definition at line 41 of file main.c.

42 {
43  switch(fdwReason)
44  {
45  case DLL_PROCESS_ATTACH:
46  winhttp_instance = hInstDLL;
47  DisableThreadLibraryCalls(hInstDLL);
48  break;
49  case DLL_PROCESS_DETACH:
50  if (lpv) break;
53  break;
54  }
55  return TRUE;
56 }
#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:156
#define DLL_PROCESS_DETACH
Definition: compat.h:119
void release_typelib(void)
Definition: apps.c:159
HINSTANCE winhttp_instance
Definition: main.c:34

◆ DllRegisterServer()

HRESULT WINAPI DllRegisterServer ( void  )

Definition at line 171 of file main.c.

172 {
174 }
HRESULT __wine_register_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:98
HINSTANCE winhttp_instance
Definition: main.c:34

◆ DllUnregisterServer()

HRESULT WINAPI DllUnregisterServer ( void  )

Definition at line 179 of file main.c.

180 {
182 }
HRESULT __wine_unregister_resources(HMODULE module) DECLSPEC_HIDDEN
Definition: register.c:110
HINSTANCE winhttp_instance
Definition: main.c:34

◆ impl_from_IClassFactory()

static struct winhttp_cf* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 66 of file main.c.

67 {
68  return CONTAINING_RECORD( iface, struct winhttp_cf, IClassFactory_iface );
69 }
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 87 of file main.c.

89 {
90  return 2;
91 }

◆ requestcf_CreateInstance()

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

Definition at line 99 of file main.c.

104 {
105  struct winhttp_cf *cf = impl_from_IClassFactory( iface );
106  IUnknown *unknown;
107  HRESULT hr;
108 
109  TRACE("%p, %s, %p\n", outer, debugstr_guid(riid), obj);
110 
111  *obj = NULL;
112  if (outer)
113  return CLASS_E_NOAGGREGATION;
114 
115  hr = cf->pfnCreateInstance( (void **)&unknown );
116  if (FAILED(hr))
117  return hr;
118 
119  hr = IUnknown_QueryInterface( unknown, riid, obj );
120  IUnknown_Release( unknown );
121  return hr;
122 }
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:78
static struct winhttp_cf * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:66
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 124 of file main.c.

127 {
128  FIXME("%p, %d\n", iface, dolock);
129  return S_OK;
130 }
#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 71 of file main.c.

75 {
76  if (IsEqualGUID( riid, &IID_IUnknown ) ||
78  {
79  IClassFactory_AddRef( iface );
80  *obj = iface;
81  return S_OK;
82  }
83  FIXME("interface %s not implemented\n", debugstr_guid(riid));
84  return E_NOINTERFACE;
85 }
#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 93 of file main.c.

95 {
96  return 1;
97 }

◆ 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 141 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:87
static ULONG WINAPI requestcf_Release(IClassFactory *iface)
Definition: main.c:93
static HRESULT WINAPI requestcf_QueryInterface(IClassFactory *iface, REFIID riid, void **obj)
Definition: main.c:71
static HRESULT WINAPI requestcf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:124
static HRESULT WINAPI requestcf_CreateInstance(IClassFactory *iface, LPUNKNOWN outer, REFIID riid, void **obj)
Definition: main.c:99

Definition at line 132 of file main.c.

◆ winhttp_instance

HINSTANCE winhttp_instance