1
0
Эх сурвалжийг харах

Ticket 47998 - cleanup WINDOWS ifdef's

Description:  Remove all the windows specific code (#ifdef's, etc)

https://fedorahosted.org/389/ticket/47998

Reviewed by: rmeggins & nhosoi(Thanks!!)
Mark Reynolds 10 жил өмнө
parent
commit
003651c232
100 өөрчлөгдсөн 180 нэмэгдсэн , 4418 устгасан
  1. 0 3
      config.h.in
  2. 0 12
      configure
  3. 0 4
      configure.ac
  4. 0 14
      include/base/eventlog.h
  5. 0 27
      include/base/file.h
  6. 0 4
      include/base/fsmutex.h
  7. 1 40
      include/base/systems.h
  8. 0 4
      include/ldaputil/cert.h
  9. 0 4
      include/ldaputil/dbconf.h
  10. 0 4
      include/ldaputil/encode.h
  11. 0 4
      include/ldaputil/errors.h
  12. 1 16
      include/ldaputil/extcmap.h
  13. 0 4
      include/ldaputil/ldapauth.h
  14. 0 7
      include/libadmin/libadmin.h
  15. 0 28
      include/netsite.h
  16. 1 31
      include/public/base/systems.h
  17. 0 11
      include/public/nsacl/aclapi.h
  18. 0 57
      include/public/nsapi.h
  19. 0 12
      ldap/include/disptmpl.h
  20. 0 31
      ldap/include/ldaplog.h
  21. 0 58
      ldap/include/lthread.h
  22. 0 78
      ldap/include/ntslapdregparms.h
  23. 0 105
      ldap/include/ntwatchdog.h
  24. 2 2
      ldap/include/regex.h
  25. 0 12
      ldap/include/srchpref.h
  26. 0 6
      ldap/libraries/libavl/avl.c
  27. 0 3
      ldap/libraries/libavl/testavl.c
  28. 0 5
      ldap/servers/plugins/acl/acl.h
  29. 1 87
      ldap/servers/plugins/acl/acldllmain.c
  30. 0 9
      ldap/servers/plugins/acl/aclplugin.c
  31. 0 9
      ldap/servers/plugins/chainingdb/cb_debug.c
  32. 0 4
      ldap/servers/plugins/chainingdb/cb_init.c
  33. 2 89
      ldap/servers/plugins/chainingdb/cbdllmain.c
  34. 0 2
      ldap/servers/plugins/collation/config.c
  35. 0 9
      ldap/servers/plugins/collation/debug.c
  36. 2 85
      ldap/servers/plugins/collation/dllmain.c
  37. 1 13
      ldap/servers/plugins/cos/cos.c
  38. 1 78
      ldap/servers/plugins/cos/dllmain.c
  39. 0 73
      ldap/servers/plugins/distrib/dllmain.c
  40. 0 15
      ldap/servers/plugins/dna/dna.c
  41. 0 79
      ldap/servers/plugins/http/dllmain.c
  42. 3 28
      ldap/servers/plugins/http/http_client.c
  43. 0 3
      ldap/servers/plugins/http/http_impl.c
  44. 0 8
      ldap/servers/plugins/pam_passthru/pam_ptdebug.c
  45. 2 89
      ldap/servers/plugins/pam_passthru/pam_ptdllmain.c
  46. 0 8
      ldap/servers/plugins/passthru/ptdebug.c
  47. 1 87
      ldap/servers/plugins/passthru/ptdllmain.c
  48. 0 78
      ldap/servers/plugins/presence/dllmain.c
  49. 3 24
      ldap/servers/plugins/presence/presence.c
  50. 0 4
      ldap/servers/plugins/pwdstorage/crypt_pwd.c
  51. 0 73
      ldap/servers/plugins/pwdstorage/dllmain.c
  52. 0 2
      ldap/servers/plugins/pwdstorage/pwd_init.c
  53. 0 2
      ldap/servers/plugins/pwdstorage/pwdstorage.h
  54. 0 77
      ldap/servers/plugins/referint/dllmain.c
  55. 0 19
      ldap/servers/plugins/referint/referint.c
  56. 0 5
      ldap/servers/plugins/replication/cl5_api.c
  57. 1 8
      ldap/servers/plugins/replication/cl5_config.c
  58. 0 2
      ldap/servers/plugins/replication/repl.h
  59. 1 4
      ldap/servers/plugins/replication/repl5.h
  60. 0 8
      ldap/servers/plugins/replication/repl_init.c
  61. 0 4
      ldap/servers/plugins/replication/replutil.c
  62. 1 73
      ldap/servers/plugins/retrocl/dllmain.c
  63. 0 8
      ldap/servers/plugins/retrocl/retrocl.c
  64. 0 73
      ldap/servers/plugins/rever/dllmain.c
  65. 0 79
      ldap/servers/plugins/roles/dllmain.c
  66. 0 8
      ldap/servers/plugins/roles/roles_plugin.c
  67. 1 78
      ldap/servers/plugins/statechange/dllmain.c
  68. 1 14
      ldap/servers/plugins/statechange/statechange.c
  69. 0 8
      ldap/servers/plugins/syntaxes/debug.c
  70. 1 88
      ldap/servers/plugins/syntaxes/dllmain.c
  71. 0 6
      ldap/servers/plugins/uiduniq/7bit.c
  72. 0 78
      ldap/servers/plugins/vattrsp_template/dllmain.c
  73. 0 3
      ldap/servers/plugins/vattrsp_template/vattrsp.c
  74. 0 78
      ldap/servers/plugins/views/dllmain.c
  75. 1 16
      ldap/servers/plugins/views/views.c
  76. 0 2
      ldap/servers/slapd/abandon.c
  77. 0 10
      ldap/servers/slapd/add.c
  78. 8 137
      ldap/servers/slapd/agtmmap.c
  79. 0 16
      ldap/servers/slapd/agtmmap.h
  80. 0 2
      ldap/servers/slapd/attr.c
  81. 0 2
      ldap/servers/slapd/auth.c
  82. 0 2
      ldap/servers/slapd/ava.c
  83. 0 14
      ldap/servers/slapd/back-ldbm/back-ldbm.h
  84. 0 42
      ldap/servers/slapd/back-ldbm/dblayer.c
  85. 1 81
      ldap/servers/slapd/back-ldbm/dllmain.c
  86. 0 20
      ldap/servers/slapd/back-ldbm/import-threads.c
  87. 0 10
      ldap/servers/slapd/back-ldbm/init.c
  88. 0 166
      ldap/servers/slapd/back-ldbm/ldbm_bind.c
  89. 1 21
      ldap/servers/slapd/back-ldbm/monitor.c
  90. 0 149
      ldap/servers/slapd/back-ldbm/perfctrs.c
  91. 1 9
      ldap/servers/slapd/back-ldif/back-ldif.h
  92. 1 106
      ldap/servers/slapd/back-ldif/dllmain.c
  93. 0 8
      ldap/servers/slapd/back-ldif/init.c
  94. 0 3
      ldap/servers/slapd/bind.c
  95. 10 354
      ldap/servers/slapd/ch_malloc.c
  96. 0 2
      ldap/servers/slapd/charray.c
  97. 0 2
      ldap/servers/slapd/compare.c
  98. 2 8
      ldap/servers/slapd/config.c
  99. 0 2
      ldap/servers/slapd/configdse.c
  100. 128 969
      ldap/servers/slapd/connection.c

+ 0 - 3
config.h.in

@@ -423,9 +423,6 @@
 /* package version */
 #undef VERSION
 
-/* UNIX */
-#undef XP_UNIX
-
 /* GNU Source */
 #undef _GNU_SOURCE
 

+ 0 - 12
configure

@@ -18454,9 +18454,6 @@ sttyexec=/bin/stty
 case $host in
   *-*-linux*)
 
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
 $as_echo "#define Linux 1" >>confdefs.h
 
 
@@ -18566,9 +18563,6 @@ $as_echo "#define USE_POSIX_RWLOCKS 1" >>confdefs.h
     ;;
   ia64-hp-hpux*)
 
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
 $as_echo "#define hpux 1" >>confdefs.h
 
 
@@ -18604,9 +18598,6 @@ $as_echo "#define _INCLUDE_STDC__SOURCE_199901 1" >>confdefs.h
     ;;
   hppa*-hp-hpux*)
 
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
 $as_echo "#define hpux 1" >>confdefs.h
 
 
@@ -18645,9 +18636,6 @@ $as_echo "#define ATOMIC_64BIT_OPERATIONS 1" >>confdefs.h
     ;;
   *-*-solaris*)
 
-$as_echo "#define XP_UNIX 1" >>confdefs.h
-
-
 $as_echo "#define SVR4 1" >>confdefs.h
 
 

+ 0 - 4
configure.ac

@@ -527,7 +527,6 @@ fi
 sttyexec=/bin/stty
 case $host in
   *-*-linux*)
-    AC_DEFINE([XP_UNIX], [1], [UNIX])
     AC_DEFINE([Linux], [1], [Linux])
     AC_DEFINE([LINUX], [1], [Linux])
     AC_DEFINE([LINUX2_0], [1], [Linux 2.0])
@@ -571,7 +570,6 @@ case $host in
     AC_DEFINE([USE_POSIX_RWLOCKS], [1], [POSIX rwlocks])
     ;;
   ia64-hp-hpux*)
-    AC_DEFINE([XP_UNIX], [1], [UNIX])
     AC_DEFINE([hpux], [1], [HP-UX])
     AC_DEFINE([HPUX], [1], [HP-UX])
     AC_DEFINE([HPUX11], [1], [HP-UX 11])
@@ -589,7 +587,6 @@ case $host in
     initdir=/init.d
     ;;
   hppa*-hp-hpux*)
-    AC_DEFINE([XP_UNIX], [1], [UNIX])
     AC_DEFINE([hpux], [1], [HP-UX])
     AC_DEFINE([HPUX], [1], [HP-UX])
     AC_DEFINE([HPUX11], [1], [HP-UX 11])
@@ -608,7 +605,6 @@ case $host in
     initdir=/init.d
     ;;
   *-*-solaris*)
-    AC_DEFINE([XP_UNIX], [1], [UNIX])
     AC_DEFINE([SVR4], [1], [SVR4])
     AC_DEFINE([__svr4], [1], [SVR4])
     AC_DEFINE([__svr4__], [1], [SVR4])

+ 0 - 14
include/base/eventlog.h

@@ -54,18 +54,4 @@
 
 #include "netsite.h"
 
-
-#if defined(XP_WIN32)
-
-NSPR_BEGIN_EXTERN_C
-
-NSAPI_PUBLIC HANDLE InitializeLogging(char *szEventLogName);
-NSAPI_PUBLIC BOOL TerminateLogging(HANDLE hEventSource);
-NSAPI_PUBLIC BOOL LogErrorEvent(HANDLE hEventSource, WORD fwEventType, WORD fwCategory, DWORD IDEvent, LPTSTR chMsg, LPTSTR lpszMsg);
-
-NSPR_END_EXTERN_C
-
-#endif /* XP_WIN32 */
-
-
 #endif

+ 0 - 27
include/base/file.h

@@ -80,11 +80,6 @@ NSAPI_PUBLIC int INTsystem_tlock(SYS_FILE fd);
 NSAPI_PUBLIC int INTsystem_flock(SYS_FILE fd);
 NSAPI_PUBLIC int INTsystem_ulock(SYS_FILE fd);
 
-#ifdef XP_WIN32
-NSAPI_PUBLIC SYS_DIR INTdir_open(char *path);
-NSAPI_PUBLIC SYS_DIRENT *INTdir_read(SYS_DIR ds);
-NSAPI_PUBLIC void INTdir_close(SYS_DIR ds);
-#endif /* XP_WIN32 */
 
 /* --- OBSOLETE ----------------------------------------------------------
  * The following macros/functions are obsolete and are only maintained for
@@ -92,14 +87,6 @@ NSAPI_PUBLIC void INTdir_close(SYS_DIR ds);
  * -----------------------------------------------------------------------
  */
 
-#ifdef XP_WIN32
-NSAPI_PUBLIC char *INTsystem_winsockerr(void);
-NSAPI_PUBLIC char *INTsystem_winerr(void);
-NSAPI_PUBLIC int INTsystem_pread(SYS_FILE fd, char *buf, int sz);
-NSAPI_PUBLIC int INTsystem_pwrite(SYS_FILE fd, char *buf, int sz);
-NSAPI_PUBLIC void INTfile_unix2local(char *path, char *p2);
-#endif /* XP_WIN32 */
-
 NSAPI_PUBLIC int INTsystem_nocoredumps(void);
 NSAPI_PUBLIC int INTfile_setinherit(SYS_FILE fd, int value);
 NSAPI_PUBLIC int INTfile_notfound(void);
@@ -124,20 +111,6 @@ NSPR_END_EXTERN_C
 #define system_tlock INTsystem_tlock
 #define system_flock INTsystem_flock
 #define system_ulock INTsystem_ulock
-#ifdef XP_WIN32
-#define dir_open INTdir_open
-#define dir_read INTdir_read
-#define dir_close INTdir_close
-#endif /* XP_WIN32 */
-
-/* Obsolete */
-#ifdef XP_WIN32
-#define system_winsockerr INTsystem_winsockerr
-#define system_winerr INTsystem_winerr
-#define system_pread INTsystem_pread
-#define system_pwrite INTsystem_pwrite
-#define file_unix2local INTfile_unix2local
-#endif /* XP_WIN32 */
 
 #define system_nocoredumps INTsystem_nocoredumps
 #define file_setinherit INTfile_setinherit

+ 0 - 4
include/base/fsmutex.h

@@ -94,15 +94,11 @@ NSAPI_PUBLIC FSMUTEX fsmutex_init(char *name, int number, int flags);
    Sets the ownership of the underlying filesystem object to the given
    uid and gid. Only effective if the server is running as root.
  */
-#ifdef XP_UNIX
 #include <unistd.h>
 #ifdef __sony
 #include <sys/types.h>
 #endif
 NSAPI_PUBLIC void fsmutex_setowner(FSMUTEX fsm, uid_t uid, gid_t gid);
-#endif
-
-
 
 /*
    fsmutex_terminate deletes a filesystem-based mutex. A mutex will only

+ 1 - 40
include/base/systems.h

@@ -438,46 +438,9 @@
 #define SA_HANDLER_T(x) (void (*)(int))x
 #endif
 
-#elif defined (XP_WIN32)      /* Windows NT */
-
-#include <wtypes.h>
-#include <winbase.h>
-
-typedef void* PASSWD;
-
-#define ACCELERATOR_CACHE
-#define AUTH_DBM
-/* size has been raised to 200 with NT 4.0 server; NT 4.0 workstation is still
- * limited
- */
-#define DAEMON_LISTEN_SIZE 200
-#define DAEMON_WIN32
-#define DLL_CAPABLE
-#define DLL_WIN32
-#define DNS_CACHE
-#define LOG_BUFFERING
-#define HAVE_STRFTIME /* no cftime */
-#define NEED_CRYPT_PROTO
-#define NEEDS_WRITEV
-#define NET_SOCKETS
-#ifndef NO_DOMAINNAME
-#define NO_DOMAINNAME
-#endif
-#ifdef BUILD_DLL
-#define NSAPI_PUBLIC __declspec(dllexport)
 #else
