Why does my Volume Shadow Copy Service requester fail: cannot find CreateVssBackupComponentsInternal

喜欢而已 提交于 2019-12-08 06:11:15

问题


I have implemented a VSS requester, and it links compiles and executes on Windows Server 2008, but does not execute on Windows Server 2003. Since my requester is inside a DLL, my DLL will not load. Using the Dependency Walker, I discovered that my DLL is finding VSSAPI.DLL just fine, but it reports:

Error: At least one required implicit or forwarded dependency was not found.

Looking at my VSSAPI.DLL, it cannot find CreateVssBackupComponentsInternal, while VSSAPI.DLL exports something completely different: ?CreateVssBackupComponents@@YGJPAPAVIVssBackupComponents@@@Z.


回答1:


VSS must be compiled and targeted specifically for each platform and OS, including Windows XP, Windows Server 2003, and Vista/Windows Server 2008.

The first Microsoft SDK to fully support VSS requesters is v6.1, and it only supports requesters running on Vista. If you want to run on Windows Server 2003 or XP:

  • Download VSS SDK 7.2.
  • Set your include and library paths to search the appropriate directory in the VSS SDK.

The following is what AlphaVSS does in its Config.h, but the VShadow sample in the VSS SDK does not: it only sets the include and library paths. I would suggest that following VShadow is more likely to succeed. But for completeness:

If targeting Windows XP:

#define NTDDI_VERSION NTDDI_WINXPSP2
#define _WIN32_WINNT _WIN32_WINNT_WINXP
#define WINVER _WIN32_WINNT

If targeting Windows Server 2003:

#define NTDDI_VERSION NTDDI_WS03SP1
#define _WIN32_WINNT _WIN32_WINNT_WS03
#define WINVER 0x501

If targeting Vista, don't reference the VSS SDK. Instead reference the Windows 6.1 SDK and:

#define NTDDI_VERSION NTDDI_WS08
#define _WIN32_WINNT _WIN32_WINNT_WS08
#define WINVER _WIN32_WINNT

I can't take all the credit for this, I figured this out by reading the source code of a project called AlphaVSS (see announcement), which exposes VSS to .NET code. MSDN did not seem to be very helpful. However, the VShadow tool and sample provided an example of how to compile a VSS requester.

Also note that you must recompile again for x64 or ia64 vs x86. That means in order to support all platforms, you'll need 9 compiled versions of your executable.




回答2:


Just wanted to add that AlphaVSS also sets the paths, not only the defines. This is needed in either case.



来源:https://stackoverflow.com/questions/789754/why-does-my-volume-shadow-copy-service-requester-fail-cannot-find-createvssback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!