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 /* There doesn't seem to be a defined symbol for this */
24 #define _WAPI_THREAD_CURRENT (gpointer)0xFFFFFFFE
26 extern gboolean _wapi_has_shut_down;
30 gchar name[MAX_PATH + 1];
31 } WapiSharedNamespace;
33 #include <mono/io-layer/event-private.h>
34 #include <mono/io-layer/io-private.h>
35 #include <mono/io-layer/mutex-private.h>
36 #include <mono/io-layer/semaphore-private.h>
37 #include <mono/io-layer/socket-private.h>
38 #include <mono/io-layer/process-private.h>
39 #include <mono/utils/w32handle.h>
41 struct _WapiHandle_shared_ref
43 /* This will be split 16:16 with the shared file segment in
44 * the top half, when I implement space increases
49 #define _WAPI_SHARED_SEM_NAMESPACE 0
50 /*#define _WAPI_SHARED_SEM_COLLECTION 1*/
51 #define _WAPI_SHARED_SEM_FILESHARE 2
52 #define _WAPI_SHARED_SEM_PROCESS_COUNT_LOCK 6
53 #define _WAPI_SHARED_SEM_PROCESS_COUNT 7
54 #define _WAPI_SHARED_SEM_COUNT 8 /* Leave some future expansion space */
58 #ifdef WAPI_FILE_SHARE_PLATFORM_EXTRA_DATA
59 WAPI_FILE_SHARE_PLATFORM_EXTRA_DATA
70 typedef struct _WapiFileShare _WapiFileShare;
73 _wapi_search_handle_namespace (MonoW32HandleType type, gchar *utf8_name);
75 static inline int _wapi_namespace_lock (void)
77 return(_wapi_shm_sem_lock (_WAPI_SHARED_SEM_NAMESPACE));
80 /* This signature makes it easier to use in pthread cleanup handlers */
81 static inline int _wapi_namespace_unlock (gpointer data G_GNUC_UNUSED)
83 return(_wapi_shm_sem_unlock (_WAPI_SHARED_SEM_NAMESPACE));
86 #endif /* _WAPI_PRIVATE_H_ */