enthought / enthought/comtypes

Problems that arise when remote functions are defined in interfaces related to structured storage.

Open
#607 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
345
Forks
105
PR merge metrics
No merged PRs in 30d

Description

Some of methods in the interfaces generated by `GetModule` are based on remote-side information, which makes them uncallable from the local side.

See also #604.

## `IStorage`
### [`OpenStream` and `RemoteOpenStream`](https://github.com/microsoft/win32metadata/blob/185c3ef016663ab8201878da7efab0a2cff0bcc7/generation/WinSDK/RecompiledIdlHeaders/um/ObjIdl.Idl#L712-L727)

`cbReserved1` is not needed when calling from the local side. If we specify `cbReserved1` as 0 and call from the local side, a `COMError` with the error code `STG_E_INVALIDPOINTER` (`-2147287031`, `0x80030009`) will be raised.

### [`EnumElements` and `RemoteEnumElements`](https://github.com/microsoft/win32metadata/blob/185c3ef016663ab8201878da7efab0a2cff0bcc7/generation/WinSDK/RecompiledIdlHeaders/um/ObjIdl.Idl#L769-L782)

`cbReserved2` is not needed when calling from the local side. If we specify `cbReserved2` as 0 and call from the local side, a `COMError` with the error code `STG_E_INVALIDPOINTER` (`-2147287031`, `0x80030009`) will be raised.

## `IEnumSTATSTG`
### [`Next` and `RemoteNext`](https://github.com/microsoft/win32metadata/blob/185c3ef016663ab8201878da7efab0a2cff0bcc7/generation/WinSDK/RecompiledIdlHeaders/um/ObjIdl.Idl#L660-L670)

Because `RemoteNext` is defined instead of `Next`, `__iter__`, `__next__`, and `__getitem__` are not implemented in the interface, so it does NOT become an iterator or index-accessible object.

## Appendix
[`CopyTo` and `RemoteCopyTo` of `IStorage`](https://github.com/microsoft/win32metadata/blob/185c3ef016663ab8201878da7efab0a2cff0bcc7/generation/WinSDK/RecompiledIdlHeaders/um/ObjIdl.Idl#L744-L756) and [`CopyTo` and `RemoteCopyTo` of `IStream`](https://github.com/microsoft/win32metadata/blob/185c3ef016663ab8201878da7efab0a2cff0bcc7/generation/WinSDK/RecompiledIdlHeaders/um/ObjIdlbase.Idl#L544-L556) have the same parameters on both the remote side and the local side, so it is possible to call the method even if it is defined based on the information from `RemoteCopyTo`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.