// // Windows NT Scan API Test : Written Sept 2, 1992 - Bob Rossi. // Copyright 1992 Archive Corporation. All rights reserved. // /** * * Unit: Windows NT API Test Code. * * Name: apitest.c * * Modified: 10/20/92. * * Description: Tests the Windows NT Scan API's. * * $LOG$ **/ #include #include #include #include #include #include // #include "globals.h" #define TEST_ERROR TRUE #define SUCCESS FALSE HANDLE gb_Scan_Handle; UCHAR ScanBuffer [50] = " 12356789"; DWORD Actual; UCHAR SCLReset[] = "\033E"; UCHAR SetXRes[] = "\033*a150R"; UCHAR InqXRes[] = "\033*s10323R"; UCHAR ScanCmd[] = "\033*f0S"; UCHAR ScanData[32768]; /** * Function Prototypes */ VOID _CRTAPI1 main( UINT argc, UCHAR *argv[] ); BOOL OpenScanner( UINT Device_Number ); BOOL WriteScanner( PVOID buf, // I - buffer to write from DWORD len, // I - amount of data in buf DWORD *amount_written_ptr, // O - amount succesfully written BOOL verbose // I - display write status or not ); BOOL ReadScanner( PVOID buf, // I - buffer to write from DWORD len, // I - amount of data in buf DWORD *amount_written_ptr, // O - amount succesfully written BOOL verbose // I - display write status or not ); /** * * Unit: Windows NT Scan API Test Code. * * Name: Main( ) * * Modified: 10/26/92. * * Description: 1) Checks for valid test selection options * 2) Opens tape device and performs initializations * 3) Performs selected tests * 4) Closes tape device and exits. * * Notes: - * * Returns: Standard executable return code to the OS. * * Global Data: gb_Feature_Errors * **/ VOID _CRTAPI1 main( UINT argc, UCHAR *argv[] ) { UINT API_Errors = 0 ; BOOL Test_Unsupported_Features = FALSE ; // Set default to FALSE DWORD Num_Test_Blocks = 10 ; // Set default to 10 UCHAR sw_cmdline[40] ; UINT i ; if(OpenScanner (0)) exit ; WriteScanner ( SCLReset, sizeof (SCLReset)-1, &Actual, TRUE); fprintf (stdout, "Wrote ESC E to scanner. %ld bytes sent.\n", Actual); WriteScanner ( InqXRes, sizeof (InqXRes)-1, &Actual, TRUE); fprintf (stdout, "Sent InqXres. %ld bytes sent.\n", Actual); ReadScanner ( ScanBuffer, sizeof (ScanBuffer), &Actual, TRUE); fprintf (stdout, "Rec'd InqXRes. %ld bytes Received.\n", Actual); fprintf (stdout, "Current XRes = ESC "); for (i=1; i