Skip to content

Commit

Permalink
win-capture: get-graphics-offsets support for UWP/AppContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
lostmsu committed Apr 24, 2023
1 parent a4bfe03 commit f428a41
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions plugins/win-capture/get-graphics-offsets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ target_sources(
dxgi-offsets.cpp
d3d8-offsets.cpp
d3d9-offsets.cpp
../nt-stuff.c
../nt-stuff.h
../graphics-hook-info.h
../hook-helpers.h)

Expand Down
11 changes: 10 additions & 1 deletion plugins/win-capture/get-graphics-offsets/get-graphics-offsets.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include "get-graphics-offsets.h"

struct hook_info *open_hook_info_shmem(const char *shmemName)
{
HANDLE shmem = OpenFileMappingA(FILE_MAP_WRITE, false, shmemName);
HANDLE shmem;
if (shmemName[0] == '\\') {
wchar_t wideName[MAX_PATH + 1];
mbstowcs(wideName, shmemName, MAX_PATH);
shmem = nt_open_map(wideName);
} else {
shmem = OpenFileMappingA(FILE_MAP_WRITE, false, shmemName);
}

if (!shmem) {
return NULL;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <stdint.h>
#include <stdbool.h>
#include "../graphics-hook-info.h"
#include "../nt-stuff.h"

#define DUMMY_WNDCLASS "get_addrs_wndclass"

Expand Down

0 comments on commit f428a41

Please sign in to comment.