Initial original import from: fuse-2.4.2-2.fc4
[captive.git] / src / libcaptive / ke / timer.c
index 7477c80..c4f9ab6 100644 (file)
@@ -52,3 +52,96 @@ int errint;
 
        CurrentTime->QuadPart=(tv.tv_sec+SECS_1601_TO_1970)*G_GINT64_CONSTANT(10000000)+tv.tv_usec*10;
 }
+
+
+/**
+ * KeSetTimer:
+ * @Timer: Previously initialized timer object.
+ * %NULL value is forbidden.
+ * @DueTime: If positive then absolute time to expire at.
+ * If negative then the relative time to expire at.
+ * @Dpc: If non %NULL then a #KDPC to be called when the timer expires.
+ *
+ * Sets the absolute or relative interval at which a timer object
+ * is to be set to the signaled state and optionally supplies a
+ * CustomTimerDpc to be executed when the timer expires.
+ *
+ * libcaptive does not support such timers and this function is a NOP there.
+ *
+ * Returns: %TRUE if the timer was already in the system timer queue.
+ * libcaptive always returns %FALSE.
+ */
+BOOLEAN KeSetTimer(PKTIMER Timer,LARGE_INTEGER DueTime,PKDPC Dpc)
+{
+       g_return_val_if_fail(Timer!=NULL,TRUE);
+
+       /* NOP */
+
+       return FALSE;   /* Timer was not yet in the system queue. */
+}
+
+
+/**
+ * KeCancelTimer:
+ * @Timer: Timer to cancel.
+ * %NULL value is forbidden.
+ *
+ * Removes a timer from the system timer list.
+ *
+ * libcaptive does not support such timers and this function is a NOP there.
+ *
+ * Returns: %TRUE if the timer was running.
+ * libcaptive always returns %FALSE.
+ */
+BOOLEAN KeCancelTimer(PKTIMER Timer)
+{
+       g_return_val_if_fail(Timer!=NULL,TRUE);
+
+       /* NOP */
+
+       return FALSE;   /* Timer was not running. */
+}
+
+
+/**
+ * KeInitializeTimer:
+ * @Timer: Caller supplied storage for the timer.
+ *
+ * Initalizes a kernel timer object.
+ *
+ * libcaptive does not support such timers and this function is a NOP there.
+ */
+VOID KeInitializeTimer(PKTIMER Timer)
+{
+       g_return_if_fail(Timer!=NULL);
+
+       /* NOP */
+}
+
+
+/**
+ * KeDelayExecutionThread:
+ * @WaitMode: Processor mode in which the caller is waiting.
+ * libcaptive requires %KernelMode value.
+ * @Altertable: Specifies if the wait is alertable.
+ * libcaptive requires %FALSE value.
+ * @Interval: Specifies the interval to wait.
+ * Pointer %NULL is forbidden.
+ * libcaptive ignores the value.
+ *
+ * Function puts the current thread into an alertable or nonalertable wait
+ * state for a given internal. libcaptive never waits.
+ *
+ * Returns: libcaptive returns %STATUS_SUCCESS (interval passed).
+ */
+NTSTATUS KeDelayExecutionThread(KPROCESSOR_MODE WaitMode,BOOLEAN Alertable,PLARGE_INTEGER Interval)
+{
+       g_return_val_if_fail(WaitMode==KernelMode,STATUS_INVALID_PARAMETER);
+       g_return_val_if_fail(Alertable==FALSE,STATUS_INVALID_PARAMETER);
+       g_return_val_if_fail(Interval!=NULL,STATUS_INVALID_PARAMETER);
+
+       g_log(G_LOG_DOMAIN,G_LOG_LEVEL_DEBUG,"%s: Interval=%lld, returning STATUS_SUCCESS",G_STRLOC,
+                       (long long)Interval->QuadPart);
+
+       return STATUS_SUCCESS;
+}