9c0e3098c6b1522dc9e1f8ddc6af9cecbf160907
[captive.git] / src / libcaptive / cc / sharedcachemap.h
1 /* $Id$
2  * Include file for reactos Cache Manager (Cc*) SharedCacheMap structure of libcaptive
3  * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #ifndef _CAPTIVE_CC_SHARED_CACHE_MAP_H
21 #define _CAPTIVE_CC_SHARED_CACHE_MAP_H 1
22
23
24 #include <glib/gmacros.h>
25 #include <glib-object.h>
26 #include "reactos/ddk/cctypes.h"
27
28
29 G_BEGIN_DECLS
30
31 #define CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT            (captive_shared_cache_map_object_get_type())
32 #define CAPTIVE_SHARED_CACHE_MAP_OBJECT(object)         (G_TYPE_CHECK_INSTANCE_CAST((object),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT,CaptiveSharedCacheMapObject))
33 #define CAPTIVE_SHARED_CACHE_MAP_OBJECT_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST((klass),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT,CaptiveSharedCacheMapObjectClass))
34 #define CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT(object)      (G_TYPE_CHECK_INSTANCE_TYPE((object),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT))
35 #define CAPTIVE_SHARED_CACHE_MAP_IS_OBJECT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT))
36 #define CAPTIVE_SHARED_CACHE_MAP_OBJECT_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj),CAPTIVE_SHARED_CACHE_MAP_TYPE_OBJECT,CaptiveSharedCacheMapObjectClass))
37 typedef struct _CaptiveSharedCacheMapObject      CaptiveSharedCacheMapObject;
38 typedef struct _CaptiveSharedCacheMapObjectClass CaptiveSharedCacheMapObjectClass;
39
40
41 GType captive_shared_cache_map_object_get_type(void);
42
43 CaptiveSharedCacheMapObject *captive_shared_cache_map_get_ref(FILE_OBJECT *FileObject,
44                 const CC_FILE_SIZES *FileSizes,BOOLEAN PinAccess,const CACHE_MANAGER_CALLBACKS *CallBacks,VOID *LazyWriterContext);
45 void captive_shared_cache_map_FileSizes_set(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
46                 const CC_FILE_SIZES *FileSizes);
47 CaptiveSharedCacheMapObject *captive_SectionObjectPointers_to_SharedCacheMap(SECTION_OBJECT_POINTERS *SectionObjectPointers);
48 CaptiveSharedCacheMapObject *captive_FileObject_to_SharedCacheMap(FILE_OBJECT *FileObject);
49 void captive_shared_cache_map_w32_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object);
50 void captive_shared_cache_map_w32_unref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object);
51 gint captive_shared_cache_map_query_w32_ref(CaptiveSharedCacheMapObject *captive_shared_cache_map_object);
52 void captive_shared_cache_map_data_validate_read(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
53                 FILE_OBJECT *FileObject,guint64 validate_start,guint64 validate_end);
54 void captive_shared_cache_map_data_validate_noread(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
55                 guint64 validate_start,guint64 validate_end);
56 void captive_shared_cache_map_set_data_valid(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
57                 guint64 start,guint64 end);
58 void captive_shared_cache_map_set_data_invalid(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
59                 guint64 start,guint64 end);
60 void captive_shared_cache_map_set_dirty(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
61                 guint64 start,guint64 end);
62 guint64 captive_shared_cache_map_memory_range_set_dirty(gpointer address_start,gpointer address_end);
63 gboolean captive_shared_cache_map_is_page_dirty(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
64                 guint64 offset);
65 void captive_shared_cache_map_page_set_lsn(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
66                 guint64 offset,gint64 lsn);
67 void captive_shared_cache_map_purge(CaptiveSharedCacheMapObject *captive_shared_cache_map_object);
68 void captive_shared_cache_map_set_LogHandle(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,VOID *LogHandle);
69 void captive_shared_cache_map_set_FlushToLsnRoutine
70                 (CaptiveSharedCacheMapObject *captive_shared_cache_map_object,PFLUSH_TO_LSN FlushToLsnRoutine);
71 guint64 captive_shared_cache_map_flush(CaptiveSharedCacheMapObject *captive_shared_cache_map_object,
72                 guint64 start,guint64 end);
73 void captive_shared_cache_map_flush_all(void);
74 gboolean captive_shared_cache_map_is_any_dirty(void);
75 gint64 captive_shared_cache_map_CcGetDirtyPages(PDIRTY_PAGE_ROUTINE DirtyPageRoutine,VOID *Context1,VOID *Context2);
76 gpointer captive_shared_cache_map_get_buffer(CaptiveSharedCacheMapObject *captive_shared_cache_map_object);
77
78 G_END_DECLS
79
80
81 #endif /* _CAPTIVE_CC_SHARED_CACHE_MAP_H */