SysAllocStringByteLen function Null safety oleaut32

Pointer<NativeType> SysAllocStringByteLen (
  1. Pointer<Uint8> psz,
  2. int len
)

Takes an ANSI string as input, and returns a BSTR that contains an ANSI string. Does not perform any ANSI-to-Unicode translation.

BSTR SysAllocStringByteLen(
  LPCSTR psz,
  UINT   len
);

Implementation

Pointer SysAllocStringByteLen(Pointer<Uint8> psz, int len) {
  final _SysAllocStringByteLen = _oleaut32.lookupFunction<
      Pointer Function(Pointer<Uint8> psz, Uint32 len),
      Pointer Function(Pointer<Uint8> psz, int len)>('SysAllocStringByteLen');
  return _SysAllocStringByteLen(psz, len);
}