Error printing from 16-bit applications in Windows 2008 Server
I'm having problems trying to run a bunch of old 16-bit applications in Windows 200开发者_JAVA百科8 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
Mike A - I have discovered that syntax 'print /d:{lpt?} {filename}' is not working on Win2008, not from within a 16bit app OR from the command line. This syntax has been supported for years and we run it in 10 Win2003 servers. Might there be a configuration setting in Win2008 that would make it syntax compatible with previous versions of Windows? BTW, here is Microsoft Tech Bulletin that was updated April 2012 that list the syntax as being compatible with Win2008... http://technet.microsoft.com/en-us/library/cc731623.
精彩评论