1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

testprogs: testspoolss.exe: pretty print FILETIME in driver info 6 and 8.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Dec 23 23:40:21 CET 2010 on sn-devel-104
This commit is contained in:
Günther Deschner 2010-12-23 14:43:10 +01:00
parent 37c4ced9bd
commit 821b2a9d11
2 changed files with 101 additions and 3 deletions

View File

@ -969,7 +969,12 @@ void print_driver_info_6(PDRIVER_INFO_6 info)
printf("\tPrevious Names\t= (null)\n");
}
printf("\tDriver Date\t= %d\n", info->ftDriverDate);
printf("\tDriver Date\t= %d (%08x:%08x)\n",
info->ftDriverDate,
info->ftDriverDate.dwLowDateTime,
info->ftDriverDate.dwHighDateTime);
printf("\t\t");
print_file_time(&info->ftDriverDate);
printf("\tDriver Version\t= %d\n", info->dwlDriverVersion);
printf("\tManufacture Name = %s\n", info->pszMfgName);
printf("\tOEM URL\t\t= %s\n", info->pszOEMUrl);
@ -1014,7 +1019,12 @@ void print_driver_info_8(PDRIVER_INFO_8 info)
print_multi_sz(info->pszzPreviousNames);
printf("\tDependent Files\t=\n");
print_multi_sz(info->pDependentFiles);
printf("\tDriver Date\t= %d\n", info->ftDriverDate);
printf("\tDriver Date\t= %d (%08x:%08x)\n",
info->ftDriverDate,
info->ftDriverDate.dwLowDateTime,
info->ftDriverDate.dwHighDateTime);
printf("\t\t");
print_file_time(&info->ftDriverDate);
printf("\tDriver Version\t= %d\n", info->dwlDriverVersion);
printf("\tManufacture Name = %s\n", info->pszMfgName);
printf("\tOEM URL\t\t= %s\n", info->pszOEMUrl);
@ -1028,7 +1038,12 @@ void print_driver_info_8(PDRIVER_INFO_8 info)
printf("\tPrinter Driver Attributes = %d\n", info->dwPrinterDriverAttributes);
printf("\tCore Driver Dependencies\t=\n");
print_multi_sz(info->pszzCoreDriverDependencies);
printf("\tMin Inbox Driver VerDate\t= %d\n", info->ftMinInboxDriverVerDate);
printf("\tMin Inbox Driver VerDate\t= %d (%08x:%08x)\n",
info->ftMinInboxDriverVerDate,
info->ftMinInboxDriverVerDate.dwLowDateTime,
info->ftMinInboxDriverVerDate.dwHighDateTime);
printf("\t\t");
print_file_time(&info->ftMinInboxDriverVerDate);
printf("\tMin Inbox Driver VerVersion\t= %d\n", info->dwlMinInboxDriverVerVersion);
return;
}
@ -1288,3 +1303,84 @@ void print_printer_enum_values(PRINTER_ENUM_VALUES *info)
print_printer_data(NULL, info->pValueName, info->cbData, info->pData, info->dwType);
}
void print_file_time(const FILETIME *t)
{
SYSTEMTIME s;
LPSTR dayofweek = NULL;
LPSTR month = NULL;
if (!FileTimeToSystemTime(t, &s)) {
printf("Failed to convert FILETIME to SYSTEMTIME\n");
return;
}
switch (s.wDayOfWeek) {
case 0:
dayofweek = "Sun";
break;
case 1:
dayofweek = "Mon";
break;
case 2:
dayofweek = "Tue";
break;
case 3:
dayofweek = "Wed";
break;
case 4:
dayofweek = "Thu";
break;
case 5:
dayofweek = "Fri";
break;
case 6:
dayofweek = "Sat";
break;
default:
break;
}
switch (s.wMonth) {
case 1:
month = "Jan";
break;
case 2:
month = "Feb";
break;
case 3:
month = "Mar";
break;
case 4:
month = "Apr";
break;
case 5:
month = "May";
break;
case 6:
month = "Jun";
break;
case 7:
month = "Jul";
break;
case 8:
month = "Aug";
break;
case 9:
month = "Sep";
break;
case 10:
month = "Oct";
break;
case 11:
month = "Nov";
break;
case 12:
month = "Dec";
break;
default:
break;
}
printf("%s %s %02d %02d:%02d:%02d %04d\n",
dayofweek, month, s.wDay,
s.wHour, s.wMinute, s.wSecond, s.wYear);
}

View File

@ -58,6 +58,8 @@ LPSTR reg_type_str(DWORD type);
void print_printer_data(LPSTR keyname, LPSTR valuename, DWORD size, LPBYTE buffer, DWORD type);
void print_printer_dataw(LPCWSTR keyname, LPCWSTR valuename, DWORD size, LPBYTE buffer, DWORD type);
void print_printer_enum_values(PRINTER_ENUM_VALUES *info);
void print_file_time(const FILETIME *t);
#undef _PRINTF_ATTRIBUTE
#define _PRINTF_ATTRIBUTE(a1, a2)