views:

17

answers:

0

I'm having problems trying to run a bunch of old 16-bit applications in Windows 2008 Server. The applications ran fine up to Windows 2003 Server, but when I try to print from any of them, all show printing errors (Unable to create printer driver / TERM error / etc)

  • The LPT1 port is redirected to a shared printer via NET USE LPT1 \ServerName\SharedPrinter
  • DIR > LPT1 (or any shell redirection to the printer) is working fine.
  • I'm using an Administrator account, so it shouldn't be a permissions problem, right?

To reproduce the behavior, I made a small test program in C (TCC 1.01 for DOS). It runs fine in XP / 2003 Server, but on 2008 Server it shows the handle opening (5) but when is trying to write in that handle, issues an error (Write fault error writing device LPT1, Abort, Retry, Ignore, Fail)

#include <io.h>
#include <fcntl.h>
#include <sys\stat.h>

int main(void)
{
 int handle, status;
 char* sbuff;

 handle = open("LPT1", O_WRONLY, S_IFBLK);
 printf("%d\n", handle);

 if (!handle)
 {
    printf("open failed\n");
    exit(1);
 }

 sbuff = "[print test]\n";
 write(handle, sbuff, strlen(sbuff));

 close(handle);
 getch();

 return 0;
}

Any clues?

TIA, Pablo

related questions