Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

StgConvertPropertyToVariant is missing #1566

Closed
kennykerr opened this issue May 8, 2023 · 6 comments · Fixed by #1832
Closed

StgConvertPropertyToVariant is missing #1566

kennykerr opened this issue May 8, 2023 · 6 comments · Fixed by #1832

Comments

@kennykerr
Copy link
Contributor

Tested the latest version of Win32/Wdk and this function has disappeared, blocking ingestion. Any ideas?

@mikebattista
Copy link
Collaborator

It was removed as part of #1547 since it depended on a C++ class PMemoryAllocator that was being emitted as an empty struct. C++ APIs are typically excluded.

In this case, should a class like this be treated like a typedef struct opaque handle? Or is excluding the right thing?

@kennykerr
Copy link
Contributor Author

Ugh, the IMemoryAllocator definition was never published publicly so it's probably better to avoid it.

@mikebattista mikebattista closed this as not planned Won't fix, can't repro, duplicate, stale May 8, 2023
@riverar
Copy link
Collaborator

riverar commented Jul 11, 2023

@mikebattista @kennykerr

Am wondering if we should revisit this. IMemoryAllocator is documented (https://learn.microsoft.com/en-us/windows/win32/stg/imemoryallocator) so calling this API should be possible.

And the function parameter is documented as

A pointer to a class that implements the IMemoryAllocator abstract class.

I recognize the headers still refer to abstract class PMemoryAllocator but it seems to align with the interface as expected.

class PMemoryAllocator
{
public:
    virtual void *Allocate(ULONG cbSize) = 0;
    virtual void Free(void *pv) = 0;
};
...

@riverar riverar reopened this Jul 11, 2023
@kennykerr
Copy link
Contributor Author

Yes, even if the parameter is just declared as void* it would at least make the API available for those who need it.

@mikebattista
Copy link
Collaborator

I don't see IMemoryAllocator in the metadata or headers. What is the full set of changes you want here?

@riverar
Copy link
Collaborator

riverar commented Jul 13, 2023

Propose we:

  • add a manual definition for IMemoryAllocator, based on docs and validated against PMemoryAllocator

     IMemoryAllocator
     {
     public:
       virtual void* Allocate(ULONG cbSize) = 0;
       virtual void Free(void* pv) = 0;
     }
  • restore StgConvertPropertyToVariant and point to interface above

  • consider filing a SDK bug to get the interface defined in headers to align with docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants