Skip to content

Commit

Permalink
Fix SDKType_MemoryPointer issues
Browse files Browse the repository at this point in the history
  • Loading branch information
NotnHeavy authored Aug 19, 2024
1 parent 0949fc9 commit 0a8fab4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 7 additions & 5 deletions core/logic/smn_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,13 @@ class CoreNativeHelpers :
g_PlIter = handlesys->CreateType("PluginIterator", this, 0, NULL, NULL, g_pCoreIdent, NULL);
g_FrameIter = handlesys->CreateType("FrameIterator", this, 0, NULL, NULL, g_pCoreIdent, NULL);

HandleAccess security;
security.access[HandleAccess_Read] = 0;
security.access[HandleAccess_Delete] = HANDLE_RESTRICT_OWNER;
security.access[HandleAccess_Clone] = HANDLE_RESTRICT_IDENTITY | HANDLE_RESTRICT_OWNER;
g_MemoryPtr = handlesys->CreateType("MemoryPointer", this, 0, NULL, &security, g_pCoreIdent, NULL);
HandleAccess mp_hacc;
TypeAccess mp_tacc;
mp_hacc.access[HandleAccess_Read] = 0;
mp_hacc.access[HandleAccess_Delete] = HANDLE_RESTRICT_OWNER;
mp_hacc.access[HandleAccess_Clone] = HANDLE_RESTRICT_IDENTITY | HANDLE_RESTRICT_OWNER;
mp_tacc.access[HTypeAccess_Create] = true;
g_MemoryPtr = handlesys->CreateType("MemoryPointer", this, 0, &mp_tacc, &mp_hacc, g_pCoreIdent, NULL);

g_OnLogAction = forwardsys->CreateForward("OnLogAction",
ET_Hook,
Expand Down
4 changes: 3 additions & 1 deletion extensions/sdktools/vdecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ DataStatus DecodeValveParam(IPluginContext *pContext,
security.pIdentity = myself->GetIdentity();
security.pOwner = pContext->GetIdentity();

Handle_t hndl = (Handle_t)param;
cell_t* addr;
pContext->LocalToPhysAddr(param, &addr);
Handle_t hndl = (Handle_t)*addr;

if (hndl == 0)
{
Expand Down

0 comments on commit 0a8fab4

Please sign in to comment.