C2N Emulator GUI client WIP #3

Solved! It turns out that when calling GetCommConfig the third parameter has to be set to the size in bytes of the buffer pointed by the second parameter, which is typical for a number of win32 API functions:

n = sizeof(COMMCONFIG);  // <- I had missed this one
fSuccess = GetCommConfig (hPort, &cfg, &n);

This is true despite the fact one has to pass the address of a COMMCONFIG variable as second parameter.

I seem to remember that the reason is that the size can vary in different version of Windows, so this approach is agnostic of the particular version used to compile and/or run the application.

Phew. I shall publish updated binaries at some point next week.

Stay tuned!

About Luigi Di Fraia

I am a Senior DevOps Engineer so I get to work with the latest technologies and open-source software. However, in my private time I enjoy retro-computing.
This entry was posted in Retrocomputing, Technical and tagged , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s