Skip to content

Conversation

@ccy
Copy link
Contributor

@ccy ccy commented Dec 9, 2025

No description provided.

@martijnlaan
Copy link
Collaborator

Do you have a small example script that reproduces the access violation? Thanks in advance.

@ccy
Copy link
Contributor Author

ccy commented Jan 4, 2026

Do you have a small example script that reproduces the access violation? Thanks in advance.

Please try this test case:

https://github.com/remobjects/pascalscript/blob/ad434e520f26d4350d9b051b3c989812d95b9f9c/dunit/PascalScriptTests.pas

@martijnlaan
Copy link
Collaborator

Thanks. Which ones of these have the problem: Test_CreateOleObject / Test_Format / Test_BadVariableType? Or is it all of them.

@martijnlaan
Copy link
Collaborator

martijnlaan commented Jan 4, 2026

Tried the first (so the script below) but it does not cause an AV for me. Delphi 12.3, 64-bit, PS_USECLASSICINVOKE. Instead it runs normally and sets Result to False. Without PS_USECLASSICINVOKE I get 'Could not call proc' on the Connect line.

var
  o: Variant;
begin
  o := CreateOleObject('Schedule.Service.1');
  o.Connect('');
  Result := o.Connected;
end;

@martijnlaan
Copy link
Collaborator

martijnlaan commented Jan 4, 2026

Tried running your changed code anyway. It crashed on the first changed line IDispatchInvoke for me, which is this line:

Old

if PVarData(@Par[High(Par)-i]).VType = varString then

New

if (PVarData(PPSVariantIFC(@Par[High(Par)-i]).Dta).VType = varString) then

This seems to be expected because Par is an array of Variant, so you can cast it to PVarData, but not to PPSVariantIFC?

This is with PS_USECLASSICINVOKE. Without that my test code doesnt run and says 'Could not call proc' again.

@martijnlaan
Copy link
Collaborator

I noticed #285 limits the new line from above to only if PS_USECLASSICINVOKE is not defined?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants