Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
2aa6e2eb
Commit
2aa6e2eb
authored
Feb 20, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Feb 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advpack: Implement AddDelBackupEntry.
parent
bc7cb836
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
25 deletions
+44
-25
files.c
dlls/advpack/files.c
+35
-4
files.c
dlls/advpack/tests/files.c
+9
-21
No files found.
dlls/advpack/files.c
View file @
2aa6e2eb
...
@@ -55,16 +55,47 @@ WINE_DEFAULT_DEBUG_CHANNEL(advpack);
...
@@ -55,16 +55,47 @@ WINE_DEFAULT_DEBUG_CHANNEL(advpack);
*
*
* If lpcszBackupDir is NULL, the INI file is assumed to exist in
* If lpcszBackupDir is NULL, the INI file is assumed to exist in
* c:\windows or created there if it does not exist.
* c:\windows or created there if it does not exist.
*
* BUGS
* Unimplemented.
*/
*/
HRESULT
WINAPI
AddDelBackupEntry
(
LPCSTR
lpcszFileList
,
LPCSTR
lpcszBackupDir
,
HRESULT
WINAPI
AddDelBackupEntry
(
LPCSTR
lpcszFileList
,
LPCSTR
lpcszBackupDir
,
LPCSTR
lpcszBaseName
,
DWORD
dwFlags
)
LPCSTR
lpcszBaseName
,
DWORD
dwFlags
)
{
{
FIXME
(
"(%p, %p, %p, %ld) stub
\n
"
,
lpcszFileList
,
lpcszBackupDir
,
CHAR
szIniPath
[
MAX_PATH
];
LPSTR
szString
=
NULL
;
const
char
szBackupEntry
[]
=
"-1,0,0,0,0,0,-1"
;
TRACE
(
"(%p, %p, %p, %ld)
\n
"
,
lpcszFileList
,
lpcszBackupDir
,
lpcszBaseName
,
dwFlags
);
lpcszBaseName
,
dwFlags
);
if
(
!
lpcszFileList
||
!*
lpcszFileList
)
return
S_OK
;
if
(
lpcszBackupDir
)
lstrcpyA
(
szIniPath
,
lpcszBackupDir
);
else
GetWindowsDirectoryA
(
szIniPath
,
MAX_PATH
);
lstrcatA
(
szIniPath
,
"
\\
"
);
lstrcatA
(
szIniPath
,
lpcszBaseName
);
lstrcatA
(
szIniPath
,
".ini"
);
SetFileAttributesA
(
szIniPath
,
FILE_ATTRIBUTE_NORMAL
);
if
(
dwFlags
&
AADBE_ADD_ENTRY
)
szString
=
(
LPSTR
)
szBackupEntry
;
else
if
(
dwFlags
&
AADBE_DEL_ENTRY
)
szString
=
NULL
;
/* add or delete the INI entries */
while
(
*
lpcszFileList
)
{
WritePrivateProfileStringA
(
"backup"
,
lpcszFileList
,
szString
,
szIniPath
);
lpcszFileList
+=
lstrlenA
(
lpcszFileList
)
+
1
;
}
/* hide the INI file */
SetFileAttributesA
(
szIniPath
,
FILE_ATTRIBUTE_READONLY
|
FILE_ATTRIBUTE_HIDDEN
);
return
S_OK
;
return
S_OK
;
}
}
...
...
dlls/advpack/tests/files.c
View file @
2aa6e2eb
...
@@ -163,12 +163,9 @@ static void test_AddDelBackupEntry()
...
@@ -163,12 +163,9 @@ static void test_AddDelBackupEntry()
/* create the INF file */
/* create the INF file */
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three"
,
"c:
\\
"
,
"basename"
,
AADBE_ADD_ENTRY
);
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three"
,
"c:
\\
"
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
todo_wine
ok
(
check_ini_file_attr
(
path
),
"Expected ini file to be hidden
\n
"
);
{
ok
(
check_ini_contents
(
path
,
TRUE
),
"Expected ini contents to match
\n
"
);
ok
(
check_ini_file_attr
(
path
),
"Expected ini file to be hidden
\n
"
);
ok
(
DeleteFileA
(
path
),
"Expected path to exist
\n
"
);
ok
(
check_ini_contents
(
path
,
TRUE
),
"Expected ini contents to match
\n
"
);
ok
(
DeleteFileA
(
path
),
"Expected path to exist
\n
"
);
}
lstrcpyA
(
path
,
CURR_DIR
);
lstrcpyA
(
path
,
CURR_DIR
);
lstrcatA
(
path
,
"
\\
backup
\\
basename.INI"
);
lstrcatA
(
path
,
"
\\
backup
\\
basename.INI"
);
...
@@ -185,12 +182,9 @@ static void test_AddDelBackupEntry()
...
@@ -185,12 +182,9 @@ static void test_AddDelBackupEntry()
CreateDirectoryA
(
"backup"
,
NULL
);
CreateDirectoryA
(
"backup"
,
NULL
);
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three"
,
"backup"
,
"basename"
,
AADBE_ADD_ENTRY
);
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three"
,
"backup"
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
todo_wine
ok
(
check_ini_file_attr
(
path
),
"Expected ini file to be hidden
\n
"
);
{
ok
(
check_ini_contents
(
path
,
TRUE
),
"Expected ini contents to match
\n
"
);
ok
(
check_ini_file_attr
(
path
),
"Expected ini file to be hidden
\n
"
);
ok
(
DeleteFileA
(
path
),
"Expected path to exist
\n
"
);
ok
(
check_ini_contents
(
path
,
TRUE
),
"Expected ini contents to match
\n
"
);
ok
(
DeleteFileA
(
path
),
"Expected path to exist
\n
"
);
}
RemoveDirectoryA
(
"backup"
);
RemoveDirectoryA
(
"backup"
);
lstrcpyA
(
path
,
"c:
\\
windows
\\
basename.INI"
);
lstrcpyA
(
path
,
"c:
\\
windows
\\
basename.INI"
);
...
@@ -198,21 +192,15 @@ static void test_AddDelBackupEntry()
...
@@ -198,21 +192,15 @@ static void test_AddDelBackupEntry()
/* try a NULL backup dir, INI is created in c:\windows */
/* try a NULL backup dir, INI is created in c:\windows */
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three"
,
NULL
,
"basename"
,
AADBE_ADD_ENTRY
);
res
=
pAddDelBackupEntry
(
"one
\0
two
\0
three"
,
NULL
,
"basename"
,
AADBE_ADD_ENTRY
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
todo_wine
ok
(
check_ini_contents
(
path
,
TRUE
),
"Expected ini contents to match
\n
"
);
{
ok
(
check_ini_contents
(
path
,
TRUE
),
"Expected ini contents to match
\n
"
);
}
/* remove the entries with AADBE_DEL_ENTRY */
/* remove the entries with AADBE_DEL_ENTRY */
SetFileAttributesA
(
path
,
FILE_ATTRIBUTE_NORMAL
);
SetFileAttributesA
(
path
,
FILE_ATTRIBUTE_NORMAL
);
res
=
pAddDelBackupEntry
(
"one
\0
three"
,
NULL
,
"basename"
,
AADBE_DEL_ENTRY
);
res
=
pAddDelBackupEntry
(
"one
\0
three"
,
NULL
,
"basename"
,
AADBE_DEL_ENTRY
);
SetFileAttributesA
(
path
,
FILE_ATTRIBUTE_NORMAL
);
SetFileAttributesA
(
path
,
FILE_ATTRIBUTE_NORMAL
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
ok
(
res
==
S_OK
,
"Expected S_OK, got %ld
\n
"
,
res
);
todo_wine
ok
(
check_ini_contents
(
path
,
FALSE
),
"Expected ini contents to match
\n
"
);
{
ok
(
DeleteFileA
(
path
),
"Expected path to exist
\n
"
);
ok
(
check_ini_contents
(
path
,
FALSE
),
"Expected ini contents to match
\n
"
);
ok
(
DeleteFileA
(
path
),
"Expected path to exist
\n
"
);
}
}
}
/* the FCI callbacks */
/* the FCI callbacks */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment