[2/8] msi: Use an enum to represent folder states.
Hans Leidekker
hans at codeweavers.com
Thu Jun 30 05:14:07 CDT 2011
---
dlls/msi/action.c | 6 +++---
dlls/msi/files.c | 4 ++--
dlls/msi/msipriv.h | 19 ++++++++++++-------
3 files changed, 17 insertions(+), 12 deletions(-)
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index e892f64..01df974 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -877,8 +877,8 @@ static UINT ITERATE_CreateFolders(MSIRECORD *row, LPVOID param)
TRACE("folder is %s\n", debugstr_w(full_path));
folder = msi_get_loaded_folder( package, dir );
- if (folder->State == 0) msi_create_full_path( full_path );
- folder->State = 3;
+ if (folder->State == FOLDER_STATE_UNINITIALIZED) msi_create_full_path( full_path );
+ folder->State = FOLDER_STATE_CREATED_PERSISTENT;
return ERROR_SUCCESS;
}
@@ -946,7 +946,7 @@ static UINT ITERATE_RemoveFolders( MSIRECORD *row, LPVOID param )
RemoveDirectoryW( full_path );
folder = msi_get_loaded_folder( package, dir );
- folder->State = 0;
+ folder->State = FOLDER_STATE_REMOVED;
return ERROR_SUCCESS;
}
diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index d1bd615..69f6b68 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -239,10 +239,10 @@ static UINT msi_create_directory( MSIPACKAGE *package, const WCHAR *dir )
if (!install_path) return ERROR_FUNCTION_FAILED;
folder = msi_get_loaded_folder( package, dir );
- if (folder->State == 0)
+ if (folder->State == FOLDER_STATE_UNINITIALIZED)
{
msi_create_full_path( install_path );
- folder->State = 2;
+ folder->State = FOLDER_STATE_CREATED;
}
return ERROR_SUCCESS;
}
diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h
index 414b70c..09468c4 100644
--- a/dlls/msi/msipriv.h
+++ b/dlls/msi/msipriv.h
@@ -490,6 +490,15 @@ typedef struct tagFeatureList
MSIFEATURE *feature;
} FeatureList;
+enum folder_state
+{
+ FOLDER_STATE_UNINITIALIZED,
+ FOLDER_STATE_EXISTS,
+ FOLDER_STATE_CREATED,
+ FOLDER_STATE_CREATED_PERSISTENT,
+ FOLDER_STATE_REMOVED
+};
+
typedef struct tagMSIFOLDER
{
struct list entry;
@@ -502,13 +511,9 @@ typedef struct tagMSIFOLDER
LPWSTR ResolvedTarget;
LPWSTR ResolvedSource;
- INT State;
- /* 0 = uninitialized */
- /* 1 = existing */
- /* 2 = created remove if empty */
- /* 3 = created persist if empty */
- INT Cost;
- INT Space;
+ enum folder_state State;
+ INT Cost;
+ INT Space;
} MSIFOLDER;
typedef struct tagFolderList
--
1.7.4.1
More information about the wine-patches
mailing list