[SHELL32] CDrivesFolder: Implement the eject and disconnect menu items. CORE-13841
[reactos.git] / dll / win32 / vssapi / main.c
1 /*
2 * Copyright 2014 Hans Leidekker for CodeWeavers
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 */
18
19 #include "config.h"
20 #include <stdarg.h>
21 #include "windef.h"
22 #include "winbase.h"
23 #include "vss.h"
24 #include "vswriter.h"
25 #include "wine/debug.h"
26
27 WINE_DEFAULT_DEBUG_CHANNEL( vssapi );
28
29 #ifdef __i386__ /* thiscall functions are i386-specific */
30
31 #define THISCALL(func) __thiscall_ ## func
32 #define THISCALL_NAME(func) __ASM_NAME("__thiscall_" #func)
33 #undef __thiscall
34 #define __thiscall __stdcall
35 #ifdef _MSC_VER
36 #define DEFINE_THISCALL_WRAPPER(func,args) \
37 void __declspec(naked) __thiscall_ ##func(void) \
38 { \
39 __asm { pop eax } \
40 __asm { push ecx } \
41 __asm { push eax } \
42 __asm { jmp func } \
43 }
44 #else
45 #define DEFINE_THISCALL_WRAPPER(func,args) \
46 extern void THISCALL(func)(void); \
47 __ASM_GLOBAL_FUNC(__thiscall_ ## func, \
48 "popl %eax\n\t" \
49 "pushl %ecx\n\t" \
50 "pushl %eax\n\t" \
51 "jmp " __ASM_NAME(#func) __ASM_STDCALL(args) )
52 #endif
53 #else /* __i386__ */
54
55 #define THISCALL(func) func
56 #define THISCALL_NAME(func) __ASM_NAME(#func)
57 #define __thiscall __cdecl
58 #define DEFINE_THISCALL_WRAPPER(func,args) /* nothing */
59
60 #endif /* __i386__ */
61
62 struct CVssWriter
63 {
64 void **vtable;
65 };
66
67 /******************************************************************
68 * ??0CVssWriter@@QAE@XZ (VSSAPI.@)
69 */
70 struct CVssWriter * __thiscall VSSAPI_CVssWriter_default_ctor( struct CVssWriter *writer )
71 {
72 FIXME( "%p\n", writer );
73 writer->vtable = NULL;
74 return writer;
75 }
76 DEFINE_THISCALL_WRAPPER( VSSAPI_CVssWriter_default_ctor, 4 )
77
78 /******************************************************************
79 * ??1CVssWriter@@UAE@XZ (VSSAPI.@)
80 */
81 void __thiscall VSSAPI_CVssWriter_dtor( struct CVssWriter *writer )
82 {
83 FIXME( "%p\n", writer );
84 }
85 DEFINE_THISCALL_WRAPPER( VSSAPI_CVssWriter_dtor, 4 )
86
87 /******************************************************************
88 * ?Initialize@CVssWriter@@QAGJU_GUID@@PBGW4VSS_USAGE_TYPE@@W4VSS_SOURCE_TYPE@@W4_VSS_APPLICATION_LEVEL@@KW4VSS_ALTERNATE_WRITER_STATE@@_N@Z
89 */
90 HRESULT __thiscall VSSAPI_CVssWriter_Initialize( struct CVssWriter *writer, VSS_ID id,
91 LPCWSTR name, VSS_USAGE_TYPE usage_type, VSS_SOURCE_TYPE source_type,
92 VSS_APPLICATION_LEVEL level, DWORD timeout, VSS_ALTERNATE_WRITER_STATE alt_writer_state,
93 BOOL throttle, LPCWSTR instance )
94 {
95 FIXME( "%p, %s, %s, %u, %u, %u, %u, %u, %d, %s\n", writer, debugstr_guid(&id),
96 debugstr_w(name), usage_type, source_type, level, timeout, alt_writer_state,
97 throttle, debugstr_w(instance) );
98 return S_OK;
99 }
100 DEFINE_THISCALL_WRAPPER( VSSAPI_CVssWriter_Initialize, 52 )
101
102 /******************************************************************
103 * ?Subscribe@CVssWriter@@QAGJK@Z
104 */
105 HRESULT __thiscall VSSAPI_CVssWriter_Subscribe( struct CVssWriter *writer, DWORD flags )
106 {
107 FIXME( "%p, %x\n", writer, flags );
108 return S_OK;
109 }
110 DEFINE_THISCALL_WRAPPER( VSSAPI_CVssWriter_Subscribe, 8 )
111
112 /******************************************************************
113 * ?Unsubscribe@CVssWriter@@QAGJXZ
114 */
115 HRESULT __thiscall VSSAPI_CVssWriter_Unsubscribe( struct CVssWriter *writer )
116 {
117 FIXME( "%p\n", writer );
118 return S_OK;
119 }
120 DEFINE_THISCALL_WRAPPER( VSSAPI_CVssWriter_Unsubscribe, 4 )