diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-25 18:27:40 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-25 18:27:40 +0000 |
commit | 5f4de275a3a63a95e76d077ffc94321a078833bf (patch) | |
tree | 0109bf5cd50ffaffbf9a86c635dad9be00e68170 | |
parent | 5fef8a5ad29074bcf02904a1cca72133d57cc3e4 (diff) | |
download | samba-5f4de275a3a63a95e76d077ffc94321a078833bf.tar.gz samba-5f4de275a3a63a95e76d077ffc94321a078833bf.tar.xz samba-5f4de275a3a63a95e76d077ffc94321a078833bf.zip |
Make systemtime work for spooling on bigendian systems. Fix from
Benjamin (Bj) Kuit bj@it.uts.edu.au.
Jeremy.
-rw-r--r-- | source/rpc_server/srv_spoolss_nt.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index 57521dc1446..8a13ebe19e9 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/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 |