Fix virtual SDKCall with object params (#1104)
PR #705 made some changes for 64-bit support that required callers to provide a buffer for object storage, but only added the required code to the non-virtual call builder, not the virtual call builder. Copy it over to CreateValveVCall so that ValveParamToBinParam stops writing to a null pointer. Fixes #1059 (Hopefully.)
This commit is contained in:
parent
024ae2b9ed
commit
77f4ddf2c2
@ -255,10 +255,12 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx,
|
|||||||
|
|
||||||
/* Get return information - encode only */
|
/* Get return information - encode only */
|
||||||
PassInfo retBuf;
|
PassInfo retBuf;
|
||||||
|
ObjectField retFieldBuf[16];
|
||||||
size_t retBufSize = 0;
|
size_t retBufSize = 0;
|
||||||
bool retbuf_needs_extra;
|
bool retbuf_needs_extra;
|
||||||
if (retInfo)
|
if (retInfo)
|
||||||
{
|
{
|
||||||
|
retBuf.fields = retFieldBuf;
|
||||||
if ((size = ValveParamToBinParam(retInfo->vtype, retInfo->type, retInfo->flags, &retBuf, retbuf_needs_extra)) == 0)
|
if ((size = ValveParamToBinParam(retInfo->vtype, retInfo->type, retInfo->flags, &retBuf, retbuf_needs_extra)) == 0)
|
||||||
{
|
{
|
||||||
delete vc;
|
delete vc;
|
||||||
@ -269,12 +271,14 @@ ValveCall *CreateValveVCall(unsigned int vtableIdx,
|
|||||||
|
|
||||||
/* Get parameter info */
|
/* Get parameter info */
|
||||||
PassInfo paramBuf[32];
|
PassInfo paramBuf[32];
|
||||||
|
ObjectField fieldBuf[32][16];
|
||||||
size_t sizes[32];
|
size_t sizes[32];
|
||||||
size_t normSize = 0;
|
size_t normSize = 0;
|
||||||
size_t extraSize = 0;
|
size_t extraSize = 0;
|
||||||
for (unsigned int i=0; i<numParams; i++)
|
for (unsigned int i=0; i<numParams; i++)
|
||||||
{
|
{
|
||||||
bool needs_extra;
|
bool needs_extra;
|
||||||
|
paramBuf[i].fields = fieldBuf[i];
|
||||||
if ((size = ValveParamToBinParam(params[i].vtype,
|
if ((size = ValveParamToBinParam(params[i].vtype,
|
||||||
params[i].type,
|
params[i].type,
|
||||||
params[i].flags,
|
params[i].flags,
|
||||||
|
Loading…
Reference in New Issue
Block a user