2 * wapi-private.h: internal definitions of handles and shared memory layout
5 * Dick Porter (dick@ximian.com)
7 * (C) 2002-2006 Novell, Inc.
10 #ifndef _WAPI_PRIVATE_H_
11 #define _WAPI_PRIVATE_H_
17 #include <mono/io-layer/wapi.h>
18 #include <mono/io-layer/io.h>
19 #include <mono/io-layer/shared.h>
21 #include <mono/utils/mono-os-mutex.h>
23 extern gboolean _wapi_has_shut_down;
27 gchar name[MAX_PATH + 1];
28 } WapiSharedNamespace;
30 #include <mono/io-layer/event-private.h>
31 #include <mono/io-layer/io-private.h>
32 #include <mono/io-layer/mutex-private.h>
33 #include <mono/io-layer/semaphore-private.h>
34 #include <mono/io-layer/socket-private.h>
35 #include <mono/io-layer/thread-private.h>
36 #include <mono/io-layer/process-private.h>
37 #include <mono/utils/w32handle.h>
39 struct _WapiHandle_shared_ref
41 /* This will be split 16:16 with the shared file segment in
42 * the top half, when I implement space increases
47 #define _WAPI_SHARED_SEM_NAMESPACE 0
48 /*#define _WAPI_SHARED_SEM_COLLECTION 1*/
49 #define _WAPI_SHARED_SEM_FILESHARE 2
50 #define _WAPI_SHARED_SEM_PROCESS_COUNT_LOCK 6
51 #define _WAPI_SHARED_SEM_PROCESS_COUNT 7
52 #define _WAPI_SHARED_SEM_COUNT 8 /* Leave some future expansion space */
56 #ifdef WAPI_FILE_SHARE_PLATFORM_EXTRA_DATA
57 WAPI_FILE_SHARE_PLATFORM_EXTRA_DATA
68 typedef struct _WapiFileShare _WapiFileShare;
74 _wapi_search_handle_namespace (MonoW32HandleType type, gchar *utf8_name);
76 static inline int _wapi_namespace_lock (void)
78 return(_wapi_shm_sem_lock (_WAPI_SHARED_SEM_NAMESPACE));
81 /* This signature makes it easier to use in pthread cleanup handlers */
82 static inline int _wapi_namespace_unlock (gpointer data G_GNUC_UNUSED)
84 return(_wapi_shm_sem_unlock (_WAPI_SHARED_SEM_NAMESPACE));
87 #endif /* _WAPI_PRIVATE_H_ */