| OLD | NEW |
| 1 $$ This is a pump file for generating file templates. Pump is a python | 1 $$ This is a pump file for generating file templates. Pump is a python |
| 2 $$ script that is part of the Google Test suite of utilities. Description | 2 $$ script that is part of the Google Test suite of utilities. Description |
| 3 $$ can be found here: | 3 $$ can be found here: |
| 4 $$ | 4 $$ |
| 5 $$ http://code.google.com/p/googletest/wiki/PumpManual | 5 $$ http://code.google.com/p/googletest/wiki/PumpManual |
| 6 | 6 |
| 7 $$ MAX_ARITY controls the number of arguments that dispatch::Invoke() supports. | 7 $$ MAX_ARITY controls the number of arguments that dispatch::Invoke() supports. |
| 8 $$ It is choosen to match the number of arguments base::Bind() supports. | 8 $$ It is choosen to match the number of arguments base::Bind() supports. |
| 9 $var MAX_ARITY = 7 | 9 $var MAX_ARITY = 7 |
| 10 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 10 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 internal::ScopedVariantArg disp_args[$(ARITY)]; | 155 internal::ScopedVariantArg disp_args[$(ARITY)]; |
| 156 $for ARG [[ | 156 $for ARG [[ |
| 157 | 157 |
| 158 hr = disp_args[$(ARITY) - $(ARG)].Wrap(p$(ARG)); | 158 hr = disp_args[$(ARITY) - $(ARG)].Wrap(p$(ARG)); |
| 159 if (FAILED(hr)) | 159 if (FAILED(hr)) |
| 160 return hr; | 160 return hr; |
| 161 ]] | 161 ]] |
| 162 ]] | 162 ]] |
| 163 | 163 |
| 164 | 164 |
| 165 // Invoke the method. | 165 // Invoke the method passing the parameters via the DISPPARAMS structure. |
| 166 // DISPATCH_PROPERTYPUT and DISPATCH_PROPERTYPUTREF require the parameter of |
| 167 // the property setter to be named, so |cNamedArgs| and |rgdispidNamedArgs| |
| 168 // structure members should be initialized. |
| 166 | 169 |
| 167 $if ARITY > 0 [[ | 170 $if ARITY > 0 [[ |
| 168 DISPPARAMS disp_params = { disp_args, NULL, $(ARITY), 0 }; | 171 DISPPARAMS disp_params = { disp_args, NULL, $(ARITY), 0 }; |
| 169 ]] $else [[ | 172 ]] $else [[ |
| 170 DISPPARAMS disp_params = { NULL, NULL, 0, 0 }; | 173 DISPPARAMS disp_params = { NULL, NULL, 0, 0 }; |
| 171 ]] | 174 ]] |
| 172 | 175 |
| 176 DISPID dispid_named = DISPID_PROPERTYPUT; |
| 177 if (flags == DISPATCH_PROPERTYPUT || flags == DISPATCH_PROPERTYPUTREF) { |
| 178 disp_params.cNamedArgs = 1; |
| 179 disp_params.rgdispidNamedArgs = &dispid_named; |
| 180 } |
| 181 |
| 173 hr = object->Invoke(disp_id, IID_NULL, LOCALE_USER_DEFAULT, flags, | 182 hr = object->Invoke(disp_id, IID_NULL, LOCALE_USER_DEFAULT, flags, |
| 174 &disp_params, disp_result, NULL, NULL); | 183 &disp_params, disp_result, NULL, NULL); |
| 175 if (FAILED(hr)) | 184 if (FAILED(hr)) |
| 176 return hr; | 185 return hr; |
| 177 | 186 |
| 178 $if ARITY > 0 [[ | 187 $if ARITY > 0 [[ |
| 179 | 188 |
| 180 // Unwrap the parameters. | 189 // Unwrap the parameters. |
| 181 $for ARG [[ | 190 $for ARG [[ |
| 182 | 191 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 193 return S_OK; | 202 return S_OK; |
| 194 } | 203 } |
| 195 | 204 |
| 196 ]] | 205 ]] |
| 197 | 206 |
| 198 } // namespace dispatch | 207 } // namespace dispatch |
| 199 | 208 |
| 200 } // namespace remoting | 209 } // namespace remoting |
| 201 | 210 |
| 202 #endif // REMOTING_BASE_IDISPATCH_DRIVER_WIN_H_ | 211 #endif // REMOTING_BASE_IDISPATCH_DRIVER_WIN_H_ |
| OLD | NEW |