Date: Thu, 15 Sep 2005 00:05:21 EST-10EDT,10,-1,0,7200,3,-1,0,7200,3600 Subject: [UnixOS2_Archive] No. 612 ************************************************** Wednesday 14 September 2005 Number 612 ************************************************** Subjects for today 1 KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH : Tobias Huerlimann 2 Re: KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH : lsunley at mb.sympatico.ca 3 Re: KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH : Tobias Huerlimann 4 Re: KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH : Dave Saville" **= Email 1 ==========================** Date: Wed, 14 Sep 2005 01:36:51 +0200 From: Tobias Huerlimann Subject: KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH Hi list: I'm trying to create a release of GnuPG 1.4.2 for OS/2. After applying my old diffs to the 1.4.2 source I ran into the following problem: KbdGetStatus() always returns error code 376 = ERROR_KBD_INVALID_LENGTH. But this is the same code that has worked flawless in older releases. To examine this problem, I've written a small test program: ==== snip ============================================================ #define INCL_ERRORS #define INCL_KBD #include #include int main(int argc, char** argv) { APIRET rc; KBDINFO terminfo; rc = KbdGetStatus(&terminfo, 0); printf("KbdGetStatus() returned rc = %u\n", rc); return 0; } ==== snip ============================================================ This always gives me rc = 376. Has anyone any idea why these few lines don't work? As far as I can remember, they somehow did in the past... My GCC version (gcc --version) is "gcc (GCC) 3.3.5 (Innotek Build 2005-07-18 03:46)", but I've also tried VAC 3.6.5 (same result). What am I missing? Thanks for any hints! Tobias Huerlimann **= Email 2 ==========================** Date: Tue, 13 Sep 2005 21:17:19 -0500 From: lsunley at mb.sympatico.ca Subject: Re: KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH Hi You did not set the KBDINFO length before the call Note the terminfo.cb = sizeof(KBDINFO) line ========= #define INCL_ERRORS #define INCL_KBD #include #include int main(int argc, char** argv) { APIRET rc; KBDINFO terminfo; terminfo.cb = sizeof(KBDINFO); rc = KbdGetStatus(&terminfo, 0); printf("KbdGetStatus() returned rc = %u\n", rc); return 0; } ========= In <43276293.6050906 at tobiashuerlimann.de>, on 09/14/05 at 01:36 AM, Tobias Huerlimann said: >#define INCL_ERRORS >#define INCL_KBD >#include >#include >int main(int argc, char** argv) { > APIRET rc; > KBDINFO terminfo; > rc = KbdGetStatus(&terminfo, 0); > printf("KbdGetStatus() returned rc = %u\n", rc); > return 0; >} -- ----------------------------------------------------------- lsunley at mb.sympatico.ca ----------------------------------------------------------- **= Email 3 ==========================** Date: Wed, 14 Sep 2005 13:29:20 +0200 From: Tobias Huerlimann Subject: Re: KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH lsunley at mb.sympatico.ca wrote: > You did not set the KBDINFO length before the call Thanks, that indeed seemed to be the problem. I guessed that KbdGetStatus() would set all values in TERMINFO itself. Strange that it has worked without that line in my previous ports... must have been pure coincidence. Thanks, Tobias Huerlimann **= Email 4 ==========================** Date: Wed, 14 Sep 2005 14:50:23 +0100 (BST) From: "Dave Saville" Subject: Re: KbdGetStatus() always returns ERROR_KBD_INVALID_LENGTH On Wed, 14 Sep 2005 13:29:20 +0200, Tobias Huerlimann wrote: >lsunley at mb.sympatico.ca wrote: > >> You did not set the KBDINFO length before the call > >Thanks, that indeed seemed to be the problem. I guessed that >KbdGetStatus() would set all values in TERMINFO itself. Strange that it >has worked without that line in my previous ports... must have been pure >coincidence. More likely is random compiler storage mapping. Before, you happened to get the relevant bit of storage with a reasonable value in it. Change the code a bit and the value changes. This time it got a zero and barfed. -- Regards Dave Saville