sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Explore Windows specific APIs for extra context

Open bruno-garcia opened this issue 4 years ago • 2 comments

If there are useful context data available through Win32, we could get that data when net5-windows for example. Consider cswin32 for binding.

There are also UWP APIs available, for example: https://github.com/getsentry/sentry-xamarin/issues/92

bruno-garcia avatar Jan 21 '21 19:01 bruno-garcia

GetSystemInfo function and SystemInfo structure look interesting/useful:

typedef struct _SYSTEM_INFO {
  union {
    DWORD dwOemId;
    struct {
      WORD wProcessorArchitecture;
      WORD wReserved;
    } DUMMYSTRUCTNAME;
  } DUMMYUNIONNAME;
  DWORD     dwPageSize;
  LPVOID    lpMinimumApplicationAddress;
  LPVOID    lpMaximumApplicationAddress;
  DWORD_PTR dwActiveProcessorMask;
  DWORD     dwNumberOfProcessors;
  DWORD     dwProcessorType;
  DWORD     dwAllocationGranularity;
  WORD      wProcessorLevel;
  WORD      wProcessorRevision;
} SYSTEM_INFO, *LPSYSTEM_INFO;

No need to limit this to net5-windows, can just check the current platform and call WinAPI only if on Windows. It's not like we expose any public API, it's all internal anyway.

Tyrrrz avatar May 24 '21 18:05 Tyrrrz

this will be re-examined if we ever need a windows specific target for other requirements

SimonCropp avatar Jun 29 '22 22:06 SimonCropp