diff -u -p -r1.5 totem-gromit.c
--- src/totem-gromit.c	8 Feb 2005 18:04:14 -0000	1.5
+++ src/totem-gromit.c	17 Oct 2006 13:36:39 -0000
@@ -48,7 +48,7 @@ static const char *visibility_cmd[] =	{ 
 
 static char *path = NULL;
 static int id = -1;
-static GPid pid = -1;
+static GPid pid = 0;
 
 #define DEFAULT_CONFIG							\
 "#Default gromit configuration for Totem's telestrator mode		\n\
@@ -120,7 +120,7 @@ static void
 gromit_exit (void)
 {
 	/* Nothing to do */
-	if (pid == -1) {
+	if (pid == 0) {
 		if (id != -1) {
 			g_source_remove (id);
 			id = -1;
@@ -128,8 +128,15 @@ gromit_exit (void)
 		return;
 	}
 
-	kill ((pid_t) pid, SIGKILL);
-	pid = -1;
+#ifdef G_OS_UNIX
+	kill ((p-id_t) pid, SIGKILL);
+#elif defined (G_OS_WIN32)
+	TerminateProcess (pid, 0);
+#else
+#warning Unimplemented
+#endif
+	g_spawn_close_pid (pid);
+	pid = 0;
 }
 
 static gboolean
@@ -149,7 +156,7 @@ totem_gromit_toggle (void)
 		return;
 
 	/* Not started */
-	if (pid == -1) {
+	if (pid == 0) {
 		if (g_spawn_async (NULL,
 				(char **)start_cmd, NULL, 0, NULL, NULL,
 				&pid, NULL) == FALSE) {
diff -u -p -r1.43 totem-disc.c
--- src/plparse/totem-disc.c	30 Sep 2006 16:07:03 -0000	1.43
+++ src/plparse/totem-disc.c	17 Oct 2006 13:36:42 -0000
@@ -80,6 +80,27 @@ typedef struct _CdCache {
  * Resolve relative paths
  */
 
+#ifdef G_OS_WIN32
+static char *
+realpath (const char *pathname, char resolved_path[PATH_MAX])
+{
+  int size;
+
+  if (resolved_path != NULL) {
+    size = GetFullPathNameA (pathname, PATH_MAX, resolved_path, NULL);
+    if (size > PATH_MAX)
+      return NULL;
+    else
+      return resolved_path;
+  } else {
+    size = GetFullPathNameA (pathname, 0, NULL, NULL);
+    resolved_path = g_new0 (char, size);
+    GetFullPathNameA (pathname, size, resolved_path, NULL);
+    return resolved_path;
+  }
+}
+#endif
+
 static char *
 totem_disc_resolve_link (const char *dev, const char *buf)
 {
@@ -113,20 +134,11 @@ get_device (const char *device,
 {
   char *buf;
   char *dev = g_strdup (device);
-  struct stat st;
 
   while (1) {
     char *new;
 
-    if (lstat (dev, &st) != 0) {
-      g_set_error (error, 0, 0,
-          _("Failed to find real device node for %s: %s"),
-          dev, g_strerror (errno));
-      g_free (dev);
-      return NULL;
-    }
-
-    if (!S_ISLNK (st.st_mode))
+    if (!g_file_test (dev, G_FILE_TEST_IS_SYMLINK))
       break;
 
     if (!(buf = g_file_read_link (dev, NULL))) {