-#define NSAPI_PUBLIC
-#endif /* BUILD_DLL */
-#define THREAD_ANY
-#define THREAD_NSPR_KERNEL
-#define USE_NSPR
-#define USE_STRFTIME /* no cftime */
-
-#else
-
 #error "Missing defines in ns/netsite/include/base/systems.h"
-
-#endif	/* Windows NT */
+#endif
 
 /* Pick up the configuration symbols in the public interface */
 #ifndef PUBLIC_BASE_SYSTEMS_H
@@ -513,7 +476,6 @@ typedef void* PASSWD;
 /* NS_MAIL builds sec-key.c which calls systhread_init, which requires */
 /* that USE_NSPR is defined when systhr.c is compiled.  --lachman */
 /* MCC_PROXY does the same thing now --nbreslow -- LIKE HELL --ari */
-#if defined(XP_UNIX)
 #define USE_NSPR
 /* XXXrobm This is UNIX-only for the moment */
 #define LOG_BUFFERING
@@ -527,7 +489,6 @@ typedef void* PASSWD;
 #endif /* IRIX */
 #endif /* SW_THREADS */
 #define THREAD_ANY
-#endif /* XP_UNIX */
 
 /* --- End the great debate --- */
 

+ 0 - 4
include/ldaputil/cert.h

@@ -44,12 +44,8 @@
 #define _LDAPU_CERT_H
 
 #ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
 #define NSAPI_PUBLIC 
 #endif
