From b3e5d34171b8e5e6320c28379cb0021bf857efa5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 25 Jan 2002 18:27:40 +0000 Subject: Make systemtime work for spooling on bigendian systems. Fix from Benjamin (Bj) Kuit bj@it.uts.edu.au. Jeremy. (This used to be commit 5f4de275a3a63a95e76d077ffc94321a078833bf) --- source3/rpc_server/srv_spoolss_nt.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 57521dc144..8a13ebe19e 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -2009,8 +2009,9 @@ static void spoolss_notify_job_size(int snum, } /******************************************************************* - * fill a notify_info_data with job position + Fill a notify_info_data with job position. ********************************************************************/ + static void spoolss_notify_job_position(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, @@ -2022,8 +2023,9 @@ static void spoolss_notify_job_position(int snum, } /******************************************************************* - * fill a notify_info_data with submitted time + Fill a notify_info_data with submitted time. ********************************************************************/ + static void spoolss_notify_submitted_time(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, @@ -2033,6 +2035,7 @@ static void spoolss_notify_submitted_time(int snum, struct tm *t; uint32 len; SYSTEMTIME st; + char *p; t=gmtime(&queue->time); @@ -2047,7 +2050,21 @@ static void spoolss_notify_submitted_time(int snum, } make_systemtime(&st, t); - memcpy(data->notify_data.data.string,&st,len); + + /* + * Systemtime must be linearized as a set of UINT16's. + * Fix from Benjamin (Bj) Kuit bj@it.uts.edu.au + */ + + p = (char *)data->notify_data.data.string; + SSVAL(p, 0, st.year); + SSVAL(p, 2, st.month); + SSVAL(p, 4, st.dayofweek); + SSVAL(p, 6, st.day); + SSVAL(p, 8, st.hour); + SSVAL(p, 10, st.minute); + SSVAL(p, 12, st.second); + SSVAL(p, 14, st.milliseconds); } #define END 65535 -- cgit