msi: automation: Implement Record::IntegerData.

This commit is contained in:
Misha Koshelev 2007-05-14 12:14:00 -05:00 committed by Alexandre Julliard
parent 757192ebce
commit 18cab64b42
4 changed files with 46 additions and 22 deletions

View File

@ -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;
}

View File

@ -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();
}

View File

@ -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

View File

@ -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 */
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::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 */
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::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 == 100, "Record_IntegerDataGet result was %d but expected 100\n", iValue);
IDispatch_Release(pRecord);
}