diff src/dired.c @ 531:0493e9f3c27f

[xemacs-hg @ 2001-05-12 11:16:12 by ben] event-msw.c: eliminate cygwin warnings. dired.c, syswindows.h, win32.c: find the Net* functions the hard way to avoid errors on win 9x. find-paths.el: fix error with null EXCLUDE-REGEXP. font-lock.el: fix problem reported by hrvoje with buffers starting with a space. lib-complete.el: add a variable to control where `find-library' looks, analogous to `find-function-source-path'. etags.c: new version from Francesco. Makefile.in.in: i'm getting real tired of incomplete commits. is this getting worse or something?
author ben
date Sat, 12 May 2001 11:16:25 +0000
parents ef4d2466a29c
children 666d73d6ac56
line wrap: on
line diff
--- a/src/dired.c	Fri May 11 05:49:46 2001 +0000
+++ b/src/dired.c	Sat May 12 11:16:25 2001 +0000
@@ -37,9 +37,6 @@
 
 #ifdef WIN32_NATIVE
 #include "syswindows.h"
-#include <lmaccess.h>
-#include <lmapibuf.h>
-#include <lmerr.h>
 #endif
 
 Lisp_Object Vcompletion_ignored_extensions;
@@ -662,44 +659,47 @@
 	  user_cache.length++;
         }
 #else
-      do
+      if (xNetUserEnum)
 	{
-	  USER_INFO_0 *bufptr;
-	  NET_API_STATUS status_status_statui_statum_statu;
-	  int i;
-
-          QUIT;
-	  status_status_statui_statum_statu =
-	    NetUserEnum (NULL, 0, 0, (LPBYTE *) &bufptr, 1024, &entriesread,
-			 &totalentries, &resume_handle);
-	  if (status_status_statui_statum_statu != NERR_Success &&
-	      status_status_statui_statum_statu != ERROR_MORE_DATA)
-	    invalid_operation ("Error enumerating users",
-			       make_int (GetLastError ()));
-	  for (i = 0; i < entriesread; i++)
+	  do
 	    {
-	      int nout =
-		WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
-				     bufptr[i].usri0_name,
-				     -1, 0, 0, "~", 0);
-	      void *outp = alloca (nout);
-	      WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
-				   bufptr[i].usri0_name, -1,
-				   (LPSTR) outp, nout, "~", 0);
-	      DO_REALLOC (user_cache.user_names, user_cache.size,
-			  user_cache.length + 1, struct user_name);
-	      TO_INTERNAL_FORMAT (C_STRING, outp,
-				  MALLOC,
-				  (user_cache.
-				   user_names[user_cache.length].ptr,
-				   user_cache.
-				   user_names[user_cache.length].len),
-				  Qmswindows_tstr);
-	      user_cache.length++;
+	      USER_INFO_0 *bufptr;
+	      NET_API_STATUS status_status_statui_statum_statu;
+	      int i;
+
+	      QUIT;
+	      status_status_statui_statum_statu =
+		xNetUserEnum (NULL, 0, 0, (LPBYTE *) &bufptr, 1024,
+			      &entriesread, &totalentries, &resume_handle);
+	      if (status_status_statui_statum_statu != NERR_Success &&
+		  status_status_statui_statum_statu != ERROR_MORE_DATA)
+		invalid_operation ("Error enumerating users",
+				   make_int (GetLastError ()));
+	      for (i = 0; i < entriesread; i++)
+		{
+		  int nout =
+		    WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
+					 bufptr[i].usri0_name,
+					 -1, 0, 0, "~", 0);
+		  void *outp = alloca (nout);
+		  WideCharToMultiByte (CP_ACP, WC_COMPOSITECHECK,
+				       bufptr[i].usri0_name, -1,
+				       (LPSTR) outp, nout, "~", 0);
+		  DO_REALLOC (user_cache.user_names, user_cache.size,
+			      user_cache.length + 1, struct user_name);
+		  TO_INTERNAL_FORMAT (C_STRING, outp,
+				      MALLOC,
+				      (user_cache.
+				       user_names[user_cache.length].ptr,
+				       user_cache.
+				       user_names[user_cache.length].len),
+				      Qmswindows_tstr);
+		  user_cache.length++;
+		}
+	      xNetApiBufferFree (bufptr);
 	    }
-	  NetApiBufferFree (bufptr);
+	  while (entriesread != totalentries);
 	}
-      while (entriesread != totalentries);
 #endif
 
       XCAR (cache_incomplete_p) = Qnil;