1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 use ctypes::{c_long, c_void};
7 use shared::guiddef::REFIID;
8 use shared::minwindef::{BYTE, DWORD};
9 use shared::winerror::HRESULT;
10 use shared::wtypes::BSTR;
11 use um::unknwnbase::{IUnknown, IUnknownVtbl};
12 use um::wbemcli::{IWbemCallResult, IWbemContext, IWbemObjectSink, IWbemServices};
13 use um::winnt::{LPCWSTR, LPWSTR};
14 // extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0000_v0_0_c_ifspec;
15 // extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0000_v0_0_s_ifspec;
16 ENUM!{enum WBEM_LOGIN_TYPE {
17     WBEM_FLAG_INPROC_LOGIN = 0,
18     WBEM_FLAG_LOCAL_LOGIN = 1,
19     WBEM_FLAG_REMOTE_LOGIN = 2,
20     WBEM_AUTHENTICATION_METHOD_MASK = 0xf,
21     WBEM_FLAG_USE_MULTIPLE_CHALLENGES = 0x10,
22 }}
23 pub type WBEM_128BITS = *mut BYTE;
24 // EXTERN_C const IID LIBID_WbemTransports_v1;
25 // EXTERN_C const IID IID_IWbemTransport;
26 DEFINE_GUID!{IID_IWbemTransport,
27     0x553fe584, 0x2156, 0x11d0, 0xb6, 0xae, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7}
28 RIDL!{#[uuid(0x553fe584, 0x2156, 0x11d0, 0xb6, 0xae, 0x00, 0xaa, 0x00, 0x32, 0x40, 0xc7)]
29 interface IWbemTransport(IWbemTransportVtbl): IUnknown(IUnknownVtbl) {
30     fn Initialize() -> HRESULT,
31 }}
32 // EXTERN_C const IID IID_IWbemLevel1Login;
33 DEFINE_GUID!{IID_IWbemLevel1Login,
34     0xf309ad18, 0xd86a, 0x11d0, 0xa0, 0x75, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20}
35 RIDL!{#[uuid(0xf309ad18, 0xd86a, 0x11d0, 0xa0, 0x75, 0x00, 0xc0, 0x4f, 0xb6, 0x88, 0x20)]
36 interface IWbemLevel1Login(IWbemLevel1LoginVtbl): IUnknown(IUnknownVtbl) {
37     fn EstablishPosition(
38         wszLocaleList: LPWSTR,
39         dwNumLocales: DWORD,
40         reserved: *mut DWORD,
41     ) -> HRESULT,
42     fn RequestChallenge(
43         wszNetworkResource: LPWSTR,
44         wszUser: LPWSTR,
45         Nonce: WBEM_128BITS,
46     ) -> HRESULT,
47     fn WBEMLogin(
48         wszPreferredLocale: LPWSTR,
49         AccessToken: WBEM_128BITS,
50         lFlags: c_long,
51         pCtx: *mut IWbemContext,
52         ppNamespace: *mut *mut IWbemServices,
53     ) -> HRESULT,
54     fn NTLMLogin(
55         wszNetworkResource: LPWSTR,
56         wszPreferredLocale: LPWSTR,
57         lFlags: c_long,
58         pCtx: *mut IWbemContext,
59         ppNamespace: *mut *mut IWbemServices,
60     ) -> HRESULT,
61 }}
62 // EXTERN_C const IID IID_IWbemConnectorLogin;
63 DEFINE_GUID!{IID_IWbemConnectorLogin,
64     0xd8ec9cb1, 0xb135, 0x4f10, 0x8b, 0x1b, 0xc7, 0x18, 0x8b, 0xb0, 0xd1, 0x86}
65 RIDL!{#[uuid(0xd8ec9cb1, 0xb135, 0x4f10, 0x8b, 0x1b, 0xc7, 0x18, 0x8b, 0xb0, 0xd1, 0x86)]
66 interface IWbemConnectorLogin(IWbemConnectorLoginVtbl): IUnknown(IUnknownVtbl) {
67     fn ConnectorLogin(
68         wszNetworkResource: LPWSTR,
69         wszPreferredLocale: LPWSTR,
70         lFlags: c_long,
71         pCtx: *mut IWbemContext,
72         riid: REFIID,
73         pInterface: *mut *mut c_void,
74     ) -> HRESULT,
75 }}
76 // EXTERN_C const IID IID_IWbemAddressResolution;
77 DEFINE_GUID!{IID_IWbemAddressResolution,
78     0xf7ce2e12, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8}
79 RIDL!{#[uuid(0xf7ce2e12, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8)]
80 interface IWbemAddressResolution(IWbemAddressResolutionVtbl): IUnknown(IUnknownVtbl) {
81     fn Resolve(
82         wszNamespacePath: LPWSTR,
83         wszAddressType: LPWSTR,
84         pdwAddressLength: *mut DWORD,
85         pabBinaryAddress: *mut *mut BYTE,
86     ) -> HRESULT,
87 }}
88 DEFINE_GUID!{CLSID_WbemLevel1Login,
89     0x8BC3F05E, 0xD86B, 0x11d0, 0xA0, 0x75, 0x00, 0xC0, 0x4F, 0xB6, 0x88, 0x20}
90 // class DECLSPEC_UUID("8BC3F05E-D86B-11d0-A075-00C04FB68820")
91 // WbemLevel1Login;
92 DEFINE_GUID!{CLSID_WbemLocalAddrRes,
93     0xA1044801, 0x8F7E, 0x11d1, 0x9E, 0x7C, 0x00, 0xC0, 0x4F, 0xC3, 0x24, 0xA8}
94 // class DECLSPEC_UUID("A1044801-8F7E-11d1-9E7C-00C04FC324A8")
95 // WbemLocalAddrRes;
96 DEFINE_GUID!{CLSID_WbemUninitializedClassObject,
97     0x7a0227f6, 0x7108, 0x11d1, 0xad, 0x90, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff}
98 // class DECLSPEC_UUID("7a0227f6-7108-11d1-ad90-00c04fd8fdff")
99 // WbemUninitializedClassObject;
100 // EXTERN_C const IID IID_IWbemClientTransport;
101 DEFINE_GUID!{IID_IWbemClientTransport,
102     0xf7ce2e11, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8}
103 RIDL!{#[uuid(0xf7ce2e11, 0x8c90, 0x11d1, 0x9e, 0x7b, 0x00, 0xc0, 0x4f, 0xc3, 0x24, 0xa8)]
104 interface IWbemClientTransport(IWbemClientTransportVtbl): IUnknown(IUnknownVtbl) {
105     fn ConnectServer(
106         strAddressType: BSTR,
107         dwBinaryAddressLength: DWORD,
108         abBinaryAddress: *mut BYTE,
109         strNetworkResource: BSTR,
110         strUser: BSTR,
111         strPassword: BSTR,
112         strLocale: BSTR,
113         lSecurityFlags: c_long,
114         strAuthority: BSTR,
115         pCtx: *mut IWbemContext,
116         ppNamespace: *mut *mut IWbemServices,
117     ) -> HRESULT,
118 }}
119 // EXTERN_C const IID IID_IWbemClientConnectionTransport;
120 DEFINE_GUID!{IID_IWbemClientConnectionTransport,
121     0xa889c72a, 0xfcc1, 0x4a9e, 0xaf, 0x61, 0xed, 0x07, 0x13, 0x33, 0xfb, 0x5b}
122 RIDL!{#[uuid(0xa889c72a, 0xfcc1, 0x4a9e, 0xaf, 0x61, 0xed, 0x07, 0x13, 0x33, 0xfb, 0x5b)]
123 interface IWbemClientConnectionTransport(IWbemClientConnectionTransportVtbl):
124     IUnknown(IUnknownVtbl) {
125     fn Open(
126         strAddressType: BSTR,
127         dwBinaryAddressLength: DWORD,
128         abBinaryAddress: *mut BYTE,
129         strObject: BSTR,
130         strUser: BSTR,
131         strPassword: BSTR,
132         strLocale: BSTR,
133         lFlags: c_long,
134         pCtx: *mut IWbemContext,
135         riid: REFIID,
136         pInterface: *mut *mut c_void,
137         pCallRes: *mut *mut IWbemCallResult,
138     ) -> HRESULT,
139     fn OpenAsync(
140         strAddressType: BSTR,
141         dwBinaryAddressLength: DWORD,
142         abBinaryAddress: *mut BYTE,
143         strObject: BSTR,
144         strUser: BSTR,
145         strPassword: BSTR,
146         strLocale: BSTR,
147         lFlags: c_long,
148         pCtx: *mut IWbemContext,
149         riid: REFIID,
150         pResponseHandler: *mut IWbemObjectSink,
151     ) -> HRESULT,
152     fn Cancel(
153         lFlags: c_long,
154         pHandler: *mut IWbemObjectSink,
155     ) -> HRESULT,
156 }}
157 DEFINE_GUID!{CLSID_WbemDCOMTransport,
158     0xF7CE2E13, 0x8C90, 0x11d1, 0x9E, 0x7B, 0x00, 0xC0, 0x4F, 0xC3, 0x24, 0xA8}
159 // class DECLSPEC_UUID("F7CE2E13-8C90-11d1-9E7B-00C04FC324A8")
160 // WbemDCOMTransport;
161 // EXTERN_C const IID IID_IWbemConstructClassObject;
162 DEFINE_GUID!{IID_IWbemConstructClassObject,
163     0x9ef76194, 0x70d5, 0x11d1, 0xad, 0x90, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff}
164 RIDL!{#[uuid(0x9ef76194, 0x70d5, 0x11d1, 0xad, 0x90, 0x00, 0xc0, 0x4f, 0xd8, 0xfd, 0xff)]
165 interface IWbemConstructClassObject(IWbemConstructClassObjectVtbl): IUnknown(IUnknownVtbl) {
166     fn SetInheritanceChain(
167         lNumAntecedents: c_long,
168         awszAntecedents: *mut LPWSTR,
169     ) -> HRESULT,
170     fn SetPropertyOrigin(
171         wszPropertyName: LPCWSTR,
172         lOriginIndex: c_long,
173     ) -> HRESULT,
174     fn SetMethodOrigin(
175         wszMethodName: LPCWSTR,
176         lOriginIndex: c_long,
177     ) -> HRESULT,
178     fn SetServerNamespace(
179         wszServer: LPCWSTR,
180         wszNamespace: LPCWSTR,
181     ) -> HRESULT,
182 }}
183 // extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0008_v0_0_c_ifspec;
184 // extern RPC_IF_HANDLE __MIDL_itf_wbemtran_0000_0008_v0_0_s_ifspec;
185