mirror of
https://github.com/mii443/MigawariDriver.git
synced 2025-08-22 16:05:33 +00:00
shared memory test
This commit is contained in:
@ -1,8 +1,16 @@
|
||||
#include "ServerTrackedDeviceProvider.hpp"
|
||||
#include <Windows.h>
|
||||
|
||||
vr::EVRInitError ServerTrackedDeviceProvider::Init(vr::IVRDriverContext *pDriverContext) {
|
||||
VR_INIT_SERVER_DRIVER_CONTEXT(pDriverContext);
|
||||
|
||||
auto name = "MigawariDriver";
|
||||
auto size = 4;
|
||||
HANDLE hSharedMemory = CreateFileMapping(NULL, NULL, PAGE_READWRITE, NULL, size, name);
|
||||
pMemory = (int*)MapViewOfFile(hSharedMemory, FILE_MAP_ALL_ACCESS, NULL, NULL, size);
|
||||
|
||||
*pMemory = 100;
|
||||
|
||||
std::string message = "Migawari driver initialized!\n";
|
||||
vr::VRDriverLog()->Log(message.c_str());
|
||||
|
||||
|
@ -11,4 +11,6 @@ public:
|
||||
virtual bool ShouldBlockStandbyMode() { return false; };
|
||||
virtual void EnterStandby() { };
|
||||
virtual void LeaveStandby() { };
|
||||
private:
|
||||
int *pMemory;
|
||||
};
|
||||
|
Reference in New Issue
Block a user