Server reorganization:
- moved request handlers to the specific C files
- moved handle management to handle.c
- moved server private includes to server/ instead of include/server/
diff --git a/server/snapshot.c b/server/snapshot.c
index ee18993..c9e678a 100644
--- a/server/snapshot.c
+++ b/server/snapshot.c
@@ -13,8 +13,10 @@
#include "winerror.h"
#include "winnt.h"
#include "tlhelp32.h"
-#include "server/process.h"
-#include "server/thread.h"
+
+#include "handle.h"
+#include "process.h"
+#include "thread.h"
struct snapshot
@@ -44,7 +46,7 @@
/* create a new snapshot */
-struct object *create_snapshot( int flags )
+static struct object *create_snapshot( int flags )
{
struct snapshot *snapshot;
if (!(snapshot = mem_alloc( sizeof(*snapshot) ))) return NULL;
@@ -59,7 +61,7 @@
}
/* get the next process in the snapshot */
-int snapshot_next_process( int handle, int reset, struct next_process_reply *reply )
+static int snapshot_next_process( int handle, int reset, struct next_process_reply *reply )
{
struct snapshot *snapshot;
struct process_snapshot *ptr;
@@ -108,3 +110,25 @@
}
free( snapshot );
}
+
+/* create a snapshot */
+DECL_HANDLER(create_snapshot)
+{
+ struct object *obj;
+ struct create_snapshot_reply reply = { -1 };
+
+ if ((obj = create_snapshot( req->flags )))
+ {
+ reply.handle = alloc_handle( current->process, obj, 0, req->inherit );
+ release_object( obj );
+ }
+ send_reply( current, -1, 1, &reply, sizeof(reply) );
+}
+
+/* get the next process from a snapshot */
+DECL_HANDLER(next_process)
+{
+ struct next_process_reply reply;
+ snapshot_next_process( req->handle, req->reset, &reply );
+ send_reply( current, -1, 1, &reply, sizeof(reply) );
+}