-#endif
 
 #ifdef __cplusplus
 extern "C" {

+ 0 - 4
include/ldaputil/dbconf.h

@@ -46,12 +46,8 @@
 #include <stdio.h>
 
 #ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
 #define NSAPI_PUBLIC 
 #endif
-#endif
 
 typedef struct dbconf_propval {
     char *prop;			    /* Property name */

+ 0 - 4
include/ldaputil/encode.h

@@ -44,12 +44,8 @@
 #define _LDAPU_ENCODE_H
 
 #ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
 #define NSAPI_PUBLIC 
 #endif
-#endif
 
 #ifdef __cplusplus
 extern "C" {

+ 0 - 4
include/ldaputil/errors.h

@@ -44,12 +44,8 @@
 #define _LDAPU_ERRORS_H
 
 #ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
 #define NSAPI_PUBLIC 
 #endif
-#endif
 
 #ifdef DBG_PRINT
 #include <stdio.h>

+ 1 - 16
include/ldaputil/extcmap.h

@@ -46,12 +46,8 @@
 #include <ldap.h>
 
 #ifndef NSAPI_PUBLIC
-#if defined( _WINDOWS ) || defined( _WIN32 ) || defined( XP_WIN32 )
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
 #define NSAPI_PUBLIC 
 #endif
-#endif
 
 
 #define LDAPU_ATTR_INITFN		"InitFn"
@@ -311,20 +307,9 @@ NSAPI_PUBLIC extern int CertMapDLLInitFn(LDAPUDispatchVector_t **table);
 
 extern LDAPUDispatchVector_t *__ldapu_table;
 
-#if defined( _WINDOWS ) || defined( _WIN32 ) || defined( XP_WIN32 )
-#define CertmapDLLInitFnTbl LDAPUDispatchVector_t *__ldapu_table;
-#define CertmapDLLInit(rv, libname) \
-{\
-	HANDLE h = LoadLibrary((libname)); \
-	CertMapDLLInitFn_t init_fn; \
-	if (!h) return LDAPU_CERT_MAP_INITFN_FAILED; \
-	init_fn = (CertMapDLLInitFn_t)GetProcAddress(h, "CertMapDLLInitFn"); \
-	rv = init_fn(&__ldapu_table); \
-}
-#else
 #define CertmapDLLInit(rv, libname)
 #define CertmapDLLInitFnTbl
-#endif
+
 
 #endif /* INTLDAPU */
 

+ 0 - 4
include/ldaputil/ldapauth.h

@@ -47,12 +47,8 @@
 #include <ldap.h>
 
 #ifndef NSAPI_PUBLIC
-#ifdef XP_WIN32
-#define NSAPI_PUBLIC __declspec(dllexport)
-#else
 #define NSAPI_PUBLIC 
 #endif
-#endif
 
 #ifdef __cplusplus
 extern "C" {

+ 0 - 7
include/libadmin/libadmin.h

@@ -51,17 +51,10 @@
 
 #include <stdio.h>
 #include <limits.h>
-
 #include "base/systems.h"
 #include "base/systhr.h"
 #include "base/util.h"
- 
-#ifdef XP_UNIX
 #include <unistd.h>
-#else /* XP_WIN32 */
-#include <winsock.h>
-#endif /* XP_WIN32 */
-
 #include "prinit.h"
 #include "prthread.h"
 #include "prlong.h"

+ 0 - 28
include/netsite.h

@@ -78,38 +78,10 @@
 #define VOID void
 #endif
 
-#ifdef XP_UNIX
-/*
- * Provide some typedefs that are commonly used on windows
- *
- * DO NOT USE THESE!  They will be deleted later!
- *
- */
-#define CONST const
-typedef unsigned long       DWORD;
-typedef int                 BOOL;
-typedef unsigned char       BYTE;
-typedef unsigned short      WORD;
-typedef float               FLOAT;
-typedef FLOAT               *PFLOAT;
-typedef BOOL                *PBOOL;
-typedef BOOL                *LPBOOL;
-typedef BYTE                *PBYTE;
-typedef BYTE                *LPBYTE;
-typedef int                 *PINT;
-typedef int                 *LPINT;
-typedef WORD                *PWORD;
-typedef WORD                *LPWORD;
-typedef long                *LPLONG;
-typedef DWORD               *PDWORD;
-typedef DWORD               *LPDWORD;
-typedef void                *LPVOID;
-
 #ifndef SNI
 #if !defined (boolean) && !defined (__GNUC__)
 typedef int                  boolean;
 #endif
-#endif
 
 #endif
 #define NS_TRUE              1

+ 1 - 31
include/public/base/systems.h

@@ -212,41 +212,11 @@
 #define SHMEM_UNIX_MMAP
 #define ZERO(ptr,len) memset(ptr,0,len)
 
-#elif defined (XP_WIN32)      /* Windows NT */
-
-#include <wtypes.h>
-#include <winbase.h>
-
-typedef void* PASSWD;
-
-#define caddr_t PCHAR
-#define CASECMPARG_T const
-#define FILE_WIN32
-#define FILE_WIN32_MMAP
-#define MALLOC_POOLS
-#define NEED_STRCASECMP
-#define NEED_STRNCASECMP
-#define NET_WINSOCK
-#define NSAPI_PUBLIC __declspec(dllexport)
-/* The stat call under NT doesn't define these macros */
-#ifndef S_ISDIR
-#define S_ISDIR(mode)   ((mode&S_IFMT) == S_IFDIR)
-#endif
-#ifndef S_ISREG
-#define S_ISREG(mode)   ((mode&S_IFMT) == S_IFREG)                             
-#endif
-#ifndef S_ISLNK
-#define S_ISLNK(x) (0)
-#endif
-#define SEM_WIN32
-#define SHMEM_WIN32_MMAP
-#define ZERO(ptr, len) ZeroMemory(ptr, len)
-
 #else
 
 #error "Missing defines in ns/netsite/include/public/base/systems.h"
 
-#endif	/* Windows NT */
+#endif
 
 #ifndef NSPR_BEGIN_EXTERN_C
 #ifdef __cplusplus

+ 0 - 11
include/public/nsacl/aclapi.h

@@ -274,19 +274,8 @@ struct ACLDispatchVector {
     int (*f_ACL_GetDefaultResult)(ACLEvalHandle_t *acleval);
 };
 
-#ifdef XP_WIN32
-
-#ifdef INTNSACL
-NSAPI_PUBLIC extern ACLDispatchVector_t *__nsacl_table;
-#else
-__declspec(dllimport) ACLDispatchVector_t *__nsacl_table;
-#endif /* INTNSACL */
-
-#else /* !XP_WIN32 */
-
 NSAPI_PUBLIC extern ACLDispatchVector_t *__nsacl_table;
 
-#endif /* XP_WIN32 */
 
 #ifndef INTNSACL
 

+ 0 - 57
include/public/nsapi.h

@@ -63,11 +63,7 @@
 /* Used in some places as a length limit on error messages */
 #define MAGNUS_ERROR_LEN 1024
 
-#ifdef XP_WIN32
-#define ENDLINE "\r\n"
-#else
 #define ENDLINE "\n"
-#endif
 
 /*
  * The maximum length of an error message. NOT RUN-TIME CHECKED
@@ -134,17 +130,9 @@
 /* The disk page size on this machine. */
 #define FILE_BUFFERSIZE 4096
 
-#ifdef XP_UNIX
-
 #define FILE_PATHSEP '/'
 #define FILE_PARENT "../"
 
-#elif defined(XP_WIN32)
-
-#define FILE_PATHSEP '/'
-#define FILE_PARENT "..\\"
-
-#endif /* XP_WIN32 */
 
 /* WILDPAT uses shell expressions */
 #define WILDPAT_VALID(exp)              shexp_valid(exp)
@@ -174,17 +162,6 @@
 #include <unistd.h>
 #endif
 
-#ifdef FILE_WIN32
-#include <direct.h>
-#endif /* FILE_WIN32 */
-
-#ifdef NET_WINSOCK
-#include <winsock.h>
-struct iovec {
-	char		*iov_base;
-    unsigned	iov_len;
-};
-#else
 #if !defined(SUNOS4) && !defined(HPUX) && !defined(LINUX)
 #include <sys/select.h>
 #endif
@@ -192,10 +169,7 @@ struct iovec {
 #include <sys/socket.h>
 #include <netinet/in.h> /* sockaddr and in_addr */
 #include <sys/uio.h>
-#endif /* NET_WINSOCK */
-
 #include <sys/stat.h>
-
 #include <ctype.h>  /* isspace */
 #include <stdio.h>
 #include <stdarg.h>
@@ -203,11 +177,8 @@ struct iovec {
 #include <string.h>
 #include <errno.h>
 #include <time.h>
-
-#ifdef XP_UNIX
 #include <dirent.h>
 #include <pwd.h>                /* struct passwd */
-#endif /* XP_UNIX */
 
 #ifndef BIG_LINE
 #define BIG_LINE 1024
@@ -228,28 +199,8 @@ typedef void *SYS_FILE;
 typedef void* CONDVAR;
 typedef void *COUNTING_SEMAPHORE;
 typedef void* CRITICAL;
-
-#ifdef XP_UNIX
 typedef DIR* SYS_DIR;
 typedef struct dirent SYS_DIRENT;
-#endif /* XP_UNIX */
-
-#ifdef XP_WIN32
-
-typedef struct {
-    char *d_name;
-} dirent_s;
-
-typedef struct {
-    HANDLE dp;
-    WIN32_FIND_DATA fdata;
-    dirent_s de;
-} dir_s;
-
-typedef dir_s* SYS_DIR;
-typedef dirent_s SYS_DIRENT;
-
-#endif /* XP_WIN32 */
 
 typedef struct {
     char *name,*value;
@@ -318,7 +269,6 @@ typedef struct {
 #define strncasecmp(s1, s2, n) util_strncasecmp(s1, s2, n)
 #endif /* NEED_STRNCASECMP */
 
-#ifdef XP_UNIX
 #define dir_open opendir
 #define dir_read readdir
 #define dir_close closedir
@@ -326,13 +276,6 @@ typedef struct {
 #define dir_remove rmdir
 #define system_chdir chdir
 #define file_unix2local(path,p2) strcpy(p2,path)
-#endif /* XP_UNIX */
-
-#ifdef XP_WIN32
-#define dir_create _mkdir
-#define dir_remove _rmdir
-#define system_chdir SetCurrentDirectory
-#endif /* XP_WIN32 */
 
 /*
  * Thread-safe variant of localtime

+ 0 - 12
ldap/include/disptmpl.h

@@ -64,22 +64,10 @@ extern "C" {
 
 /* calling conventions used by library */
 #ifndef LDAP_CALL
-#if defined( _WINDOWS ) || defined( _WIN32 )
-#define LDAP_C __cdecl
-#ifndef _WIN32 
-#define __stdcall _far _pascal
-#define LDAP_CALLBACK _loadds
-#else
-#define LDAP_CALLBACK
-#endif /* _WIN32 */
-#define LDAP_PASCAL __stdcall
-#define LDAP_CALL LDAP_PASCAL
-#else /* _WINDOWS */
 #define LDAP_C
 #define LDAP_CALLBACK
 #define LDAP_PASCAL
 #define LDAP_CALL
-#endif /* _WINDOWS */
 #endif /* LDAP_CALL */
 
 #define LDAP_TEMPLATE_VERSION	1

+ 0 - 31
ldap/include/ldaplog.h

@@ -86,36 +86,6 @@ extern "C" {
 #  undef LDAPDebug2Args
 #  undef LDAPDebugLevelIsSet
 
-#    ifdef _WIN32
-#      ifndef DONT_DECLARE_SLAPD_LDAP_DEBUG /* see libglobs.c for info */
-       extern __declspec(dllimport) int	slapd_ldap_debug;
-#      endif /* DONT_DECLARE_SLAPD_LDAP_DEBUG */
-#      define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
-       { \
-		if ( *module_ldap_debug & level ) { \
-		        slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
-	    } \
-       }
-#      define LDAPDebug0Args( level, fmt )	\
-       { \
-		if ( *module_ldap_debug & level ) { \
-		        slapd_log_error_proc( NULL, fmt ); \
-	    } \
-       }
-#      define LDAPDebug1Arg( level, fmt, arg )      \
-       { \
-		if ( *module_ldap_debug & level ) { \
-		        slapd_log_error_proc( NULL, fmt, arg ); \
-	    } \
-       }
-#      define LDAPDebug2Args( level, fmt, arg1, arg2 )    \
-       { \
-		if ( *module_ldap_debug & level ) { \
-		        slapd_log_error_proc( NULL, fmt, arg1, arg2 ); \
-	    } \
-       }
-#      define LDAPDebugLevelIsSet( level ) (0 != (*module_ldap_debug & level))
-#    else /* Not _WIN32 */
        extern int	slapd_ldap_debug;
 #      define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
        { \
@@ -142,7 +112,6 @@ extern "C" {
 	    } \
        }
 #      define LDAPDebugLevelIsSet( level ) (0 != (slapd_ldap_debug & level))
-#    endif /* Win32 */
 #endif /* LDAP_DEBUG */
 
 #ifdef __cplusplus

+ 0 - 58
ldap/include/lthread.h

@@ -317,64 +317,6 @@ typedef struct irix_cv {
 
 #else
 
-#if defined( WIN32_KERNEL_THREADS )
-
-/***********************************
- *                                 *
- * thread definitions for Win32    *
- *                                 *
- ***********************************/
-
-#define _THREAD
-
-#include <windows.h>
-#include <process.h>
-#include "ldap.h"
-#include "ldaplog.h"
-
-typedef void	(*VFP)(void *);
-
-/* Win32 threads are preemptive */
-#define PTHREAD_PREEMPTIVE	1
-
-/* thread attributes and thread type */
-typedef int	pthread_attr_t;
-typedef HANDLE	pthread_t;
-
-/* default attr states */
-#define pthread_mutexattr_default	0
-#define pthread_condattr_default	0
-
-/* thread state - joinable or not */
-#define PTHREAD_CREATE_JOINABLE	0
-#define PTHREAD_CREATE_DETACHED	1
-/* thread scope - who is in scheduling pool */
-#define PTHREAD_SCOPE_PROCESS	0
-#define PTHREAD_SCOPE_SYSTEM	1
-
-/* mutex attributes and mutex type */
-typedef int	pthread_mutexattr_t;
-typedef HANDLE	pthread_mutex_t;
-
-/* mutex and condition variable scope - process or system */
-#define PTHREAD_SHARE_PRIVATE	0
-#define PTHREAD_SHARE_PROCESS	1
-
-/* condition variable attributes and condition variable type */
-typedef int	pthread_condattr_t;
-
-/* simulated condition variable */
-struct win32_cv_waiter {
-	pthread_t			icvw_pthread;
-	struct win32_cv_waiter	*icvw_next;
-};
-typedef struct win32_cv {
-	pthread_mutex_t		icv_mutex;
-	pthread_mutex_t		*icv_waitermutex;
-	struct win32_cv_waiter	*icv_waiterq;
-} pthread_cond_t;
-
-#endif /* NATIVE_WIN32_THREADS */
 #endif /* sgi sproc */
 #endif /* dce pthreads */
 #endif /* hp dce pthreads */

+ 0 - 78
ldap/include/ntslapdregparms.h

@@ -1,78 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- * 
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- * 
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception. 
- * 
- * 
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/******************************************************
- *
- *
- *  ntslapdregparms.h - NT Registry keys for Slapd.
- *
- ******************************************************/
-
-#if defined( _WIN32 )
-
-#if !defined( _NTSLAPDREGPARMS_H_ )
-#define	_NTSLAPDREGPARMS_H_
-
-#define COMPANY_KEY "SOFTWARE\\Netscape"
-#define COMPANY_NAME		VENDOR
-#define PROGRAM_GROUP_NAME	VENDOR
-#define PRODUCT_NAME		"slapd"
-#define PRODUCT_BIN			"ns-slapd"
-#define SLAPD_EXE		    "slapd.exe"
-#define SERVICE_EXE		    SLAPD_EXE
-#define	SLAPD_CONF			"slapd.conf"
-#define	MAGNUS_CONF			SLAPD_CONF
-#define SLAPD_DONGLE_FILE	"password.dng"
-#define DONGLE_FILE_NAME	SLAPD_DONGLE_FILE
-#define PRODUCT_VERSION		"1.0"
-#define EVENTLOG_APPNAME	VENDOR "Slapd"
-#define DIRECTORY_SERVICE_PREFIX	CAPBRAND " Directory Server "
-#define SERVICE_PREFIX		DIRECTORY_SERVICE_PREFIX
-#define CONFIG_PATH_KEY		"ConfigurationPath"
-#define EVENTLOG_MESSAGES_KEY "EventMessageFile"
-#define EVENT_LOG_KEY		"SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application"
-#define ADMIN_REGISTRY_ROOT_KEY "Admin Server"
-#define SLAPD_REGISTRY_ROOT_KEY	"Slapd Server"
-#define PRODUCT_KEY			SLAPD_REGISTRY_ROOT_KEY
-#endif /* _NTSLAPDREGPARMS_H_ */
-
-#endif /* _WIN32 */

+ 0 - 105
ldap/include/ntwatchdog.h

@@ -1,105 +0,0 @@
-/** BEGIN COPYRIGHT BLOCK
- * This Program is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License as published by the Free Software
- * Foundation; version 2 of the License.
- * 
- * This Program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License along with
- * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA.
- * 
- * In addition, as a special exception, Red Hat, Inc. gives You the additional
- * right to link the code of this Program with code not covered under the GNU
- * General Public License ("Non-GPL Code") and to distribute linked combinations
- * including the two, subject to the limitations in this paragraph. Non-GPL Code
- * permitted under this exception must only link to the code of this Program
- * through those well defined interfaces identified in the file named EXCEPTION
- * found in the source code files (the "Approved Interfaces"). The files of
- * Non-GPL Code may instantiate templates or use macros or inline functions from
- * the Approved Interfaces without causing the resulting work to be covered by
- * the GNU General Public License. Only Red Hat, Inc. may make changes or
- * additions to the list of Approved Interfaces. You must obey the GNU General
- * Public License in all respects for all of the Program code and other code used
- * in conjunction with the Program except the Non-GPL Code covered by this
- * exception. If you modify this file, you may extend this exception to your
- * version of the file, but you are not obligated to do so. If you do not wish to
- * provide this exception without modification, you must delete this exception
- * statement from your version and license this file solely under the GPL without
- * exception. 
- * 
- * 
- * Copyright (C) 2001 Sun Microsystems, Inc. Used by permission.
- * Copyright (C) 2005 Red Hat, Inc.
- * All rights reserved.
- * END COPYRIGHT BLOCK **/
-
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
-/******************************************************
- *
- *
- *  ntwatchdog.h - Defs for NT Watchdog Service.
- *
- ******************************************************/
-
-#if defined( _WIN32 )
-
-#if !defined( _NTWATCHDOG_H_ )
-#define	_NTWATCHDOG_H_
-
-#define FILE_PATHSEP '/'
-
-#define SLAPD_ROOT             "SLAPD_ROOT"   // environment variable holding server root path
-#define MORTALITY_KEY          "MortalityTimeSecs"
-#define MINRAMFREE_KEY         "MinRamFree"
-#define MINRAMTOTAL_KEY        "MinRamTotal"
-#define MINRAMPERSERVER_KEY    "MinRamPerServer"
-#define DEFAULT_MORTALITY_TIME  60              // seconds after startup up until server will NOT be restarted
-#define DEFAULT_KILL_TIME       600             // seconds to wait for httpd.exe to shutdown
-#define DEFAULT_CRON_TIME       60              // seconds to wait before rechecking cron.conf
-#define DEFAULT_RESTART_TIME    10              // seconds to wait before restarting server
-#define DEFAULT_MINRAMFREE      0               // KB free physical memory remaining
-#define DEFAULT_MINRAMTOTAL     (30 * 1024)     // KB free physical memory installed
-#define DEFAULT_MINRAMPERSERVER (15 * 1024)     // KB free physical memory per server
-
-#define MSG_RESOURCES         "Not enough physical memory to start server."
-
-// offsets for extra window bytes, used in Set/GetWindowLong()
-#define GWL_PROCESS_HANDLE  (sizeof(LONG) * 0)
-#define GWL_PASSWORD_ADDR   (sizeof(LONG) * 1)
-#define GWL_PASSWORD_LENGTH (sizeof(LONG) * 2)
-
-#define MAX_LINE      512
-#define MAX_PASSWORD  256
-#define MAX_TOKENNAME 50
-
-typedef struct PK11_PIN
-{
-	char TokenName[MAX_TOKENNAME];
-	int  TokenLength;
-	char Password[MAX_PASSWORD];
-	int  PasswordLength;
-}PK11_PIN;
-
-#define CLOSEHANDLE(X) \
-{ \
-	if(X) \
-	{ \
-		CloseHandle(X); \
-		X = 0; \
-	} \
-}
-
-// in ntcron.c
-LPTHREAD_START_ROUTINE CRON_ThreadProc(HANDLE hevWatchDogExit);
-
-// in watchdog.c
-BOOL WD_SysLog(WORD fwEventType, DWORD IDEvent, char *szData);
-
-#endif /* _NTWATCHDOG_H_ */
-#endif /* _WIN32 */

+ 2 - 2
ldap/include/regex.h

@@ -40,7 +40,7 @@
 #  include <config.h>
 #endif
 
-#if defined( macintosh ) || defined( DOS ) || defined( _WINDOWS ) || defined( NEED_BSDREGEX )
+#if defined( macintosh ) || defined( NEED_BSDREGEX )
 /*
  * Copyright (c) 1993 Regents of the University of Michigan.
  * All rights reserved.
@@ -97,4 +97,4 @@ int  re_subs();
 #ifdef __cplusplus
 }
 #endif
-#endif /* macintosh or DOS or or _WIN32 or NEED_BSDREGEX */
+#endif /* macintosh or NEED_BSDREGEX */

+ 0 - 12
ldap/include/srchpref.h

@@ -65,22 +65,10 @@ extern "C" {
 
 /* calling conventions used by library */
 #ifndef LDAP_CALL
-#if defined( _WINDOWS ) || defined( _WIN32 )
-#define LDAP_C __cdecl
-#ifndef _WIN32 
-#define __stdcall _far _pascal
-#define LDAP_CALLBACK _loadds
-#else
-#define LDAP_CALLBACK
-#endif /* _WIN32 */
-#define LDAP_PASCAL __stdcall
-#define LDAP_CALL LDAP_PASCAL
-#else /* _WINDOWS */
 #define LDAP_C
 #define LDAP_CALLBACK
 #define LDAP_PASCAL
 #define LDAP_CALL
-#endif /* _WINDOWS */
 #endif /* LDAP_CALL */
 
 struct ldap_searchattr {

+ 0 - 6
ldap/libraries/libavl/avl.c

@@ -58,12 +58,6 @@ static char copyright[] = "@(#) Copyright (c) 1993 Regents of the University of
 static char avl_version[] = "AVL library version 1.0\n";
 #endif
 
-#ifdef _WIN32
-typedef char *caddr_t;
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
 #include <sys/types.h>
 #include <stdlib.h>
 #include <stdio.h>

+ 0 - 3
ldap/libraries/libavl/testavl.c

@@ -41,9 +41,6 @@
 #endif
 
 /* testavl.c - Test Tim Howes AVL code */
-#ifdef _WIN32
-#include <windows.h>
-#endif
 #include <sys/types.h>
 #include <stdio.h>
 #include "avl.h"

+ 0 - 5
ldap/servers/plugins/acl/acl.h

@@ -69,13 +69,10 @@
 #include 	<string.h>
 #include 	<sys/types.h>
 #include	<limits.h>
-#ifndef _WIN32
 #include 	<sys/socket.h>
 #include 	<netinet/in.h>
 #include 	<arpa/inet.h>
 #include 	<netdb.h>
-#endif
-
 #include 	<ldap.h>
 #include 	<las.h>
 #include	<aclproto.h>
@@ -86,9 +83,7 @@
 #include	"slapi-private.h"
 #include	"portable.h"
 #include	"avl.h"
-
 #include	"cert.h"
-
 #include	<plhash.h>
 
 #ifdef SOLARIS

+ 1 - 87
ldap/servers/plugins/acl/acldllmain.c

@@ -41,96 +41,17 @@
 #endif
 
 #include "acl.h"
+#include <stdio.h>
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
 
 #ifdef LDAP_DEBUG
-#ifndef _WIN32
 #include <stdarg.h>
-#include <stdio.h>
 
 void LDAPDebug( int level, char* fmt, ... )
 {
@@ -148,13 +69,7 @@ void LDAPDebug( int level, char* fmt, ... )
 	}
 }
 #endif
-#endif
-
-#ifndef _WIN32
 
-/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
 
 void perror( const char *msg )
 {
@@ -163,4 +78,3 @@ void perror( const char *msg )
 	OutputDebugString( buf );
 }
 
-#endif

+ 0 - 9
ldap/servers/plugins/acl/aclplugin.c

@@ -405,12 +405,3 @@ acl_access_allowed_main ( Slapi_PBlock *pb, Slapi_Entry *e, char **attrs,
 
 	return rc;
 }
-#ifdef _WIN32
-
-int *module_ldap_debug = 0;
-void plugin_init_debug_level ( int *level_ptr )
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
-

+ 0 - 9
ldap/servers/plugins/chainingdb/cb_debug.c

@@ -49,12 +49,3 @@
 #include <sys/types.h>
 #include "cb.h"
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-        module_ldap_debug = level_ptr;
-}
-#endif
-

+ 0 - 4
ldap/servers/plugins/chainingdb/cb_init.c

@@ -59,10 +59,6 @@ static void cb_set_backend_type(cb_backend * cb) {
 }
 
 /* Initialization function */
-#ifdef _WIN32
-__declspec(dllexport)
-#endif
-
 int
 chaining_back_init( Slapi_PBlock *pb )
 {

+ 2 - 89
ldap/servers/plugins/chainingdb/cbdllmain.c

@@ -41,96 +41,18 @@
 #endif
 
 #include "cb.h"
+#include <stdio.h>
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
+
 
 #ifdef LDAP_DEBUG
-#ifndef _WIN32
 #include <stdarg.h>
-#include <stdio.h>
 
 void LDAPDebug( int level, char* fmt, ... )
 {
@@ -147,13 +69,6 @@ void LDAPDebug( int level, char* fmt, ... )
 	}
 }
 #endif
-#endif
-
-#ifndef _WIN32
-
-/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
 
 void perror( const char *msg )
 {
@@ -161,5 +76,3 @@ void perror( const char *msg )
 	wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
 	OutputDebugString( buf );
 }
-
-#endif

+ 0 - 2
ldap/servers/plugins/collation/config.c

@@ -78,11 +78,9 @@ strtok_quote( char *line, char *sep )
 	    }
 	    break;
 
-#ifndef _WIN32
 	  case '\\':
 	    *d++ = *++next;
 	    break;
-#endif
 
 	  default:
 	    if ( ! inquote ) {

+ 0 - 9
ldap/servers/plugins/collation/debug.c

@@ -40,12 +40,3 @@
 #  include <config.h>
 #endif
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void
-plugin_init_debug_level (int *level_ptr)
-{
-    module_ldap_debug = level_ptr;
-}
-#endif

+ 2 - 85
ldap/servers/plugins/collation/dllmain.c

@@ -44,96 +44,18 @@
  * Microsoft Windows specifics for collation DLL
  */
 #include "ldap.h"
+#include <stdio.h>
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
 
 #ifdef LDAP_DEBUG
-#ifndef _WIN32
+
 #include <stdarg.h>
-#include <stdio.h>
 
 void LDAPDebug( int level, char* fmt, ... )
 {
@@ -151,11 +73,7 @@ void LDAPDebug( int level, char* fmt, ... )
 	}
 }
 #endif
-#endif
 
-#ifndef _WIN32
-/* The 16-bit version of the RTL does not implement perror() */
-#include <stdio.h>
 
 void perror( const char *msg )
 {
@@ -164,4 +82,3 @@ void perror( const char *msg )
 	OutputDebugString( buf );
 }
 
-#endif

+ 1 - 13
ldap/servers/plugins/cos/cos.c

@@ -48,11 +48,8 @@
 #include "slapi-private.h"
 #include "cos_cache.h"
 #include "vattr_spi.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
+
 
 /*** secret slapd stuff ***/
 
@@ -98,15 +95,6 @@ static Slapi_PluginDesc pdesc = { "cos", VENDOR, DS_PACKAGE_VERSION,
 static void * cos_plugin_identity = NULL;
 
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
-
 /*
 ** Plugin identity mgmt
 */

+ 1 - 78
ldap/servers/plugins/cos/dllmain.c

@@ -47,87 +47,10 @@
 #include "lber.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
+

+ 0 - 73
ldap/servers/plugins/distrib/dllmain.c

@@ -46,82 +46,9 @@
 #include "ldap.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   /* successful DLL_PROCESS_ATTACH */
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 0 - 15
ldap/servers/plugins/dna/dna.c

@@ -60,10 +60,7 @@
 #error Need to define portable format macros such as PRIu64
 #endif /* HAVE_INTTYPES_H */
 
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
 
 #define DNA_PLUGIN_SUBSYSTEM "dna-plugin"
 #define DNA_PLUGIN_VERSION 0x00020000
@@ -318,18 +315,6 @@ static int dna_be_txn_mod_pre_op(Slapi_PBlock *pb);
 void dna_dump_config();
 void dna_dump_config_entry(struct configEntry *);
 
-/**
- * set the debug level
- */
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-    module_ldap_debug = level_ptr;
-}
-#endif
-
 /*
  * During the plugin startup we delay the creation of the shared config entries
  * so all the other betxn plugins have time to start.  During the "delayed"

+ 0 - 79
ldap/servers/plugins/http/dllmain.c

@@ -47,89 +47,10 @@
 #include "ldap.h"
 #include "lber.h"
 
-#ifdef _WIN32
 
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   /* successful DLL_PROCESS_ATTACH */
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 3 - 28
ldap/servers/plugins/http/http_client.c

@@ -47,20 +47,14 @@
 
 #include <stdio.h>
 #include <string.h>
-
 #include "portable.h"
 #include "nspr.h"
-
 #include "slapi-plugin.h"
 #include "slapi-private.h"
-
 #include "http_client.h"
 #include "http_impl.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
+
 
 /*** from proto-slap.h ***/
 
@@ -81,23 +75,13 @@ extern "C" {
 #define LDAP_DEBUG_PLUGIN	0x10000		/* 65536 */
 
 /* debugging stuff */
-#    ifdef _WIN32
-       extern int	*module_ldap_debug;
-#      define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
-       { \
-		if ( *module_ldap_debug & level ) { \
-		        slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
-	    } \
-       }
-#    else /* _WIN32 */
-       extern int	slapd_ldap_debug;
-#      define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
+extern int	slapd_ldap_debug;
+#define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
        { \
 		if ( slapd_ldap_debug & level ) { \
 		        slapd_log_error_proc( NULL, fmt, arg1, arg2, arg3 ); \
 	    } \
        }
-#    endif /* Win32 */
 
 #ifdef __cplusplus
 }
@@ -145,15 +129,6 @@ static int _http_get_redirected_uri(char *url, char **data, int *bytesRead);
 static int _http_post(char *url, httpheader **httpheaderArray, char *body, char **data, int *bytesRead);
 static void _http_shutdown( void );
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
-
 /**
  *	
  * Get the presence plug-in version

+ 0 - 3
ldap/servers/plugins/http/http_impl.c

@@ -60,10 +60,7 @@
 #include "slap.h"
 #include "slapi-private.h"
 #include "slapi-plugin-compat4.h"
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
 
 /*** from proto-slap.h ***/
 

+ 0 - 8
ldap/servers/plugins/pam_passthru/pam_ptdebug.c

@@ -49,11 +49,3 @@
 #include <sys/types.h>
 #include "pam_passthru.h"
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif

+ 2 - 89
ldap/servers/plugins/pam_passthru/pam_ptdllmain.c

@@ -42,97 +42,19 @@
 #include "ldap.h"
 #include "lber.h"
 #include "passthru.h"
+#include <stdio.h>
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
+
 
 #ifdef LDAP_DEBUG
-#ifndef _WIN32
 #include <stdarg.h>
-#include <stdio.h>
 
 void LDAPDebug( int level, char* fmt, ... )
 {
@@ -150,13 +72,6 @@ void LDAPDebug( int level, char* fmt, ... )
 	}
 }
 #endif
-#endif
-
-#ifndef _WIN32
-
-/* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
 
 void perror( const char *msg )
 {
@@ -164,5 +79,3 @@ void perror( const char *msg )
 	wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
 	OutputDebugString( buf );
 }
-
-#endif

+ 0 - 8
ldap/servers/plugins/passthru/ptdebug.c

@@ -50,11 +50,3 @@
 #include <sys/types.h>
 #include "passthru.h"
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif

+ 1 - 87
ldap/servers/plugins/passthru/ptdllmain.c

@@ -43,97 +43,17 @@
 #include "ldap.h"
 #include "lber.h"
 #include "passthru.h"
+#include <stdio.h>
 
-
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
 
 #ifdef LDAP_DEBUG
-#ifndef _WIN32
 #include <stdarg.h>
-#include <stdio.h>
 
 void LDAPDebug( int level, char* fmt, ... )
 {
@@ -151,14 +71,9 @@ void LDAPDebug( int level, char* fmt, ... )
 	}
 }
 #endif
-#endif
 
-#ifndef _WIN32
 
 /* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
-
 void perror( const char *msg )
 {
 	char buf[128];
@@ -166,4 +81,3 @@ void perror( const char *msg )
 	OutputDebugString( buf );
 }
 
-#endif

+ 0 - 78
ldap/servers/plugins/presence/dllmain.c

@@ -47,87 +47,9 @@
 #include "lber.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 3 - 24
ldap/servers/plugins/presence/presence.c

@@ -54,13 +54,9 @@
 #include "vattr_spi.h"
 #include "plhash.h"
 #include "ldif.h"
-
 #include "http_client.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
+
 
 /*** from proto-slap.h ***/
 
@@ -81,13 +77,8 @@ extern "C" {
 #define LDAP_DEBUG_PLUGIN	0x10000		/* 65536 */
 
 /* debugging stuff */
-#    ifdef _WIN32
-       extern int	*module_ldap_debug;
-#      define LDAPDebugLevelIsSet( level )	( *module_ldap_debug & level )
-#    else /* _WIN32 */
-       extern int	slapd_ldap_debug;
-#      define LDAPDebugLevelIsSet( level )	( slapd_ldap_debug & level )
-#    endif /* Win32 */
+extern int slapd_ldap_debug;
+#define LDAPDebugLevelIsSet( level )	( slapd_ldap_debug & level )
 
 #define LDAPDebug( level, fmt, arg1, arg2, arg3 )	\
        { \
@@ -244,18 +235,6 @@ void printMapTable();
 PRIntn printIdVattrMapTable(PLHashEntry *he, PRIntn i, void *arg);
 PRIntn printIdConfigMapTable(PLHashEntry *he, PRIntn i, void *arg);
 
-/**
- * set the debug level
- */
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
-
 /**
  *	
  * Get the presence plug-in version

+ 0 - 4
ldap/servers/plugins/pwdstorage/crypt_pwd.c

@@ -48,9 +48,6 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
-#ifdef _WIN32
-char *crypt(char *key, char *salt);
-#else
 #include <sys/socket.h>
 #if defined( hpux ) || defined ( AIX ) || defined (LINUX) || defined (OSF1)
 #ifndef __USE_XOPEN
@@ -60,7 +57,6 @@ char *crypt(char *key, char *salt);
 #else /* hpux */
 #include <crypt.h>
 #endif /* hpux */
-#endif /* _WIN32 */
 
 #include "pwdstorage.h"
 

+ 0 - 73
ldap/servers/plugins/pwdstorage/dllmain.c

@@ -47,82 +47,9 @@
 #include "ldap.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   /* successful DLL_PROCESS_ATTACH */
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 0 - 2
ldap/servers/plugins/pwdstorage/pwd_init.c

@@ -63,9 +63,7 @@ static Slapi_PluginDesc sha512_pdesc = { "sha512-password-storage-scheme", VENDO
 
 static Slapi_PluginDesc ssha512_pdesc = { "ssha512-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Salted Secure Hashing Algorithm (SSHA512)" };
 
-#ifndef _WIN32
 static Slapi_PluginDesc crypt_pdesc = { "crypt-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "Unix crypt algorithm (CRYPT)" };
-#endif
 
 static Slapi_PluginDesc clear_pdesc = { "clear-password-storage-scheme", VENDOR, DS_PACKAGE_VERSION, "No encryption (CLEAR)" };
 

+ 0 - 2
ldap/servers/plugins/pwdstorage/pwdstorage.h

@@ -101,11 +101,9 @@ char * sha512_pw_enc( const char *pwd );
 char * salted_sha512_pw_enc( const char *pwd );
 int clear_pw_cmp( const char *userpwd, const char *dbpwd );
 char *clear_pw_enc( const char *pwd );
-#ifndef _WIN32
 void crypt_init();
 int crypt_pw_cmp( const char *userpwd, const char *dbpwd );
 char *crypt_pw_enc( const char *pwd );
-#endif
 int ns_mta_md5_pw_cmp( const char *userpwd, const char *dbpwd );
 int md5_pw_cmp( const char *userpwd, const char *dbpwd );
 char *md5_pw_enc( const char *pwd );

+ 0 - 77
ldap/servers/plugins/referint/dllmain.c

@@ -46,83 +46,6 @@
 #include "ldap.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {

+ 0 - 19
ldap/servers/plugins/referint/referint.c

@@ -45,25 +45,14 @@
 #include "portable.h"
 #include "slapi-plugin.h"
 #include "slap.h"
-
-/* include NSPR header files */
 #include "prthread.h"
 #include "prlock.h"
 #include "prerror.h"
 #include "prcvar.h"
 #include "prio.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
 
-#ifdef _WIN32
-#define REFERINT_DEFAULT_FILE_MODE	0
-#else
 #define REFERINT_DEFAULT_FILE_MODE S_IRUSR | S_IWUSR
-#endif
-
 #define REFERINT_PLUGIN_SUBSYSTEM   "referint-plugin"   /* used for logging */
 #define REFERINT_PREOP_DESC "referint preop plugin"
 #define REFERINT_ATTR_DELAY "referint-update-delay"
@@ -129,14 +118,6 @@ static void* referint_plugin_identity = NULL;
 static int use_txn = 0;
 static int premodfn = SLAPI_PLUGIN_PRE_MODIFY_FN;
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
 
 static void
 referint_lock()

+ 0 - 5
ldap/servers/plugins/replication/cl5_api.c

@@ -174,13 +174,8 @@
 #define DEFAULT_THREAD_STACKSIZE 	0
 #endif
 
-#ifdef _WIN32
-#define FILE_CREATE_MODE S_IREAD | S_IWRITE
-#define DIR_CREATE_MODE  0755
-#else /* _WIN32 */
 #define FILE_CREATE_MODE S_IRUSR | S_IWUSR
 #define DIR_CREATE_MODE  0755
-#endif
 
 #define NO_DISK_SPACE 1024
 #define MIN_DISK_SPACE 10485760    /* 10 MB */

+ 1 - 8
ldap/servers/plugins/replication/cl5_config.c

@@ -507,11 +507,7 @@ changelog5_config_modify (Slapi_PBlock *pb, Slapi_Entry* entryBefore, Slapi_Entr
 			goto done;
 		}
 
-#ifdef _WIN32
-		if (strcasecmp (currentDir, config.dir) != 0)
-#else /* On Unix, path are case sensitive */
 		if (strcmp (currentDir, config.dir) != 0)
-#endif
 		{
 			if (!cl5DbDirIsEmpty(config.dir))
 			{
@@ -918,9 +914,6 @@ static int _is_absolutepath (char * dir)
 {
 	if (dir[0] == '/')
 		return 1;
-#if defined(_WIN32)
-	if (dir[2] == '/' && dir[1] == ':') 
-		return 1;
-#endif
+
 	return 0;
 }

+ 0 - 2
ldap/servers/plugins/replication/repl.h

@@ -64,9 +64,7 @@
 #include <time.h>
 #include <stdio.h>
 #include <string.h>
-#ifndef _WIN32
 #include <sys/param.h>
-#endif /* _WIN32 */
 
 #include "portable.h" /* GGOODREPL - is this cheating? */
 #include "ldaplog.h"

+ 1 - 4
ldap/servers/plugins/replication/repl5.h

@@ -51,10 +51,7 @@
 #include <time.h>
 #include <stdio.h>
 #include <string.h>
-#ifndef _WIN32
 #include <sys/param.h>
-#endif /* _WIN32 */
-
 #include "portable.h" /* GGOODREPL - is this cheating? */
 #include "repl_shared.h"
 #include "llist.h"
@@ -191,7 +188,7 @@ extern const char *type_winSyncWindowsFilter;
 extern const char *type_winSyncDirectoryFilter;
 extern const char *type_winSyncSubtreePair;
 
-/* To Allow Consumer Initialisation when adding an agreement - */
+/* To Allow Consumer Initialization when adding an agreement - */
 extern const char *type_nsds5BeginReplicaRefresh;
 
 /* For tuning replica release */

+ 0 - 8
ldap/servers/plugins/replication/repl_init.c

@@ -71,14 +71,6 @@ NOTE: This plugin depends on the Multi-Master Replication Plugin
 #include "repl_shared.h"
 #include "cl4.h"	/* changelog interface */
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
 
 /* ----------------------------- Legacy Replication Plugin */
 

+ 0 - 4
ldap/servers/plugins/replication/replutil.c

@@ -184,9 +184,6 @@ entry_print( Slapi_Entry *e )
 
 int copyfile(char* source, char * destination, int overwrite, int mode) 
 {
-#if defined _WIN32
-	return (0 == CopyFile(source,destination,overwrite ? FALSE : TRUE));
-#else
 #ifdef DB_USE_64LFS
 #define OPEN_FUNCTION dblayer_open_large
 #else
@@ -252,7 +249,6 @@ error:
 	}
 	slapi_ch_free_string(&buffer);
 	return return_value;
-#endif
 }
 
 /* convert time from string like 1h (1 hour) to corresponding time in seconds */

+ 1 - 73
ldap/servers/plugins/retrocl/dllmain.c

@@ -46,82 +46,10 @@
 #include "ldap.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   /* successful DLL_PROCESS_ATTACH */
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
+

+ 0 - 8
ldap/servers/plugins/retrocl/retrocl.c

@@ -64,14 +64,6 @@ nsslapd-plugindescription: Retrocl Plugin
 
 #include "retrocl.h"
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-    module_ldap_debug = level_ptr;
-}
-#endif
 
 void* g_plg_identity [PLUGIN_MAX];
 Slapi_Backend *retrocl_be_changelog = NULL;

+ 0 - 73
ldap/servers/plugins/rever/dllmain.c

@@ -47,82 +47,9 @@
 #include "rever.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   /* successful DLL_PROCESS_ATTACH */
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 0 - 79
ldap/servers/plugins/roles/dllmain.c

@@ -46,88 +46,9 @@
 #include "ldap.h"
 #include "lber.h"
 
-
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 0 - 8
ldap/servers/plugins/roles/roles_plugin.c

@@ -63,14 +63,6 @@ static void * roles_plugin_identity = NULL;
 static Slapi_PluginDesc pdesc = { "roles",
 		VENDOR, DS_PACKAGE_VERSION, "roles plugin" };
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
 
 static int roles_start( Slapi_PBlock *pb );
 static int roles_post_op( Slapi_PBlock *pb );

+ 1 - 78
ldap/servers/plugins/statechange/dllmain.c

@@ -47,87 +47,10 @@
 #include "lber.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
+

+ 1 - 14
ldap/servers/plugins/statechange/statechange.c

@@ -47,11 +47,8 @@
 #include "portable.h"
 #include "slapi-plugin.h"
 #include "statechange.h"
-
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
+
 
 /* the circular list of systems to notify */
 typedef struct _statechange_notify
@@ -100,16 +97,6 @@ static Slapi_PluginDesc pdesc = { "statechange", VENDOR, DS_PACKAGE_VERSION,
 	"state change notification service plugin" };
 
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
-
-
 /* 
 	statechange_init
 	--------

+ 0 - 8
ldap/servers/plugins/syntaxes/debug.c

@@ -47,11 +47,3 @@
 #include <sys/types.h>
 #include "syntax.h"
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif

+ 1 - 88
ldap/servers/plugins/syntaxes/dllmain.c

@@ -45,97 +45,18 @@
  */
 #include "ldap.h"
 #include "syntax.h"
+#include <stdio.h>
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
 
 #ifdef LDAP_DEBUG
-#ifndef _WIN32
 #include <stdarg.h>
-#include <stdio.h>
 
 void LDAPDebug( int level, char* fmt, ... )
 {
@@ -153,13 +74,7 @@ void LDAPDebug( int level, char* fmt, ... )
 	}
 }
 #endif
-#endif
-
-#ifndef _WIN32
-
-/* The 16-bit version of the RTL does not implement perror() */
 
-#include <stdio.h>
 
 void perror( const char *msg )
 {
@@ -167,5 +82,3 @@ void perror( const char *msg )
 	wsprintf( buf, "%s: error %d\n", msg, WSAGetLastError()) ;
 	OutputDebugString( buf );
 }
-
-#endif

+ 0 - 6
ldap/servers/plugins/uiduniq/7bit.c

@@ -53,12 +53,6 @@
 #include <string.h>
 
 /* DBDB this should be pulled from a common header file */
-#ifdef _WIN32
-#ifndef strcasecmp
-#define strcasecmp(x,y) strcmpi(x,y)
-#endif
-#endif
-
 #if defined( LDAP_DEBUG ) && !defined( DEBUG )
 #define DEBUG
 #endif

+ 0 - 78
ldap/servers/plugins/vattrsp_template/dllmain.c

@@ -47,87 +47,9 @@
 #include "lber.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 0 - 3
ldap/servers/plugins/vattrsp_template/vattrsp.c

@@ -51,10 +51,7 @@
 /* the global plugin handle */
 static volatile vattr_sp_handle *vattr_handle = NULL;
 
-/* get file mode flags for unix */
-#ifndef _WIN32
 #include <sys/stat.h>
-#endif
 
 
 #define VATTRSP_PLUGIN_SUBSYSTEM   "vattrsp-template-plugin"   /* used for logging */

+ 0 - 78
ldap/servers/plugins/views/dllmain.c

@@ -47,87 +47,9 @@
 #include "lber.h"
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif

+ 1 - 16
ldap/servers/plugins/views/views.c

@@ -48,21 +48,14 @@
 #include "slapi-plugin.h"
 #include "statechange.h"
 #include "views.h"
-
+#include <sys/stat.h>
 #include "slapi-plugin-compat4.h"
 #include "slapi-private.h"
 
-
 #define VIEW_OBJECTCLASS "nsView"
 #define VIEW_FILTER_ATTR	"nsViewFilter"
 #define STATECHANGE_VIEWS_ID "Views"
 #define STATECHANGE_VIEWS_CONFG_FILTER "objectclass=" VIEW_OBJECTCLASS
-
-/* get file mode flags for unix */
-#ifndef _WIN32
-#include <sys/stat.h>
-#endif
-
 #define VIEWS_PLUGIN_SUBSYSTEM   "views-plugin"   /* used for logging */
 
 /* cache data structs */
@@ -162,14 +155,6 @@ static void * view_plugin_identity = NULL;
 
 static Slapi_RWLock *g_views_cache_lock;
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
 
 /*
 ** Plugin identity mgmt

+ 0 - 2
ldap/servers/slapd/abandon.c

@@ -56,9 +56,7 @@
 
 #include <stdio.h>
 #include <sys/types.h>
-#ifndef _WIN32
 #include <sys/socket.h>
-#endif
 #include "slap.h"
 
 void

+ 0 - 10
ldap/servers/slapd/add.c

@@ -63,9 +63,7 @@
 #include <string.h>
 #include <time.h>
 #include <sys/types.h>
-#ifndef _WIN32
 #include <sys/socket.h>
-#endif
 #include "slap.h"
 #include "pratom.h"
 #include "csngen.h"
@@ -879,15 +877,7 @@ add_created_attrs(Slapi_PBlock *pb, Slapi_Entry *e)
 	slapi_entry_attr_replace(e, "modifiersname", bvals);
 
 	curtime = current_time();
-#ifdef _WIN32
-{
-	struct tm *pt;
-	pt = gmtime(&curtime);
-	memcpy(&ltm, pt, sizeof(struct tm));
-}
-#else
 	gmtime_r(&curtime, &ltm);
-#endif
 	strftime(buf, sizeof(buf), "%Y%m%d%H%M%SZ", &ltm);
 
 	bv.bv_val = buf;

+ 8 - 137
ldap/servers/slapd/agtmmap.c

@@ -53,29 +53,15 @@
  
 
 #include "agtmmap.h"
-#ifndef  _WIN32
 #include <sys/mman.h>
 #include <unistd.h>
-#else
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <time.h>
-#include "nt/regparms.h"
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <sys/stat.h>
 
-#ifndef  _WIN32
 agt_mmap_context_t 	mmap_tbl [2] = { {AGT_MAP_UNINIT, -1, (caddr_t) -1}, 
 	 				 {AGT_MAP_UNINIT, -1, (caddr_t) -1} };
-#else
-agt_mmap_context_t 	mmap_tbl[2] = { {AGT_MAP_UNINIT, NULL, (caddr_t) -1, NULL}, 
-					 {AGT_MAP_UNINIT, NULL, (caddr_t) -1, NULL} };
-#endif /* ! _WIN32 */
-
 
 /****************************************************************************
  *
@@ -99,16 +85,14 @@ agt_mmap_context_t 	mmap_tbl[2] = { {AGT_MAP_UNINIT, NULL, (caddr_t) -1, NULL},
 int 
 agt_mopen_stats (char * statsfile, int mode, int *hdl)
 {
-	caddr_t 	fp;
-	char 		*path;
-	int		rc = 0;
-#ifndef  _WIN32
-	int 		fd;
-        char            *buf;
-	int 		err;
-	size_t		sz;
-	struct stat     fileinfo;
-#endif /*  _WIN32 */
+	caddr_t fp;
+	char *path;
+	char *buf;
+	int rc = 0;
+	int fd;
+	int err;
+	size_t sz;
+	struct stat fileinfo;
 
 	switch (mode)
 	{
@@ -142,8 +126,6 @@ agt_mopen_stats (char * statsfile, int mode, int *hdl)
 	else
 	     path = AGT_STATS_FILE;
 
-
-#ifndef  _WIN32
 	switch (mode)
 	{
 	     case O_RDONLY:
@@ -232,105 +214,6 @@ agt_mopen_stats (char * statsfile, int mode, int *hdl)
                rc = 0;
            break;
 	} /* end switch */
-#else
-	/* _WIN32 */
-	switch (mode) {
-		case O_RDONLY:
-		{
-			HANDLE	hFile = NULL;
-			HANDLE	hMapFile = NULL;
-		
-			/* Open existing disk file for read */
-			hFile = CreateFile(path, 
-						GENERIC_READ | GENERIC_WRITE,
-						FILE_SHARE_READ | FILE_SHARE_WRITE, 
-						NULL, 
-						OPEN_EXISTING,
-						FILE_ATTRIBUTE_NORMAL, 
-						NULL);
-			if ( hFile == INVALID_HANDLE_VALUE || hFile == NULL ) return GetLastError();
-
-			/* Create mapped file handle for reading */
-			hMapFile = CreateFileMapping( hFile, NULL, PAGE_READONLY, 0,
-						sizeof(struct agt_stats_t),
-						NULL);
-			if ( hMapFile == NULL ) {
-				CloseHandle( hFile );
-				rc = GetLastError();
-				goto bail;
-			}
-
-				/* Create addr ptr to the start of the file */
-			fp = (caddr_t) MapViewOfFileEx( hMapFile, FILE_MAP_READ, 0, 0,
-					sizeof(struct agt_stats_t), NULL );
-			if ( fp == NULL ) {
-				CloseHandle( hMapFile );
-				CloseHandle( hFile );
-				rc = GetLastError();
-				goto bail;
-			}
-
-			/* Fill in info on this opaque handle */
-			mmap_tbl[0].maptype = AGT_MAP_READ;
-			mmap_tbl[0].fd = hFile;
-			mmap_tbl[0].fp = fp;
-			mmap_tbl[0].mfh = hMapFile;
-			*hdl = 0;
-
-			rc = 0;
-			break;
-		}
-		
-		case O_RDWR:
-		{
-		
-			HANDLE	hFile = NULL;
-			HANDLE	hMapFile = NULL;
-		
-			hFile = CreateFile( path, 
-						GENERIC_WRITE | GENERIC_READ,
-						FILE_SHARE_READ | FILE_SHARE_WRITE, 
-						NULL, 
-						OPEN_ALWAYS,
-						FILE_ATTRIBUTE_NORMAL, 
-						NULL );
-			if ( hFile == INVALID_HANDLE_VALUE || hFile == NULL ) return GetLastError();
-
-			/* Create mapped file handle for reading */
-			hMapFile = CreateFileMapping( hFile, NULL, PAGE_READWRITE, 0,
-						sizeof(struct agt_stats_t),
-						NULL );
-			if ( hMapFile == NULL ) {
-				CloseHandle( hFile );
-				rc = GetLastError();
-				goto bail;
-			}
-
-				/* Create addr ptr to the start of the file */
-			fp = (caddr_t) MapViewOfFileEx( hMapFile, FILE_MAP_ALL_ACCESS, 0, 0,
-					sizeof(struct agt_stats_t), NULL );
-			if ( fp == NULL ) {
-				CloseHandle( hMapFile );
-				CloseHandle( hFile );
-				rc = GetLastError();
-				goto bail;
-			}
-
-			mmap_tbl[1].maptype = AGT_MAP_RDWR;
-			mmap_tbl[1].fd = hFile;
-			mmap_tbl[1].fp = fp;
-			mmap_tbl[1].mfh = hMapFile;
-			*hdl = 1;
-
-			rc = 0;
-			break;
-
-		}
-		
-
-	}
-
-#endif /* !__WINNT__ */
 
 bail:
     return rc;
@@ -366,22 +249,10 @@ agt_mclose_stats (int hdl)
 
 	if (mmap_tbl [hdl].fp > (caddr_t) 0)
 	{
-#ifndef  _WIN32
 		munmap (mmap_tbl [hdl].fp, sizeof (struct agt_stats_t));
 		mmap_tbl [hdl].fp = (caddr_t) -1;
 		close (mmap_tbl [hdl].fd);
 		mmap_tbl [hdl].fd = -1;
-#else
-		BOOL	bUnmapped;
-
-		bUnmapped = UnmapViewOfFile( mmap_tbl[hdl].fp );
-		if ( mmap_tbl[hdl].mfh ) CloseHandle( mmap_tbl[hdl].mfh );
-		if ( mmap_tbl[hdl].fd ) CloseHandle( mmap_tbl[hdl].fd );
-
-		mmap_tbl[hdl].fp = (caddr_t) -1;
-		mmap_tbl[hdl].mfh = NULL;
-		mmap_tbl[hdl].fd = NULL;
-#endif /* ! _WIN32 */
 		mmap_tbl [hdl].maptype = AGT_MAP_UNINIT;
 		return (0);
 	}

+ 0 - 16
ldap/servers/slapd/agtmmap.h

@@ -59,10 +59,6 @@
 #include <fcntl.h>
 #include <errno.h>
 #include "nspr.h"
-#ifdef  _WIN32
-#include <windows.h> 
-#define caddr_t PCHAR
-#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -72,9 +68,7 @@ extern "C" {
 #define NUM_SNMP_INT_TBL_ROWS 5
 #define SNMP_FIELD_LENGTH 100
 
-#ifndef  _WIN32
 extern int			errno;
-#endif
 
 #if !defined(_MAX_PATH)
 #define _MAX_PATH 256
@@ -87,22 +81,12 @@ extern int			errno;
 
 typedef enum { AGT_MAP_UNINIT = 0, AGT_MAP_READ, AGT_MAP_RDWR } agt_mmap_type;
 
-#ifndef  _WIN32
 typedef struct
 {
         agt_mmap_type   maptype;
         int             fd;
         caddr_t         fp;
 }  agt_mmap_context_t;
-#else
-typedef struct
-{
-        agt_mmap_type   maptype;
-        HANDLE          fd;
-        caddr_t         fp;
-		HANDLE			mfh;
-}  agt_mmap_context_t;
-#endif /* ! _WIN32 */
 
 struct hdr_stats_t{
     /*

+ 0 - 2
ldap/servers/slapd/attr.c

@@ -47,12 +47,10 @@
 #include <ctype.h>
 #include <sys/types.h>
 #include <sys/stat.h>
-#ifndef _WIN32
 #include <sys/time.h>
 #include <sys/param.h>
 #include <fcntl.h>
 #include <sys/socket.h>
-#endif
 #include "slap.h"
 #undef DEBUG                    /* disable counters */
 #include <prcountr.h>

+ 0 - 2
ldap/servers/slapd/auth.c

@@ -45,9 +45,7 @@
 #include <ldaputil/ldaputil.h> /* LDAPU_SUCCESS, ldapu_VTable_set */
 #include <ldaputil/init.h> /* ldaputil_init */
 #include <ldaputil/certmap.h> /* ldapu_cert_to_ldap_entry */
-#ifndef _WIN32
 #include <sys/param.h>	/* MAXPATHLEN */
-#endif
 #include "slap.h" /* slapi_ch_malloc */
 #include "fe.h"
 

+ 0 - 2
ldap/servers/slapd/ava.c

@@ -45,9 +45,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
-#ifndef _WIN32
 #include <sys/socket.h>
-#endif
 #include "slap.h"
 
 int

+ 0 - 14
ldap/servers/slapd/back-ldbm/back-ldbm.h

@@ -84,30 +84,16 @@
 #include "prio.h"  /* for PR_OpenDir etc */
 #include "prlog.h" /* for PR_ASSERT */
 /* The following cruft is for ldif2db only */
-#ifndef XP_WIN32
 #include <unistd.h>	/* write/close (ldbm2ldif_write) */
-#else
-#include <io.h>	/* write/close (ldbm2ldif_write) */
-#endif
 #include <fcntl.h>
 #include <time.h>
 /* And this cruft is from nextid.c */
-#ifndef _WIN32
 #include <sys/param.h>
-#endif /* ! _WIN32 */
 #include <limits.h> /* Used in search.c (why?) */
 
-
-
-#ifndef _WIN32
 /* for MAXPATHLEN */
 #include <sys/param.h>
 #define MKDIR(path,mode) mkdir((path),(mode))
-#else
-/* for mkdir */
-#include <direct.h>
-#define MKDIR(path,mode) mkdir(path)
-#endif
 
 #ifdef HPUX11
 #define	__BIT_TYPES_DEFINED__

+ 0 - 42
ldap/servers/slapd/back-ldbm/dblayer.c

@@ -95,11 +95,9 @@
 #include "dblayer.h"
 #include <prthread.h>
 #include <prclist.h>
-#ifndef XP_WIN32
 #include <sys/types.h>
 #include <sys/statvfs.h>
 #include <sys/resource.h>
-#endif
 
 #if 1000*DB_VERSION_MAJOR + 100*DB_VERSION_MINOR >= 4100
 #define DB_OPEN(oflags, db, txnid, file, database, type, flags, mode, rval)    \
@@ -792,20 +790,6 @@ static void dblayer_select_ncache(size_t cachesize, int *ncachep)
 		LDAPDebug(LDAP_DEBUG_ANY,"Setting ncache to: %d to keep each chunk below 4Gbytes\n",
 			*ncachep, 0, 0);
 	}
-#endif
-	/* On Windows, we know that it's hard to allocate more than some 
-	 * maximum chunk. In that case
-	 * we set ncache to a sensible value.
-	 */
-#if defined(_WIN32)
-	{
-		size_t max_windows_chunk = (300 * MEGABYTE); /* This number was determined empirically on Win2k */
-		if (cachesize > max_windows_chunk) {
-			*ncachep = (cachesize / max_windows_chunk) + 1;
-			LDAPDebug(LDAP_DEBUG_ANY,"Setting ncache to: %d for Windows memory address space fragmentation\n",
-                *ncachep, 0, 0);
-		}
-	}
 #endif
 }
 
@@ -935,7 +919,6 @@ static void dblayer_init_dbenv(DB_ENV *pEnv, dblayer_private *priv)
 #include <sys/pstat.h>
 #endif
 
-#if !defined(_WIN32)
 static size_t dblayer_getvirtualmemsize()
 {
     struct rlimit rl;
@@ -944,7 +927,6 @@ static size_t dblayer_getvirtualmemsize()
     getrlimit(RLIMIT_AS, &rl);
     return rl.rlim_cur;
 }
-#endif
 
 /* pages = number of pages of physical ram on the machine (corrected for 32-bit build on 64-bit machine).
  * procpages = pages currently used by this process (or working set size, sometimes)
@@ -956,26 +938,6 @@ void dblayer_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size_
     if (procpages)
         *procpages = 0;
 
-#ifdef _WIN32
-    {
-        SYSTEM_INFO si;
-        MEMORYSTATUS ms;
-
-        GetSystemInfo(&si);
-        ms.dwLength = sizeof(ms);
-        GlobalMemoryStatus(&ms);
-        *pagesize = si.dwPageSize;
-        *pages = ms.dwTotalPhys  / si.dwPageSize;
-        *availpages = ms.dwAvailVirtual / *pagesize;
-        if (procpages) {
-            DWORD minwss = 0, maxwss = 0;
-
-            GetProcessWorkingSetSize(GetCurrentProcess(), &minwss, &maxwss);
-            *procpages = (int)(maxwss / si.dwPageSize);
-        }
-    }
-#endif
-
 #ifdef OS_solaris
     *pagesize = (int)sysconf(_SC_PAGESIZE);
     *pages = (int)sysconf(_SC_PHYS_PAGES);
@@ -5859,9 +5821,6 @@ static int count_dbfiles_in_dir(char *directory, int *count, int recurse)
 int
 dblayer_copyfile(char *source, char *destination, int overwrite, int mode) 
 {
-#if defined _WIN32
-    return (0 == CopyFile(source,destination,overwrite ? FALSE : TRUE));
-#else
 #ifdef DB_USE_64LFS
 #define OPEN_FUNCTION dblayer_open_large
 #else
@@ -5935,7 +5894,6 @@ error:
     }
     slapi_ch_free((void**)&buffer);
     return return_value;
-#endif
 }
 
 /*

+ 1 - 81
ldap/servers/slapd/back-ldbm/dllmain.c

@@ -44,88 +44,14 @@
  * Microsoft Windows specifics for BACK-LDBM DLL
  */
 #include "back-ldbm.h"
+#include <stdio.h>
 
-
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
 
 #ifdef LDAP_DEBUG
 #ifndef _WIN32
@@ -150,12 +76,7 @@ void LDAPDebug( int level, char* fmt, ... )
 #endif
 #endif
 
-#ifndef _WIN32
-
 /* The 16-bit version of the RTL does not implement perror() */
-
-#include <stdio.h>
-
 void perror( const char *msg )
 {
 	char buf[128];
@@ -163,4 +84,3 @@ void perror( const char *msg )
 	OutputDebugString( buf );
 }
 
-#endif

+ 0 - 20
ldap/servers/slapd/back-ldbm/import-threads.c

@@ -52,9 +52,6 @@
 #include "back-ldbm.h"
 #include "vlv_srch.h"
 #include "import.h"
-#ifdef XP_WIN32
-#define STDIN_FILENO 0
-#endif
 
 static void import_wait_for_space_in_fifo(ImportJob *job, size_t new_esize);
 static int import_get_and_add_parent_rdns(ImportWorkerInfo *info, ldbm_instance *inst, DB *db, ID id, ID *total_id, Slapi_RDN *srdn, int *curr_entry);
@@ -347,15 +344,7 @@ import_add_created_attrs(Slapi_Entry *e)
     }
 
     curtime = current_time();
-#ifdef _WIN32
-{
-    struct tm *pt;
-    pt = gmtime(&curtime);
-    memcpy(&ltm, pt, sizeof(struct tm));
-}
-#else
     gmtime_r(&curtime, &ltm);
-#endif
     strftime(buf, sizeof(buf), "%Y%m%d%H%M%SZ", &ltm);
 
     bv.bv_val = buf;
@@ -476,15 +465,6 @@ import_producer(void *param)
                 fd = STDIN_FILENO;
             } else {
                 int o_flag = O_RDONLY;
-#ifdef XP_WIN32
-                /* 613041 Somehow the windows low level io lose "\n"
-                   at a very particular situation using O_TEXT mode read.
-                   I think it is a windows bug for O_TEXT mode read.
-                   Use O_BINARY instead, which honestly returns chars
-                   without any translation.
-                */
-                o_flag |= O_BINARY;
-#endif
                 fd = dblayer_open_huge_file(curr_filename, o_flag, 0);
             }
             if (fd < 0) {

+ 0 - 10
ldap/servers/slapd/back-ldbm/init.c

@@ -51,16 +51,6 @@ static void *IDL_api[3];
 static Slapi_PluginDesc pdesc = { "ldbm-backend", VENDOR,
         DS_PACKAGE_VERSION, "high-performance LDAP backend database plugin" };
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void 
-plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
-
 /* pb: not used */
 int
 ldbm_back_add_schema( Slapi_PBlock *pb )

+ 0 - 166
ldap/servers/slapd/back-ldbm/ldbm_bind.c

@@ -44,160 +44,6 @@
 
 #include "back-ldbm.h"
 
-#if defined( XP_WIN32 )
-
-typedef enum LDAPWAEnum {
-	LDAPWA_NoDomainAttr = -3,
-	LDAPWA_InvalidCredentials = -2,
-	LDAPWA_Failure = -1,
-	LDAPWA_Success= 0
-} LDAPWAStatus;
-
-int
-GetDomainUsername(
-	char *pszNTuserdomainid,
-	char *pszNTDomain,
-	char *pszNTUsername 
-)
-{
-	char	*pszAttr, *pDomain, *pUsername;
-
-	if( !pszNTuserdomainid )
-		return( 1 );
-
-	// Split the specially constructed attribute.
-	pszAttr = slapi_ch_strdup( pszNTuserdomainid );
-
-	pDomain = pszAttr;
-
-	pUsername = strchr( pszAttr, ':' );
-	if( pUsername == NULL )
-		return( 1 );
-
-	// Set the end of the NT Domain name, 
-	// and the start of the NT username.
-	*pUsername = (char)NULL;
-	pUsername++;
-
-	strcpy( pszNTDomain, pDomain);
-	strcpy( pszNTUsername, pUsername);
-
-	slapi_ch_free( (void**)&pszAttr );
-
-	return( 0 );
-}
-
-/* Attempt Windows NT Authentication, using the password from the client app, 
-   with the NT Domain and NT username, both stored in the entry.  
-   If successful, the ldap_bind() is completed successsfully. */
-
-LDAPWAStatus
-WindowsAuthentication( 
-	struct backentry	*e,
-    struct berval	*cred
-)
-{
-	Slapi_Attr	*a; 
-	Slapi_Value *sval = NULL;
-	int iStatus;
-	char szNTDomain[MAX_PATH], szNTUsername[MAX_PATH];
-	HANDLE	hToken = NULL;
-	BOOL bLogonStatus = FALSE;
-	int i= -1;
- 
-	/* Get the NT Domain and username - if the entry has such an attribute */
-	if( !e || !e->ep_entry ||
-		slapi_entry_attr_find( e->ep_entry, "ntuserdomainid", &a ) != 0)
-	{
-		return( LDAPWA_NoDomainAttr );
-	}
-
-	i= slapi_attr_first_value( a, &sval );
-	if(sval==NULL)
-	{
-		return( LDAPWA_NoDomainAttr );	
-	}
-
-    while(i != -1)
-	{
-		const struct berval *val = slapi_value_get_berval(sval);
-		char * colon = NULL;
-
-		if (!val->bv_val || (strlen(val->bv_val) > (MAX_PATH<<1))) {
-			LDAPDebug( LDAP_DEBUG_TRACE,
-				"WindowsAuthentication => validation FAILED for \"%s\" on NT Domain : "
-				"ntuserdomainid attr value too long\n",
-				val->bv_val, 0, 0);
-			i= slapi_attr_next_value(a, i, &sval);
-			continue;
-		}
-		colon = strchr( val->bv_val, ':' );
-		if (!colon || ((colon - val->bv_val)/sizeof(char) > MAX_PATH)) {
-			if (!colon) {
-				LDAPDebug( LDAP_DEBUG_TRACE,
-					"WindowsAuthentication => validation FAILED for \"%s\" on NT Domain : "
-					"a colon is missing in ntuserdomainid attr value\n",
-					val->bv_val, 0, 0);
-			}
-			else {
-				LDAPDebug( LDAP_DEBUG_TRACE,
-					"WindowsAuthentication => validation FAILED for \"%s\" on NT Domain : "
-					"domain in ntuserdomainid attr value too long\n",
-					val->bv_val, 0, 0);
-			}
-			i= slapi_attr_next_value(a, i, &sval);
-			continue;
-		}
-
-		if(( iStatus = GetDomainUsername( val->bv_val, 
-										  szNTDomain, 
-										  szNTUsername )) != 0) 
-		{
-			i= slapi_attr_next_value(a, i, &sval);
-			continue;
-		}
-
-#if !defined( LOGON32_LOGON_NETWORK )
-/* This is specified in the WIn32 LogonUser() documentation, but not defined
-   in the Visual C++ 4.2 include file winbase.h. A search of the lastest version 
-   of this file at www.microsoft.com finds that LOGON32_LOGON_NETWORK == 3.
- */
-#define LOGON32_LOGON_NETWORK 3
-#endif
-		/* Now do the Logon attempt */	
-		bLogonStatus = LogonUser( szNTUsername, // string that specifies the user name
-								  szNTDomain,   // string that specifies the domain or server
-								  cred->bv_val,	// string that specifies the password
-								  LOGON32_LOGON_NETWORK, //  the type of logon operation, 
-								  LOGON32_PROVIDER_DEFAULT,	 // specifies the logon provider
-							      &hToken ); // pointer to variable to receive token handle 
-		if( bLogonStatus && hToken ) 
-			CloseHandle( hToken );
-		
-		if( bLogonStatus ) 
-		{
-			// Successful validation
-			LDAPDebug( LDAP_DEBUG_TRACE,
-				"WindowsAuthentication => validated \"%s\" on NT Domain \"%s\"\n",
-				szNTUsername, szNTDomain, 0 );
-			return( LDAPWA_Success );
-		}
-		else
-		{
-			LDAPDebug( LDAP_DEBUG_TRACE,
-				"WindowsAuthentication => validation FAILED for \"%s\" on NT Domain \"%s\", reason %d\n",
-				szNTUsername, szNTDomain, GetLastError() );
-			return( LDAPWA_InvalidCredentials );
-		}
-		i= slapi_attr_next_value(a, i, &sval);
-	}
- 
-
-	return( LDAPWA_Failure );	
-
-}
-#endif
-
 int
 ldbm_back_bind( Slapi_PBlock *pb )
 {
@@ -256,11 +102,6 @@ ldbm_back_bind( Slapi_PBlock *pb )
 		{
 		Slapi_Value cv;
 		if ( slapi_entry_attr_find( e->ep_entry, "userpassword", &attr ) != 0 ) {
-#if defined( XP_WIN32 )
-			if( WindowsAuthentication( e, cred ) == LDAPWA_Success ) {
-				break;
-			}
-#endif
 			slapi_send_ldap_result( pb, LDAP_INAPPROPRIATE_AUTH, NULL,
 			    NULL, 0, NULL );
 			CACHE_RETURN( &inst->inst_cache, &e );
@@ -270,13 +111,6 @@ ldbm_back_bind( Slapi_PBlock *pb )
 		bvals= attr_get_present_values(attr);
 		slapi_value_init_berval(&cv,cred);
 		if ( slapi_pw_find_sv( bvals, &cv ) != 0 ) {
-#if defined( XP_WIN32 )
-			/* One last try - attempt Windows authentication, 
-			   if the user has a Windows account. */
-			if( WindowsAuthentication( e, cred ) == LDAPWA_Success ) {
-				break;
-			}
-#endif
 			slapi_send_ldap_result( pb, LDAP_INVALID_CREDENTIALS, NULL,
 			    NULL, 0, NULL );
 			CACHE_RETURN( &inst->inst_cache, &e );

+ 1 - 21
ldap/servers/slapd/back-ldbm/monitor.c

@@ -186,10 +186,6 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
     }
 
     for (i = 0;(mpfstat[i] && (mpfstat[i]->file_name != NULL)); i++) {
-#ifdef _WIN32
-        int fpos = 0;
-#endif
-
         /* only print out stats on files used by this instance */
         if (strlen(mpfstat[i]->file_name) < strlen(inst->inst_dir_name))
             continue;
@@ -205,7 +201,6 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
 	slapi_ch_free_string(&absolute_pathname);
 	absolute_pathname = slapi_ch_smprintf("%s%c%s" , inst->inst_parent_dir_name, get_sep(inst->inst_parent_dir_name), mpfstat[i]->file_name );
 
-/* NPCTE fix for bugid 544365, esc 0. <P.R> <04-Jul-2001> */
 	/* Hide statistic of deleted files (mainly indexes) */
 	if (stat(absolute_pathname,&astat))
 	    continue;
@@ -219,25 +214,10 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
 			break;
 	if (j<i)
 		continue;
-/* end of NPCTE fix for bugid 544365 */
 
         /* Get each file's stats */
         PR_snprintf(buf, sizeof(buf), "%s", mpfstat[i]->file_name);
-#ifdef _WIN32
-        /* 
-         * For NT, switch the last
-         * backslash to a foward
-         * slash. - RJP
-         */
-        for (fpos = strlen(buf); fpos >= 0; fpos--) {
-            if (buf[fpos] == '\\') {
-                buf[fpos] = '/';
-                break;
-            }
-        }
-#endif
         MSETF("dbFilename-%d", i);
-        
         sprintf(buf, "%lu", (unsigned long)mpfstat[i]->st_cache_hit);
         MSETF("dbFileCacheHit-%d", i);
         sprintf(buf, "%lu", (unsigned long)mpfstat[i]->st_cache_miss);
@@ -247,7 +227,7 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e,
         sprintf(buf, "%lu", (unsigned long)mpfstat[i]->st_page_out);
         MSETF("dbFilePageOut-%d", i);
 
-	slapi_ch_free_string(&absolute_pathname);
+        slapi_ch_free_string(&absolute_pathname);
     }
 
     slapi_ch_free_string(&absolute_pathname);

+ 0 - 149
ldap/servers/slapd/back-ldbm/perfctrs.c

@@ -80,142 +80,21 @@ static void perfctrs_update(perfctrs_private *priv, DB_ENV *db_env);
 static void perfctr_add_to_entry( Slapi_Entry *e, char *type,
 	PRUint32 countervalue );
 
-/*
- * Win32 specific code (to support the Windows NT/2000 Performance Monitor).
- */
-#if defined(_WIN32)
-static 
-char * string_concatenate(char *a, char* b)
-{
-	size_t string_length = 0;
-	char *string = NULL;
-
-	string_length = strlen(a) + strlen(b) + 1;
-	string = slapi_ch_malloc(string_length);
-
-	sprintf(string,"%s%s",a,b);
-	return string;
-}
-
-static void init_shared_memory(perfctrs_private *priv)
-{
-	performance_counters *perf = (performance_counters*)priv->memory;
-	if (NULL != perf) {
-		memset(perf,0,sizeof(performance_counters));
-	}
-}
-
-static int open_event(char *name, perfctrs_private *priv)
-{
-	HANDLE hEvent = INVALID_HANDLE_VALUE;
-
-	hEvent = OpenEvent(EVENT_ALL_ACCESS,FALSE,name);
-	if (NULL == hEvent) {
-		hEvent = CreateEvent(NULL,FALSE,FALSE,name);
-		if (NULL == hEvent) {
-			LDAPDebug(LDAP_DEBUG_ANY,"BAD EV 1, err=%d\n",GetLastError(),0,0);
-			return -1;
-		}
-	}
-	priv->hEvent = hEvent;
-	return 0;
-}
-
-static int open_shared_memory(char *name, perfctrs_private *priv)
-{
-	HANDLE hMapping = INVALID_HANDLE_VALUE;
-	void *pMemory = NULL;
-	/* We fear a bug in NT where it fails to attach to an existing region on calling CreateFileMapping, so let's call OpenFileMapping first */
-	hMapping = OpenFileMapping(FILE_MAP_ALL_ACCESS,FALSE,name);
-	if (NULL == hMapping) {
-		hMapping = CreateFileMapping((HANDLE)0xFFFFFFFF,NULL,PAGE_READWRITE,0,sizeof(performance_counters),name);
-		if (NULL == hMapping) {
-			LDAPDebug(LDAP_DEBUG_ANY,"BAD MAP 1, err=%d\n",GetLastError(),0,0);
-			return -1;
-		}
-	}
-	/* If we got to here, we have the mapping object open */
-	pMemory = MapViewOfFile(hMapping,FILE_MAP_ALL_ACCESS,0,0,0);
-	if (NULL == pMemory) {
-		LDAPDebug(LDAP_DEBUG_ANY,"BAD MAP 2, err=%d\n",GetLastError(),0,0);
-		return -1;
-	}
-	priv->memory = pMemory;
-	priv->hMemory = hMapping;
-	return 0;
-}
-#endif
-
 /* Init perf ctrs */
 void perfctrs_init(struct ldbminfo *li, perfctrs_private **ret_priv)
 {
 	perfctrs_private *priv = NULL;
 
-#if defined(_WIN32)
-	/* XXX What's my instance name ? */
-
-	/* 
-	 * We have a single DB environment for all backend databases.
-	 * Therefore the instance name can be the server instance name.
-	 * To match the db perf ctr DLL the instance name should be the
-	 * name of a key defined in the registry under:
-	 *   HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Directory\5
-	 * i.e. slapd-servername
-	 */
-
-	char *string = NULL;
-	char *instance_name = li->li_plugin->plg_name; /* XXX does not identify server instance */
-#endif
-
 	*ret_priv = NULL;
 
-#if defined(_WIN32)
-	/*
-	 * On Windows, the performance counters reside in shared memory.
-	 */
-	if (NULL == instance_name) {
-		goto error;
-	}
-	/* Invent the name for the shared memory region */
-	string = string_concatenate(instance_name,PERFCTRS_REGION_SUFFIX);
-	if (NULL == string) {
-		goto error;
-	}
-#endif
-
 	/*
 	 * We need the perfctrs_private area on all platforms.
 	 */
 	priv = (perfctrs_private *)slapi_ch_calloc(1,sizeof(perfctrs_private));
-
-#if defined(_WIN32)
-	/* Try to open the shared memory region */
-	open_shared_memory(string,priv);
-	free(string);
-	/* Invent the name for the update mutex */
-	string = string_concatenate(instance_name,PERFCTRS_MUTEX_SUFFIX);
-	if (NULL == string) {
-		goto error;
-	}
-	open_event(string,priv);
-	free(string);
-	init_shared_memory(priv);
-
-#else
-	/*
-	 * On other platforms, the performance counters reside in regular memory.
-	 */
 	priv->memory = slapi_ch_calloc( 1, sizeof( performance_counters ));
-#endif
 
 	*ret_priv = priv;
 	return;
-
-#if defined(_WIN32)
-error:
-	slapi_ch_free((void**)&priv);
-	return;
-#endif
 }
 
 /* Terminate perf ctrs */
@@ -234,21 +113,9 @@ void perfctrs_terminate(perfctrs_private **priv, DB_ENV *db_env)
 	slapi_ch_free((void**)&logstat);
 	LOCK_STAT(db_env, &lockstat, DB_STAT_CLEAR, (void *)slapi_ch_malloc);
 	slapi_ch_free((void**)&lockstat);
-#if defined(_WIN32)
-	if (NULL != (*priv)->memory) {
-		UnmapViewOfFile((*priv)->memory);
-	}
-	if (NULL != (*priv)->hMemory) {
-		CloseHandle((*priv)->hMemory);
-	}
-	if (NULL != (*priv)->hEvent) {
-		CloseHandle((*priv)->hEvent);
-	}
-#else
 	if (NULL != (*priv)->memory) {
 		slapi_ch_free(&(*priv)->memory);
 	}
-#endif
 
 	slapi_ch_free( (void **)priv );
 }
@@ -256,26 +123,10 @@ void perfctrs_terminate(perfctrs_private **priv, DB_ENV *db_env)
 /* Wait while checking for perfctr update requests */
 void perfctrs_wait(size_t milliseconds,perfctrs_private *priv,DB_ENV *db_env)
 {
-#if defined(_WIN32)
-	if (NULL != priv) {
-		DWORD ret = 0;
-		if (NULL != priv->hEvent) {
-			/* Sleep waiting on the perfctrs update event */
-			ret = WaitForSingleObject(priv->hEvent,milliseconds);
-			/* If we didn't time out, update the perfctrs */
-			if (ret == WAIT_OBJECT_0) {
-				perfctrs_update(priv,db_env);
-			}
-		} else {
-			Sleep(milliseconds);
-		}
-	}
-#else
 	/* Just sleep */
 	PRIntervalTime    interval;   /*NSPR timeout stuffy*/
 	interval = PR_MillisecondsToInterval(milliseconds);
 	DS_Sleep(interval);
-#endif
 }
 
 /* Update perfctrs */

+ 1 - 9
ldap/servers/slapd/back-ldif/back-ldif.h

@@ -50,20 +50,12 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
-
-/* include NSPR header files */
 #include "prlock.h"
-
 #include "ldaplog.h"
 #include "portable.h"
 #include "slap.h"
-
-#ifdef _WIN32
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#else
 #include <sys/socket.h>
-#endif /* _WIN32 */
+
 
 /*Defines*/
 #define LDIF_DB_ADD     0

+ 1 - 106
ldap/servers/slapd/back-ldif/dllmain.c

@@ -44,122 +44,18 @@
  * Microsoft Windows specifics for LIBLDAP DLL
  */
 #include "ldap.h"
+#include <stdio.h>
 
 
-#ifdef _WIN32
-/* Lifted from Q125688
- * How to Port a 16-bit DLL to a Win32 DLL
- * on the MSVC 4.0 CD
- */
-BOOL WINAPI DllMain (HANDLE hModule, DWORD fdwReason, LPVOID lpReserved)
-{
-	WSADATA	wsadata;
-
-	switch (fdwReason)
-	{
-	case DLL_PROCESS_ATTACH:
-		 /* Code from LibMain inserted here.  Return TRUE to keep the
-		    DLL loaded or return FALSE to fail loading the DLL.
-
-		    You may have to modify the code in your original LibMain to
-		    account for the fact that it may be called more than once.
-		    You will get one DLL_PROCESS_ATTACH for each process that
-		    loads the DLL. This is different from LibMain which gets
-		    called only once when the DLL is loaded. The only time this
-		    is critical is when you are using shared data sections.
-		    If you are using shared data sections for statically
-		    allocated data, you will need to be careful to initialize it
-		    only once. Check your code carefully.
-
-		    Certain one-time initializations may now need to be done for
-		    each process that attaches. You may also not need code from
-		    your original LibMain because the operating system may now
-		    be doing it for you.
-		 */
-		/*
-		 * 16 bit code calls UnlockData()
-		 * which is mapped to UnlockSegment in windows.h
-		 * in 32 bit world UnlockData is not defined anywhere
-		 * UnlockSegment is mapped to GlobalUnfix in winbase.h
-		 * and the docs for both UnlockSegment and GlobalUnfix say 
-		 * ".. function is oboslete.  Segments have no meaning 
-		 *  in the 32-bit environment".  So we do nothing here.
-		 */
-
-		if( errno = WSAStartup(0x0101, &wsadata ) != 0 )
-			return FALSE;
-
-		break;
-
-	case DLL_THREAD_ATTACH:
-		/* Called each time a thread is created in a process that has
-		   already loaded (attached to) this DLL. Does not get called
-		   for each thread that exists in the process before it loaded
-		   the DLL.
-
-		   Do thread-specific initialization here.
-		*/
-		break;
-
-	case DLL_THREAD_DETACH:
-		/* Same as above, but called when a thread in the process
-		   exits.
-
-		   Do thread-specific cleanup here.
-		*/
-		break;
-
-	case DLL_PROCESS_DETACH:
-		/* Code from _WEP inserted here.  This code may (like the
-		   LibMain) not be necessary.  Check to make certain that the
-		   operating system is not doing it for you.
-		*/
-		WSACleanup();
-
-		break;
-	}
-	/* The return value is only used for DLL_PROCESS_ATTACH; all other
-	conditions are ignored.  */
-	return TRUE;   // successful DLL_PROCESS_ATTACH
-}
-#else
 int CALLBACK
 LibMain( HINSTANCE hinst, WORD wDataSeg, WORD cbHeapSize, LPSTR lpszCmdLine )
 {
 	/*UnlockData( 0 );*/
  	return( 1 );
 }
-#endif
-
-#ifdef LDAP_DEBUG
-#ifndef _WIN32
-#include <stdarg.h>
-#include <stdio.h>
-
-void LDAPDebug( int level, char* fmt, ... )
-{
-	static char debugBuf[1024];
-
-	if (slapd_ldap_debug & level)
-	{
-		va_list ap;
-		va_start (ap, fmt);
-		_snprintf (debugBuf, sizeof(debugBuf), fmt, ap);
-		debugBuf[sizeof(debugBuf)-1] = 0;
-		va_end (ap);
-
-		OutputDebugString (debugBuf);
-	}
-}
-#endif
-#endif
-
-#ifndef _WIN32
 
 /* The 16-bit version of the RTL does not implement perror() */
 
-#include <stdio.h>
-
 void perror( const char *msg )
 {
 	char buf[128];
@@ -167,4 +63,3 @@ void perror( const char *msg )
 	OutputDebugString( buf );
 }
 
-#endif

+ 0 - 8
ldap/servers/slapd/back-ldif/init.c

@@ -54,14 +54,6 @@
 static Slapi_PluginDesc pdesc = { "ldif-backend", "Netscape", DS_PACKAGE_VERSION,
 	"LDIF backend database plugin" };
 
-#ifdef _WIN32
-int *module_ldap_debug = 0;
-
-void plugin_init_debug_level(int *level_ptr)
-{
-	module_ldap_debug = level_ptr;
-}
-#endif
 
 /*
  *  Function: ldif_back_init

+ 0 - 3
ldap/servers/slapd/bind.c

@@ -64,12 +64,9 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
-#ifndef _WIN32
 #include <sys/socket.h>
-#endif
 #include "slap.h"
 #include "fe.h"
-
 #include "pratom.h"
 #include <sasl.h>
 

+ 10 - 354
ldap/servers/slapd/ch_malloc.c

@@ -47,9 +47,7 @@
 #include <stdlib.h>
 #include <string.h> /* strdup */
 #include <sys/types.h>
-#ifndef _WIN32
 #include <sys/socket.h>
-#endif
 #undef DEBUG                    /* disable counters */
 #include <prcountr.h>
 #include "slap.h"
@@ -67,10 +65,6 @@ PR_DEFINE_COUNTER(slapi_ch_counter_exist);
 static void *oom_emergency_area = NULL;
 static PRLock *oom_emergency_lock = NULL;
 
-#if defined(_WIN32)
-static int recording= 0;
-#endif
-
 #define SLAPD_MODULE	"memory allocator"
 
 static const char* const oom_advice =
@@ -83,13 +77,6 @@ static const char* const oom_advice =
   "  nsslapd-import-cachesize (LDBM Plug-in Settings - Import cache size).\n"
   "Can't recover; calling exit(1).\n";
 
-#if defined(_WIN32) && defined(DEBUG)
-static void add_memory_record(void *p,unsigned long size);
-static void remove_memory_record(void *p);
-static int memory_record_dump( caddr_t data, caddr_t arg );
-static int memory_record_delete( caddr_t data, caddr_t arg );
-#endif
-
 static void
 create_counters()
 {
@@ -169,12 +156,6 @@ slapi_ch_malloc(
     PR_INCREMENT_COUNTER(slapi_ch_counter_malloc);
     PR_INCREMENT_COUNTER(slapi_ch_counter_created);
     PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
-	if(recording)
-	{
-		add_memory_record(newmem,size);
-	}
-#endif
 
 	return( newmem );
 }
@@ -211,13 +192,6 @@ slapi_ch_realloc(
 		counters_created= 1;
 	}
     PR_INCREMENT_COUNTER(slapi_ch_counter_realloc);
-#if defined(_WIN32) && defined(DEBUG)
-	if(recording)
-	{
-		remove_memory_record(block);
-		add_memory_record(newmem,size);
-	}
-#endif
 
 	return( newmem );
 }
@@ -257,12 +231,7 @@ slapi_ch_calloc(
     PR_INCREMENT_COUNTER(slapi_ch_counter_calloc);
     PR_INCREMENT_COUNTER(slapi_ch_counter_created);
     PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
-	if(recording)
-	{
-		add_memory_record(newmem,size);
-	}
-#endif
+
 	return( newmem );
 }
 
@@ -293,12 +262,7 @@ slapi_ch_strdup ( const char* s1)
     PR_INCREMENT_COUNTER(slapi_ch_counter_strdup);
     PR_INCREMENT_COUNTER(slapi_ch_counter_created);
     PR_INCREMENT_COUNTER(slapi_ch_counter_exist);
-#if defined(_WIN32) && defined(DEBUG)
-	if(recording)
-	{
-		add_memory_record(newmem,strlen(s1)+1);
-	}
-#endif
+
     return newmem;
 }
 #endif /* !MEMPOOL_EXPERIMENTAL */
@@ -325,13 +289,13 @@ slapi_ch_bvecdup (struct berval** v)
 {
     struct berval** newberval = NULL;
     if (v != NULL) {
-	size_t i = 0;
-	while (v[i] != NULL) ++i;
-	newberval = (struct berval**) slapi_ch_malloc ((i + 1) * sizeof (struct berval*));
-	newberval[i] = NULL;
-	while (i-- > 0) {
-	    newberval[i] = slapi_ch_bvdup (v[i]);
-	}
+        size_t i = 0;
+        while (v[i] != NULL) ++i;
+        newberval = (struct berval**) slapi_ch_malloc ((i + 1) * sizeof (struct berval*));
+        newberval[i] = NULL;
+        while (i-- > 0) {
+            newberval[i] = slapi_ch_bvdup (v[i]);
+        }
     }
     return newberval;
 }
@@ -351,15 +315,9 @@ void
 slapi_ch_free(void **ptr)
 {
 	if (ptr==NULL || *ptr == NULL){
-	return;
+		return;
 	}
 
-#if defined(_WIN32) && defined(DEBUG)
-	if(recording)
-	{
-		remove_memory_record(*ptr);
-	}
-#endif
 	free (*ptr);
 	*ptr = NULL;
 	if(!counters_created)
@@ -436,305 +394,3 @@ slapi_ch_smprintf(const char *fmt, ...)
 	return p;
 }
 #endif
-
-/* ========================= NT Specific Leak Checking Code ================================== */
-
-#if defined(_WIN32) && defined(DEBUG)
-#define STOP_TRAVERSAL -2 
-#define MR_CALL_STACK 16
-#define MR_DUMP_AMOUNT 16
-static Avlnode *mr_tree= NULL;
-static PRLock *mr_tree_lock= NULL;
-#endif
-
-void
-slapi_ch_start_recording()
-{
-#if defined(_WIN32) && defined(DEBUG)
-	if(mr_tree_lock==NULL)
-	{
-        mr_tree_lock = PR_NewLock();
-	}
-    PR_Lock( mr_tree_lock );
-	recording= 1;
-    PR_Unlock( mr_tree_lock );
-#endif
-}
-
-void
-slapi_ch_stop_recording()
-{
-#if defined(_WIN32) && defined(DEBUG)
-    PR_Lock( mr_tree_lock );
-	recording= 0;
-    avl_apply( mr_tree, memory_record_dump, NULL, STOP_TRAVERSAL, AVL_INORDER );
-    avl_free( mr_tree, memory_record_delete );
-	mr_tree= NULL;
-    PR_Unlock( mr_tree_lock );
-#endif
-}
-
-#if defined(_WIN32) && defined(DEBUG)
-
-struct memory_record
-{
-	void *p;
-	unsigned long size;
-	DWORD ra[MR_CALL_STACK];
-};
-
-
-static void
-mr_to_hex_dump(char* dest, void *addr, int size, int MaxBytes)
-{
-	int i;
-	for (i=0; i<MaxBytes; i++)
-	{
-		if(i<size)
-		{
-			wsprintf(dest+i*2, "%02x", ((unsigned char*)addr)[i]);
-		}
-		else
-		{
-			strcpy(dest+i*2, "  ");
-		}
-	}
-}
-
-static void
-mr_to_char_dump(char* dest, void *addr, int size, int MaxBytes)
-{
-	int i;
-	char *c= (char*)addr;
-	for(i=0;i<MaxBytes;i++)
-	{
-		if(i<size)
-		{
-			*(dest+i)= (isprint(*c)?*c:'.');
-			c++;
-		}
-		else
-		{
-			*(dest+i)= ' ';
-		}
-	}
-	*(dest+i)= '\0';
-}
-
-
-/*
- * Check that the address is (probably) valid
- */
-static int ValidateBP(UINT bp)
-{
-    return !(IsBadReadPtr((void*)bp, 4) || IsBadWritePtr((void*)bp, 4));
-}
-
-/*
- * Check that the address is (probably) valid
- */
-static int ValidateIP(UINT ip)
-{
-    return !IsBadReadPtr((void*)ip, 4);
-}
-
-static int
-memory_record_delete( caddr_t data, caddr_t arg )
-{
-    struct memory_record *mr = (struct memory_record *)data;
-	free(mr);
-    return 0;
-}
-
-static int
-memory_record_duplicate_disallow( caddr_t d1, caddr_t d2 )
-{
-    return -1;
-}
-
-static int
-memory_record_compare( caddr_t d1, caddr_t d2 )
-{
-    struct memory_record *mr1 = (struct memory_record *)d1;
-    struct memory_record *mr2 = (struct memory_record *)d2;
-	return (mr1->p==mr2->p);
-}
-
-static void
-grab_stack(DWORD *ra,int framestograb,int framestoskip)
-{
-	int framelookingat = 0;
-	int framestoring = 0;
-	DWORD _bp = 0;
-
-	/* for every function the frame layout is:
-	 * ---------
-	 * |ret add|
-	 * ---------
-	 * |old bp | <- new bp
-	 * ---------
-	 */
-
-	__asm mov _bp, ebp;
-
-	if(framestoskip==0)
-	{
-		ra[framestoring]= _bp;
-		framestoring++;
-	}
-	while (framelookingat < framestograb+framestoskip-1)
-	{
-		DWORD returnAddress = *(((DWORD*)_bp)+1);
-		_bp = *((DWORD*)_bp);
-		if (!ValidateBP(_bp)) break;
-		if (!ValidateIP(returnAddress)) break;
-		if(framelookingat>=framestoskip)
-		{
-			ra[framestoring]= returnAddress;
-			framestoring++;
-		}
-		framelookingat++;
-	}
-	ra[framestoring]= 0;
-}
-
-static void
-add_memory_record(void *p,unsigned long size)
-{
-    struct memory_record *mr= (struct memory_record *)malloc(sizeof(struct memory_record));
-	mr->p= p;
-	mr->size= size;
-	grab_stack(mr->ra,MR_CALL_STACK,1);
-    PR_Lock( mr_tree_lock );
-    avl_insert( &mr_tree, mr, memory_record_compare, memory_record_duplicate_disallow );
-    PR_Unlock( mr_tree_lock );
-}
-
-static void
-remove_memory_record(void *p)
-{
-    struct memory_record *mr = NULL;
-    struct memory_record search;
-    PR_Lock( mr_tree_lock );
-    search.p= p;
-    mr = (struct memory_record *)avl_find( mr_tree, &search, memory_record_compare );
-	if(mr!=NULL)
-	{
-		avl_delete( &mr_tree, mr, memory_record_compare );
-	}
-    PR_Unlock( mr_tree_lock );
-}
-
-#include <imagehlp.h>
-#pragma comment(lib, "imagehlp")
-
-static BOOL SymInitialized= FALSE;
-static HANDLE s_hProcess= NULL;
-
-BOOL InitialiseImageHelp()
-{
-	if (!SymInitialized)
-	{
-		/* OBSOLETE: we don't have this directory structure any longer */
-		/*
-		 * searchpath= <instancedir>\bin\slapd\server;<instancedir>\lib
-		 */
-		char *searchpath= NULL;
-		/* char *id= config_get_instancedir(); eliminated */
-		if(id!=NULL)
-		{
-			char *p= id;
-			while(p!=NULL)
-			{
-				p= strchr(id,'/');
-				if(p!=NULL) *p='\\';
-			}
-			p= strrchr(id,'\\');
-			if(p!=NULL)
-			{
-				*p= '\0';
-				searchpath= slapi_ch_malloc(100+strlen(p)*2);
-				strcpy(searchpath,id);
-				strcat(searchpath,"\\bin\\slapd\\server;");
-				strcat(searchpath,id);
-				strcat(searchpath,"\\lib");
-			}
-		}
-		s_hProcess = GetCurrentProcess();
-		SymInitialized = SymInitialize(s_hProcess, searchpath, TRUE);
-		slapi_ch_free((void**)&id);
-		slapi_ch_free((void**)&searchpath);
-		if (SymInitialized)
-		{
-			SymSetOptions(SYMOPT_DEFERRED_LOADS);
-		}
-	}
-	return SymInitialized;
-}
-
-BOOL AddressToName(DWORD Addr, LPTSTR Str, int Max)
-{
-	DWORD base;
-	if (!InitialiseImageHelp())
-		return FALSE;
-	base = SymGetModuleBase(s_hProcess, Addr);
-	if (base)
-	{
-		struct
-		{
-			IMAGEHLP_SYMBOL ihs;
-			char NameBuf[256];
-		} SymInfo;
-		DWORD Displacement = 0;
-		SymInfo.ihs.SizeOfStruct = sizeof(SymInfo);
-		SymInfo.ihs.MaxNameLength = sizeof(SymInfo.NameBuf);
-		if (SymGetSymFromAddr(s_hProcess, Addr, &Displacement, &SymInfo.ihs))
-		{
-			if (Displacement)
-				_snprintf(Str, Max-1, "%s+%x", SymInfo.ihs.Name, Displacement);
-			else
-				_snprintf(Str, Max-1, "%s", SymInfo.ihs.Name);
-			return TRUE;
-		}
-		else
-		{
-			_snprintf(Str, Max, "SymGetSymFromAddr failed (%d)", GetLastError());
-		}
-	}
-	else
-	{
-		_snprintf(Str, Max, "SymGetModuleBase failed (%d)", GetLastError());
-	}
-	return FALSE;
-}
-
-static int
-memory_record_dump( caddr_t data, caddr_t arg )
-{
-	int frame= 0;
-	char b1[MR_DUMP_AMOUNT*2+1];
-	char b2[MR_DUMP_AMOUNT+1];
-	char b3[128];
-	int size= 0;
-    struct memory_record *mr = (struct memory_record *)data;
-    if(!IsBadReadPtr(mr->p, MR_DUMP_AMOUNT))
-	{
-		size= MR_DUMP_AMOUNT;
-	}
-	mr_to_hex_dump(b1, mr->p, size, MR_DUMP_AMOUNT);
-	mr_to_char_dump(b2, mr->p, size, MR_DUMP_AMOUNT);
-	PR_snprintf(b3,sizeof(b3),"%p %ld %s %s",mr->p,mr->size,b1,b2);
-	LDAPDebug( LDAP_DEBUG_ANY, "%s\n",b3,0,0);
-	while(mr->ra[frame]!=0)
-	{
-		char fn[100];
-		AddressToName(mr->ra[frame], fn, 100);
-		LDAPDebug( LDAP_DEBUG_ANY, "%d %p %s\n",frame,mr->ra[frame],fn);
-		frame++;
-	}
-    return 0;
-}
-
-#endif
-
-

+ 0 - 2
ldap/servers/slapd/charray.c

@@ -45,9 +45,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/types.h>
-#ifndef _WIN32
 #include <sys/socket.h>
-#endif
 #include "slap.h"
 
 void

+ 0 - 2
ldap/servers/slapd/compare.c

@@ -54,9 +54,7 @@
 
 #include <stdio.h>
 #include <sys/types.h>
-#ifndef _WIN32
 #include <sys/socket.h>
-#endif
 #include "slap.h"
 #include "pratom.h"
 

+ 2 - 8
ldap/servers/slapd/config.c

@@ -47,14 +47,10 @@
 #include <sys/types.h>
 #include <errno.h>
 #include <stdlib.h>
-#ifdef _WIN32
-#include <direct.h> /* for getcwd */
-#else
 #include <sys/socket.h>
 #include <sys/param.h>
 #include <unistd.h>
 #include <pwd.h>
-#endif
 #include "slap.h"
 #include "pw.h"
 #include <sys/stat.h>
@@ -255,7 +251,7 @@ slapd_bootstrap_config(const char *configdir)
 					continue;
 				}
 				/* increase file descriptors */
-#if !defined(_WIN32) && !defined(AIX)
+#if !defined(AIX)
 				if (!maxdescriptors[0] &&
 					entry_has_attr_and_value(e, CONFIG_MAXDESCRIPTORS_ATTRIBUTE,
 									 maxdescriptors, sizeof(maxdescriptors)))
@@ -269,7 +265,7 @@ slapd_bootstrap_config(const char *configdir)
 								  CONFIG_MAXDESCRIPTORS_ATTRIBUTE, errorbuf);
 					}
 				}
-#endif /* !defined(_WIN32) && !defined(AIX) */
+#endif /* !defined(AIX) */
 
 				/* see if we need to enable error logging */
 				if (!logenabled[0] &&
@@ -287,7 +283,6 @@ slapd_bootstrap_config(const char *configdir)
 					}
 				}
 
-#ifndef _WIN32
 				/* set the local user name; needed to set up error log */
 				if (!_localuser[0] &&
 					entry_has_attr_and_value(e, CONFIG_LOCALUSER_ATTRIBUTE,
@@ -300,7 +295,6 @@ slapd_bootstrap_config(const char *configdir)
 								  CONFIG_LOCALUSER_ATTRIBUTE, errorbuf);
 					}
 				}
-#endif
 				
 				/* set the log file name */
 				workpath[0] = '\0';

+ 0 - 2
ldap/servers/slapd/configdse.c

@@ -46,10 +46,8 @@
 #include <string.h>
 #include <sys/types.h>
 #include <errno.h>
-#ifndef _WIN32
 #include <sys/socket.h>
 #include <sys/param.h>
-#endif
 #include "log.h"
 #include "slap.h"
 #include "pw.h"

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 128 - 969
ldap/servers/slapd/connection.c


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно