ReactOS 0.4.15-dev-8344-g0574987
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{
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}
#define NULL
Definition: types.h:112
static struct winhttp_cf request_cf
Definition: main.c:141
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663

◆ DllMain()

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

Definition at line 41 of file main.c.

42{
43 switch(fdwReason)
44 {
46 winhttp_instance = hInstDLL;
48 break;
50 if (lpv) break;
53 break;
54 }
55 return TRUE;
56}
void release_typelib(void)
Definition: apps.c:159
#define TRUE
Definition: types.h:120
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HINSTANCE winhttp_instance
Definition: main.c:34
void netconn_unload(void)
Definition: net.c:156

◆ 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

◆ 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

◆ 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}
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ 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 );
107 HRESULT hr;
108
109 TRACE("%p, %s, %p\n", outer, debugstr_guid(riid), obj);
110
111 *obj = NULL;
112 if (outer)
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}
static IClassFactoryImpl * impl_from_IClassFactory(IClassFactory *iface)
Definition: main.c:63
static WCHAR unknown[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1605
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT hr
Definition: shlfolder.c:183
#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: precomp.h:53
#define S_OK
Definition: intsafe.h:52

◆ 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}
const GUID IID_IUnknown
const GUID IID_IClassFactory
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ 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 HRESULT WINAPI requestcf_LockServer(IClassFactory *iface, BOOL dolock)
Definition: main.c:124
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_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