Module: wine Branch: master Commit: 18cab64b42c0f5c8d61fbd3772a2d7da15b2dea7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=18cab64b42c0f5c8d61fbd3772...
Author: Misha Koshelev mk144210@bcm.edu Date: Mon May 14 12:14:00 2007 -0500
msi: automation: Implement Record::IntegerData.
---
dlls/msi/automation.c | 20 +++++++++++++++++ dlls/msi/msiserver.idl | 6 +++++ dlls/msi/msiserver_dispids.h | 1 + dlls/msi/tests/automation.c | 49 +++++++++++++++++++---------------------- 4 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/dlls/msi/automation.c b/dlls/msi/automation.c index b9dcb5a..c7b8181 100644 --- a/dlls/msi/automation.c +++ b/dlls/msi/automation.c @@ -608,6 +608,26 @@ static HRESULT WINAPI RecordImpl_Invoke( else return DISP_E_MEMBERNOTFOUND; break;
+ case DISPID_RECORD_INTEGERDATA: + if (wFlags & DISPATCH_PROPERTYGET) { + hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); + if (FAILED(hr)) return hr; + V_VT(pVarResult) = VT_I4; + V_I4(pVarResult) = MsiRecordGetInteger(This->msiHandle, V_I4(&varg0)); + } else if (wFlags & DISPATCH_PROPERTYPUT) { + hr = DispGetParam(pDispParams, 0, VT_I4, &varg0, puArgErr); + if (FAILED(hr)) return hr; + hr = DispGetParam(pDispParams, DISPID_PROPERTYPUT, VT_I4, &varg1, puArgErr); + if (FAILED(hr)) return hr; + if ((ret = MsiRecordSetInteger(This->msiHandle, V_I4(&varg0), V_I4(&varg1))) != ERROR_SUCCESS) + { + ERR("MsiRecordSetInteger returned %d\n", ret); + return DISP_E_EXCEPTION; + } + } + else return DISP_E_MEMBERNOTFOUND; + break; + default: return DISP_E_MEMBERNOTFOUND; } diff --git a/dlls/msi/msiserver.idl b/dlls/msi/msiserver.idl index 560b572..25008dd 100644 --- a/dlls/msi/msiserver.idl +++ b/dlls/msi/msiserver.idl @@ -88,6 +88,12 @@ library WindowsInstaller void StringData( [in] long Field, [in] BSTR rhs); + [id(DISPID_RECORD_INTEGERDATA), propget] + long IntegerData([in] long Field); + [id(DISPID_RECORD_INTEGERDATA), propput] + void IntegerData( + [in] long Field, + [in] long rhs); [id(DISPID_RECORD_FIELDCOUNT), propget] long FieldCount(); } diff --git a/dlls/msi/msiserver_dispids.h b/dlls/msi/msiserver_dispids.h index ebcab7d..c9906b4 100644 --- a/dlls/msi/msiserver_dispids.h +++ b/dlls/msi/msiserver_dispids.h @@ -24,6 +24,7 @@
#define DISPID_RECORD_FIELDCOUNT 0 #define DISPID_RECORD_STRINGDATA 1 +#define DISPID_RECORD_INTEGERDATA 2
#define DISPID_STRINGLIST_ITEM 0 #define DISPID_STRINGLIST_COUNT 1 diff --git a/dlls/msi/tests/automation.c b/dlls/msi/tests/automation.c index 4aaa671..5eb0bc2 100644 --- a/dlls/msi/tests/automation.c +++ b/dlls/msi/tests/automation.c @@ -1478,32 +1478,29 @@ static void test_Installer(void) ok(SUCCEEDED(hr), "Record_FiledCountGet failed, hresult 0x%08x\n", hr); ok(iValue == 1, "Record_FieldCountGet result was %d but expected 1\n", iValue);
- todo_wine - { - /* Record::IntegerDataGet */ - hr = Record_IntegerDataGet(pRecord, 1, &iValue); - ok(SUCCEEDED(hr), "Record_IntegerDataGet failed, hresult 0x%08x\n", hr); - ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER); - - /* Record::IntegerDataGet, bad index */ - hr = Record_IntegerDataGet(pRecord, 10, &iValue); - ok(SUCCEEDED(hr), "Record_IntegerDataGet failed, hresult 0x%08x\n", hr); - ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER); - - /* Record::IntegerDataPut */ - hr = Record_IntegerDataPut(pRecord, 1, 100); - ok(SUCCEEDED(hr), "Record_IntegerDataPut failed, hresult 0x%08x\n", hr); - - /* Record::IntegerDataPut, bad index */ - hr = Record_IntegerDataPut(pRecord, 10, 100); - ok(hr == DISP_E_EXCEPTION, "Record_IntegerDataPut failed, hresult 0x%08x\n", hr); - ok_exception(hr, szIntegerDataException); - - /* Record::IntegerDataGet */ - hr = Record_IntegerDataGet(pRecord, 1, &iValue); - ok(SUCCEEDED(hr), "Record_IntegerDataGet failed, hresult 0x%08x\n", hr); - ok(iValue == 100, "Record_IntegerDataGet result was %d but expected 100\n", iValue); - } + /* Record::IntegerDataGet */ + hr = Record_IntegerDataGet(pRecord, 1, &iValue); + ok(SUCCEEDED(hr), "Record_IntegerDataGet failed, hresult 0x%08x\n", hr); + ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER); + + /* Record::IntegerDataGet, bad index */ + hr = Record_IntegerDataGet(pRecord, 10, &iValue); + ok(SUCCEEDED(hr), "Record_IntegerDataGet failed, hresult 0x%08x\n", hr); + ok(iValue == MSI_NULL_INTEGER, "Record_IntegerDataGet result was %d but expected %d\n", iValue, MSI_NULL_INTEGER); + + /* Record::IntegerDataPut */ + hr = Record_IntegerDataPut(pRecord, 1, 100); + ok(SUCCEEDED(hr), "Record_IntegerDataPut failed, hresult 0x%08x\n", hr); + + /* Record::IntegerDataPut, bad index */ + hr = Record_IntegerDataPut(pRecord, 10, 100); + ok(hr == DISP_E_EXCEPTION, "Record_IntegerDataPut failed, hresult 0x%08x\n", hr); + ok_exception(hr, szIntegerDataException); + + /* Record::IntegerDataGet */ + hr = Record_IntegerDataGet(pRecord, 1, &iValue); + ok(SUCCEEDED(hr), "Record_IntegerDataGet failed, hresult 0x%08x\n", hr); + ok(iValue == 100, "Record_IntegerDataGet result was %d but expected 100\n", iValue);
IDispatch_Release(pRecord); }