Skip to content

Fix DPI 16 callback PlayString and PlayEvents#225

Open
LexiconCode wants to merge 1 commit intodictation-toolbox:masterfrom
LexiconCode:fix/dns16-callback
Open

Fix DPI 16 callback PlayString and PlayEvents#225
LexiconCode wants to merge 1 commit intodictation-toolbox:masterfrom
LexiconCode:fix/dns16-callback

Conversation

@LexiconCode
Copy link
Member

@LexiconCode LexiconCode commented Feb 26, 2026

Fix playString/playEvents ESP corruption/hanging on DNS 16 by passing notify=1 in the extra vtable parameter DPI 16 added to PlayString and PlayEvents.

I would appreciate testing and we might need to adjust the version gating Dragon v14/15?

Fix playString/playEvents hanging on DNS 16 by passing notify=1 in the
extra vtable parameter DNS 16 added to PlayString and PlayEvents.
Without it, PlaybackDone never fires and the message loop blocks
indefinitely.

Adds Dragon version detection at connect time to select the correct
calling convention.
@LexiconCode LexiconCode self-assigned this Feb 26, 2026
@LexiconCode LexiconCode added bug Something isn't working (DNS/DPI) API labels Feb 26, 2026
@@ -28,6 +28,7 @@ class CDragonCode
CDragonCode() {
m_hMsgWnd = NULL;
m_dwKey = 0;
Copy link
Member Author

@LexiconCode LexiconCode Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need to be tweaked instead of 13

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-1 will do.

@drmfinlay
Copy link
Member

Thanks for figuring this out, Aaron! I'll test this PR for you soon.

Doing the call in assembly sure is fancy. However, it might be better to conditionally define that in the header file, similar to what was done for Dragon 15 here. Then we can have a separate binary for Dragon 16.

GetVersion() will still be needed, of course.

@drmfinlay
Copy link
Member

I can say that this does fix the ESP errors for me. However, there are some problems with playString(). That function now types garbled text. It looks like that's because the playString() code is now giving pszKeys, a const char *, to the Unicode interface method. This code used the ANSI function before, even if UNICODE was defined. And because you've started talking assembly there, the compiler hasn't caught the error.

Such are the joys of programming in assembly. We can keep going that way if you like, but patching dspeech.h is probably easier.

Anyway, I was mistaken before. GetVersion() won't be needed if we go with a separate binary.

@drmfinlay
Copy link
Member

BTW, modifying dspeech.h to use your extra parameter works fine. The problem is only a missing parameter, not a calling convention issue.

Also, the ANSI implementation accepts the extra parameter, but ignores it. We'll have to use the Unicode method.

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

Labels

bug Something isn't working (DNS/DPI) API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants