free_a_printer(&printer, 2);
}
+/****************************************************************************
+ Update the changeid time.
+****************************************************************************/
+
+static uint32 rev_changeid(uint32 changeid)
+{
+ if (changeid == 0)
+ changeid = time(NULL);
+ return changeid++;
+}
+
/*
* The function below are the high level ones.
* only those ones must be called from the spoolss code.
* incremented on a SetPrinter() call.
*/
- time_t time_unix = time(NULL);
-
/* ChangeID **must** be increasing over the lifetime
- of client's spoolss service in order for the
+ of client's spoolss service in order for the
client's cache to show updates */
- printer.info_2->changeid = time_unix * 100;
+ printer.info_2->changeid = rev_changeid(printer.info_2->changeid);
/*
* Because one day someone will ask:
* --jerry
*/
- time_t time_unix = time(NULL);
-
- printer.info_2->changeid = time_unix * 100;
+ printer.info_2->changeid = rev_changeid(printer.info_2->changeid);
printer.info_2->c_setprinter++;
result=update_a_printer_2(printer.info_2);