This project is read-only.
1

Resolved

System structures too small

description

We're using PrintQueueWatch in a service to obtain notification of and job information for jobs submitted to our data center for printing. However, we're seeing exceptions in the trace log indicating the size of a system structure is too small. For example,
 
PrinterQueueWatch.PrintJob: System.ComponentModel.Win32Exception: The data area passed to a system call is too small
at PrinterQueueWatch.SpoolerStructs.JOB_INFO_1..ctor(IntPtr hPrinter, Int32 dwJobId)
at PrinterQueueWatch.PrintJob.InitJobInfo()
 
and
 
PrinterQueueWatch.PrintJob: System.ComponentModel.Win32Exception: The data area passed to a system call is too small
at PrinterQueueWatch.SpoolerStructs.JOB_INFO_2..ctor(IntPtr hPrinter, Int32 dwJobId)
at PrinterQueueWatch.PrintJob.InitJobInfo()
 
I'm not sure how to proceed to resolve these issues. Can anyone offer any advice?
 
Thanks,
Pete Anfinsen
HealthPartners

comments

panfinsen wrote Nov 30, 2010 at 3:49 PM

We're using version 2.0.7.

Merrion wrote Dec 12, 2010 at 12:01 PM

This was due to the strings in the JOB_INFO_ structure changing between calls to GetJob() so the result was that the amount of buffer origianlly required was no longer sufficient by the time the call to populate that buffer came along.

I have added a configurable "extra space" (initally 500 bytes)to get around this which should be sufficient in most cases.

wrote Feb 14, 2013 at 7:55 PM

wrote May 16, 2013 at 9:34 AM

wrote May 16, 2013 at 9:34 AM

wrote Jun 14, 2013 at 8:03 AM