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

☂️ Project the entire Win32 API #819

Open
halildurmus opened this issue Feb 24, 2024 · 2 comments
Open

☂️ Project the entire Win32 API #819

halildurmus opened this issue Feb 24, 2024 · 2 comments
Assignees
Labels
automation Replace handcrafted code that doesn't scale epic A theme of work that contain sub-tasks feature A new feature or request P3 Low-priority issue package: generator Issue with package:generator
Milestone

Comments

@halildurmus
Copy link
Owner

halildurmus commented Feb 24, 2024

Currently, the JSON files define which APIs are projected by the generator.

In a future major release (not in v6, likely v7), I plan to expand the generator to project nearly the entire Win32 API, excluding a few outdated APIs. This will be made possible by leveraging Microsoft’s metadata, eliminating the need for the manual effort currently required to add new APIs -- a process that is both time-consuming and tedious.

The expanded scope will include:

  • Win32 callbacks
  • Win32 constants
  • Win32 enumerations
  • Win32 functions
  • Win32 structures
  • COM interfaces
@halildurmus halildurmus added feature A new feature or request automation Replace handcrafted code that doesn't scale epic A theme of work that contain sub-tasks labels Feb 24, 2024
@halildurmus halildurmus added this to the 6.0.0 milestone Feb 24, 2024
@halildurmus halildurmus self-assigned this Feb 24, 2024
@halildurmus halildurmus added the package: generator Issue with package:generator label Feb 25, 2024
@halildurmus halildurmus removed this from the 6.0.0 milestone Aug 28, 2024
@Levi-Lesches
Copy link

I have a concrete use-case at YehudaKremer/msix#292: Determining if your app is running with package identity:

#include <windows.h>
#include <appmodel.h>
#include <atlbase.h>
#include <VersionHelpers.h>

std::optional<bool> NativePlugin::checkIdentity() {
  if (!IsWindows8OrGreater()) return false;
  uint32_t length = 0;
  auto error = GetCurrentPackageFullName(&length, nullptr);
  if (error == APPMODEL_ERROR_NO_PACKAGE) {
    return false;
  } else if (error != ERROR_INSUFFICIENT_BUFFER) {
    return std::nullopt;
  }
  std::vector<wchar_t> fullName(length);
  error = GetCurrentPackageFullName(&length, fullName.data());
  if (error != ERROR_SUCCESS) return std::nullopt;
  return true;
}

Seems this package doesn't include <appmodel.h>, so I can't use IsWindows8OrGreater() or GetCurrentPackageFullName().

@halildurmus
Copy link
Owner Author

Thanks for explaining your use case, @Levi-Lesches! I can add these functions easily.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation Replace handcrafted code that doesn't scale epic A theme of work that contain sub-tasks feature A new feature or request P3 Low-priority issue package: generator Issue with package:generator
Projects
None yet
Development

No branches or pull requests

2 participants