Estoy desarrollando una aplicación para control de impresión en windows.
necesito elaborar un programa que pueda leer correctamente el archivo .shd
que windows crea en el subdirectorio \spool\printers
Lo que he podido averiguar es que está elaborado con la siguiente
estructura:
The SHD file consists of a header followed by the data.
#define SHD_SIGNATURE_4B $0000494B //Windows 9x
#define SHD_SIGNATURE_66 $00004966
#define SHD_SIGNATURE_67 $00004967 //Win2000/XP
#define SHD_SIGNATURE_68 $00004968 //Windows 2003
# _SHADOW_FILE_HEADER_68 looks similar to #_SHADOW_FILE_HEADER_67
typedef struct _SHADOW_FILE_HEADER_67 {
DWORD dwSignature; //SHD_SIGNATURE_67
DWORD dwHeaderSize;
WORD wStatus;
WORD wUnknown1;
DWORD dwJobID;
DWORD dwPriority;
DWORD offUserName; //Offset of WideChar+0
DWORD offNotifyName; //Offset of WideChar+0
DWORD offDocumentName; //Offset of WideChar+0
DWORD offPort; //Offset of WideChar+0
DWORD offPrinterName; //Offset of WideChar+0
DWORD offDriverName; //Offset of WideChar+0
DWORD offDevMode; //Offset of DEVMODE
DWORD offPrintProcessor; //Offset of WideChar+0
DWORD offDataFormat; //Offset of WideChar+0
DWORD dwUnknown2;
SYSTEMTIME stSubmitTime;
DWORD dwStartTime;
DWORD dwUntilTime;
DWORD dwSizeSPL; //Size of SPL File
DWORD dwPageCount;
DWORD dwSizeSecurityInfo; //Size of SecurityInfo
DWORD offSecurityInfo; //Offset of SECURITY_DESCRIPTOR
DWORD dwUnknown3;
DWORD dwUnknown4;
DWORD dwUnknown5;
DWORD offComputername; //Offset of WideChar+0
DWORD dwSPLSize2;
} SHADOW_FILE_HEADER_67, *PSHADOW_FILE_HEADER_67;
typedef struct _SHADOW_FILE_HEADER_66 {
DWORD dwSignature; //SHD_SIGNATURE_66
WORD wStatus;
WORD wUnknown1;
DWORD dwJobID;
DWORD dwPriority;
DWORD offUserName; //Offset of WideChar+0
DWORD offNotifyName; //Offset of WideChar+0
DWORD offDocumentName; //Offset of WideChar+0
DWORD offPort; //Offset of WideChar+0
DWORD offPrinterName; //Offset of WideChar+0
DWORD offDriverName; //Offset of WideChar+0
DWORD offDevMode; //Offset of DEVMODE
DWORD offPrintProcessor; //Offset of WideChar+0
DWORD offDataFormat; //Offset of WideChar+0
DWORD dwUnknown2;
SYSTEMTIME stSubmitTime;
DWORD dwStartTime;
DWORD dwUntilTime;
DWORD dwSizeSPL; //Size of SPL File
DWORD dwPageCount;
DWORD dwSizeSecurityInfo; //Size of SecurityInfo
DWORD offSecurityInfo; //Offset of SECURITY_DESCRIPTOR
DWORD dwUnknown3;
DWORD dwUnknown4;
DWORD dwUnknown5;
} SHADOW_FILE_HEADER_66, *PSHADOW_FILE_HEADER_66;
typedef struct _SHADOW_FILE_HEADER_4B {
DWORD dwSignature; //SHD_SIGNATURE_4B
WORD wStatus;
WORD wUnknown1;
DWORD dwJobID;
DWORD dwPriority;
DWORD offUserName; //Offset of WideChar+0
DWORD offNotifyName; //Offset of WideChar+0
DWORD offDocumentName; //Offset of WideChar+0
DWORD offPort; //Offset of WideChar+0
DWORD offPrinterName; //Offset of WideChar+0
DWORD offDriverName; //Offset of WideChar+0
DWORD offDevMode; //Offset of DEVMODE
DWORD offPrintProcessor; //Offset of WideChar+0
DWORD offDataFormat; //Offset of WideChar+0
DWORD dwUnknown2;
SYSTEMTIME stSubmitTime;
DWORD dwStartTime;
DWORD dwUntilTime;
DWORD dwSizeSPL; //Size of SPL File
DWORD dwPageCount;
DWORD dwSizeSecurityInfo; //Size of SecurityInfo
DWORD offSecurityInfo; //Offset of SECURITY_DESCRIPTOR
DWORD dwUnknown3;
} SHADOW_FILE_HEADER_4B, *PSHADOW_FILE_HEADER_4B;
Cualquier información, contactar a HUGO CORTES pesfom@yahoo.com
Leer las respuestas