Signature of the .NET COM Interop Method

What interop signature do you use for the following COM method? I am particularly interested in the last two options, and whether to try MarshalAswith SizeParamIndexor not.

HRESULT GetOutputSetting(
  DWORD    dwOutputNum,
  LPCWSTR  pszName,
  WMT_ATTR_DATATYPE*  pType,
  BYTE*    pValue,
  WORD*    pcbLength
);

The documentation reads:

pValue [out] Pointer to a byte buffer containing the value. Pass NULL to retrieve the length of the buffer required.

pcbLength [in, out] At the input, a pointer to a variable containing the length of pValue. The output variable contains the number of bytes in pValue.

+3
source share
2 answers
+2

SizeParamIndex, - , : .

, #:

byte[] pValue,
ref ushort pcbLength

- , . NULL ( null #) pValue, . , . pcbLength ref, in/out.

+1

Source: https://habr.com/ru/post/1698522/


All Articles