EDN Admin
Well-known member
Hi,<br/>
<br/>
i am fighting the Volume Shadow Copy API, which seems to be one hard beast, especially when it comes to portability. Though i am developing in C#, this is more a C++ question due to the nature of the interface. The Interface definitions for Windows
Vista and Upper are pretty clean and clear and easy to implement in C# for usage. All has to be hand written, but its straightforward, since the original headers of the VSS SDK are a great resource for translation into C#. But i found out, that the interfaces
differ from XP to Vista+ regarding the Guid-Attribute. Let me show you:<br/>
<br/>
Vista and Upper look like this:<br/>
<br/>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; class __declspec(<span style="color:Blue; uuid(<span style="color:#A31515; "665c1d5f-c218-414d-a05d-7fef5f9d5c86")) IVssBackupComponents : <span style="color:Blue; public IUnknown
{
<span style="color:Blue; public:
[/code]
<br/>
<br/>
<br/>
Windows XP looks like this:<br/>
<br/>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; class IVssBackupComponents : <span style="color:Blue; public IUnknown
{
<span style="color:Blue; public:
[/code]
<br/>
And now my question: How do i import and invoke a Interface without knowing its interface guid??? Thats really what the interface from the "vsbackup.h" fpr XP is looking like, but i need some Guid to be able to access the interface and do a QueryInterface.
What do i have to do now?<br/>
<br/>
The bad thing is that MS has changed the Guids for the interfaces, breaking them from XP to Vista+, see here:<br/>
<br/>
Thats XP:<br/>
<div style="color:Black;background-color:White; <pre>
MIDL_INTERFACE(<span style="color:#A31515; "C7B98A22-222D-4e62-B875-1A44980634AF")
IVssAsync : <span style="color:Blue; public IUnknown
{
[/code]
<br/>
And this is Vista and Upper:<br/>
<br/>
<div style="color:Black;background-color:White; <pre>
MIDL_INTERFACE(<span style="color:#A31515; "507C37B4-CF5B-4e95-B0AF-14EB9767467E")
IVssAsync : <span style="color:Blue; public IUnknown
{
[/code]
<br/>
So calling them makes it a little harder, because i have to code in two branches, means double code and effort. But the biggest problem here is: How do i get a Pointer to the Guidless Interface "IVssBackupComponents" on XP?<br/>
<br/>
best<br/>
<br/>
K.<br/><hr class="sig ------------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü http://entwicklung.junetz.de ------------------------- "This reply is provided as is, without warranty express or implied."
View the full article
<br/>
i am fighting the Volume Shadow Copy API, which seems to be one hard beast, especially when it comes to portability. Though i am developing in C#, this is more a C++ question due to the nature of the interface. The Interface definitions for Windows
Vista and Upper are pretty clean and clear and easy to implement in C# for usage. All has to be hand written, but its straightforward, since the original headers of the VSS SDK are a great resource for translation into C#. But i found out, that the interfaces
differ from XP to Vista+ regarding the Guid-Attribute. Let me show you:<br/>
<br/>
Vista and Upper look like this:<br/>
<br/>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; class __declspec(<span style="color:Blue; uuid(<span style="color:#A31515; "665c1d5f-c218-414d-a05d-7fef5f9d5c86")) IVssBackupComponents : <span style="color:Blue; public IUnknown
{
<span style="color:Blue; public:
[/code]
<br/>
<br/>
<br/>
Windows XP looks like this:<br/>
<br/>
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; class IVssBackupComponents : <span style="color:Blue; public IUnknown
{
<span style="color:Blue; public:
[/code]
<br/>
And now my question: How do i import and invoke a Interface without knowing its interface guid??? Thats really what the interface from the "vsbackup.h" fpr XP is looking like, but i need some Guid to be able to access the interface and do a QueryInterface.
What do i have to do now?<br/>
<br/>
The bad thing is that MS has changed the Guids for the interfaces, breaking them from XP to Vista+, see here:<br/>
<br/>
Thats XP:<br/>
<div style="color:Black;background-color:White; <pre>
MIDL_INTERFACE(<span style="color:#A31515; "C7B98A22-222D-4e62-B875-1A44980634AF")
IVssAsync : <span style="color:Blue; public IUnknown
{
[/code]
<br/>
And this is Vista and Upper:<br/>
<br/>
<div style="color:Black;background-color:White; <pre>
MIDL_INTERFACE(<span style="color:#A31515; "507C37B4-CF5B-4e95-B0AF-14EB9767467E")
IVssAsync : <span style="color:Blue; public IUnknown
{
[/code]
<br/>
So calling them makes it a little harder, because i have to code in two branches, means double code and effort. But the biggest problem here is: How do i get a Pointer to the Guidless Interface "IVssBackupComponents" on XP?<br/>
<br/>
best<br/>
<br/>
K.<br/><hr class="sig ------------------------- Beste Grüsse / Best regards / Votre bien devoue Kerem Gümrükcü http://entwicklung.junetz.de ------------------------- "This reply is provided as is, without warranty express or implied."
View the full article