1

I'm working on a project to convert a Windows C++ DLL to a Linux SO. As I'm working through the files I've run into the Windows SAFEARRAY and the associated SafeArrayLock(), SafeArrayCreate() and SafeArrayUnlock().

Has anyone been able to replicate this SAFEARRAY structure for Linux or other C++ environment??

The Windows documentation defines the SAFEARRAY structure as the following but I'd like to be able to recreate the functionality with a Linux #include if possible.

Any help or guidance would be greatly appreciated.

typedef struct tagSAFEARRAY {
  USHORT         cDims;
  USHORT         fFeatures;
  ULONG          cbElements;
  ULONG          cLocks;
  PVOID          pvData;
  SAFEARRAYBOUND rgsabound[1];
} SAFEARRAY, *LPSAFEARRAY;
Cosworth66
  • 597
  • 5
  • 14
  • [This question](https://stackoverflow.com/questions/54345277/safearray-on-linux) is related, but it does not seem they found an answer – Denis Sheremet Dec 06 '19 at 05:03
  • 1
    Do you need `SAFEARRAY` to access some external API? If no, I'd suggest to simply replace it with pair of `std::array` and `std::shared_mutex` – Denis Sheremet Dec 06 '19 at 05:05

0 Answers0