Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
25ba5c8b
Commit
25ba5c8b
authored
Apr 26, 2012
by
Hans Leidekker
Committed by
Alexandre Julliard
Apr 26, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fusion: Implement IAssemblyCache::UninstallAssembly.
parent
89e95aa9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
77 additions
and
26 deletions
+77
-26
asmcache.c
dlls/fusion/asmcache.c
+68
-1
asmcache.c
dlls/fusion/tests/asmcache.c
+9
-25
No files found.
dlls/fusion/asmcache.c
View file @
25ba5c8b
...
...
@@ -183,10 +183,77 @@ static HRESULT WINAPI IAssemblyCacheImpl_UninstallAssembly(IAssemblyCache *iface
LPCFUSION_INSTALL_REFERENCE
pRefData
,
ULONG
*
pulDisposition
)
{
FIXME
(
"(%p, %d, %s, %p, %p) stub!
\n
"
,
iface
,
dwFlags
,
HRESULT
hr
;
IAssemblyName
*
asmname
,
*
next
=
NULL
;
IAssemblyEnum
*
asmenum
=
NULL
;
WCHAR
*
p
,
*
path
=
NULL
;
ULONG
disp
;
DWORD
len
;
TRACE
(
"(%p, 0%08x, %s, %p, %p)
\n
"
,
iface
,
dwFlags
,
debugstr_w
(
pszAssemblyName
),
pRefData
,
pulDisposition
);
if
(
pRefData
)
{
FIXME
(
"application reference not supported
\n
"
);
return
E_NOTIMPL
;
}
hr
=
CreateAssemblyNameObject
(
&
asmname
,
pszAssemblyName
,
CANOF_PARSE_DISPLAY_NAME
,
NULL
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
CreateAssemblyEnum
(
&
asmenum
,
NULL
,
asmname
,
ASM_CACHE_GAC
,
NULL
);
if
(
FAILED
(
hr
))
goto
done
;
hr
=
IAssemblyEnum_GetNextAssembly
(
asmenum
,
NULL
,
&
next
,
0
);
if
(
hr
==
S_FALSE
)
{
if
(
pulDisposition
)
*
pulDisposition
=
IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED
;
goto
done
;
}
hr
=
IAssemblyName_GetPath
(
next
,
NULL
,
&
len
);
if
(
hr
!=
HRESULT_FROM_WIN32
(
ERROR_INSUFFICIENT_BUFFER
))
goto
done
;
if
(
!
(
path
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
*
sizeof
(
WCHAR
)
)))
{
hr
=
E_OUTOFMEMORY
;
goto
done
;
}
hr
=
IAssemblyName_GetPath
(
next
,
path
,
&
len
);
if
(
FAILED
(
hr
))
goto
done
;
if
(
DeleteFileW
(
path
))
{
if
((
p
=
strrchrW
(
path
,
'\\'
)))
{
*
p
=
0
;
RemoveDirectoryW
(
path
);
if
((
p
=
strrchrW
(
path
,
'\\'
)))
{
*
p
=
0
;
RemoveDirectoryW
(
path
);
}
}
disp
=
IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED
;
hr
=
S_OK
;
}
else
{
disp
=
IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED
;
hr
=
S_FALSE
;
}
if
(
pulDisposition
)
*
pulDisposition
=
disp
;
done:
IAssemblyName_Release
(
asmname
);
if
(
next
)
IAssemblyName_Release
(
next
);
if
(
asmenum
)
IAssemblyEnum_Release
(
asmenum
);
HeapFree
(
GetProcessHeap
(),
0
,
path
);
return
hr
;
}
static
HRESULT
WINAPI
IAssemblyCacheImpl_QueryAssemblyInfo
(
IAssemblyCache
*
iface
,
...
...
dlls/fusion/tests/asmcache.c
View file @
25ba5c8b
...
...
@@ -888,7 +888,6 @@ static void test_InstallAssembly(void)
ULONG
disp
;
DWORD
attr
;
char
dllpath
[
MAX_PATH
];
UINT
size
;
static
const
WCHAR
empty
[]
=
{
0
};
static
const
WCHAR
noext
[]
=
{
'f'
,
'i'
,
'l'
,
'e'
,
0
};
...
...
@@ -942,7 +941,7 @@ static void test_InstallAssembly(void)
hr
=
IAssemblyCache_InstallAssembly
(
cache
,
0
,
winedll
,
NULL
);
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
size
=
GetWindowsDirectoryA
(
dllpath
,
MAX_PATH
);
GetWindowsDirectoryA
(
dllpath
,
MAX_PATH
);
strcat
(
dllpath
,
"
\\
assembly
\\
GAC_MSIL
\\
wine
\\\\
1.0.0.0__2d03617b1c31e2f5
\\
wine.dll"
);
attr
=
GetFileAttributes
(
dllpath
);
...
...
@@ -951,19 +950,18 @@ static void test_InstallAssembly(void)
/* uninstall the assembly from the GAC */
disp
=
0xf00dbad
;
hr
=
IAssemblyCache_UninstallAssembly
(
cache
,
0
,
wine
,
NULL
,
&
disp
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
disp
==
IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED
,
"Expected IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED, got %d
\n
"
,
disp
);
}
/* FIXME: remove once UninstallAssembly is implemented */
DeleteFileA
(
dllpath
);
dllpath
[
size
+
sizeof
(
"
\\
assembly
\\
GAC_MSIL
\\
wine
\\
1.0.0.0__2d03617b1c31e2f5"
)]
=
'\0'
;
RemoveDirectoryA
(
dllpath
);
dllpath
[
size
+
sizeof
(
"
\\
assembly
\\
GAC_MSIL
\\
wine"
)]
=
'\0'
;
RemoveDirectoryA
(
dllpath
);
attr
=
GetFileAttributes
(
dllpath
);
ok
(
attr
==
INVALID_FILE_ATTRIBUTES
,
"Expected assembly not to exist
\n
"
);
disp
=
0xf00dbad
;
hr
=
IAssemblyCache_UninstallAssembly
(
cache
,
0
,
wine
,
NULL
,
&
disp
);
ok
(
hr
==
S_FALSE
,
"Expected S_FALSE, got %08x
\n
"
,
hr
);
ok
(
disp
==
IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED
,
"Expected IASSEMBLYCACHE_UNINSTALL_DISPOSITION_ALREADY_UNINSTALLED, got %d
\n
"
,
disp
);
DeleteFileA
(
"test.dll"
);
DeleteFileA
(
"wine.dll"
);
...
...
@@ -987,8 +985,6 @@ static void test_QueryAssemblyInfo(void)
HRESULT
hr
;
DWORD
size
;
ULONG
disp
;
char
dllpath
[
MAX_PATH
];
UINT
len
;
static
const
WCHAR
empty
[]
=
{
0
};
static
const
WCHAR
commasep
[]
=
{
','
,
' '
,
0
};
...
...
@@ -1503,21 +1499,9 @@ static void test_QueryAssemblyInfo(void)
/* uninstall the assembly from the GAC */
disp
=
0xf00dbad
;
hr
=
IAssemblyCache_UninstallAssembly
(
cache
,
0
,
wine
,
NULL
,
&
disp
);
todo_wine
{
ok
(
hr
==
S_OK
,
"Expected S_OK, got %08x
\n
"
,
hr
);
ok
(
disp
==
IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED
,
"Expected IASSEMBLYCACHE_UNINSTALL_DISPOSITION_UNINSTALLED, got %d
\n
"
,
disp
);
}
/* FIXME: remove once UninstallAssembly is implemented */
len
=
GetWindowsDirectoryA
(
dllpath
,
MAX_PATH
);
strcat
(
dllpath
,
"
\\
assembly
\\
GAC_MSIL
\\
wine
\\\\
1.0.0.0__2d03617b1c31e2f5
\\
wine.dll"
);
DeleteFileA
(
dllpath
);
dllpath
[
len
+
sizeof
(
"
\\
assembly
\\
GAC_MSIL
\\
wine
\\
1.0.0.0__2d03617b1c31e2f5"
)]
=
'\0'
;
RemoveDirectoryA
(
dllpath
);
dllpath
[
len
+
sizeof
(
"
\\
assembly
\\
GAC_MSIL
\\
wine"
)]
=
'\0'
;
RemoveDirectoryA
(
dllpath
);
DeleteFileA
(
"test.dll"
);
DeleteFileA
(
"wine.dll"
);
...
...
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