Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6103873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:46:41+00:00 2026-05-23T13:46:41+00:00

The code compiles fine and I have included the vssapi.lib in the additional dependencies

  • 0

The code compiles fine and I have included the vssapi.lib in the additional dependencies for the linker.

I get this error saying “CreatevssbackupcomponentsInternal procedure entry point could not be found in vssapi.dll”

And I get this error only when I try to run it on Windows server 2003 or Windows XP. It runs fine on Windows 7.

I will attach the code below, it is the standard shadow copy code.

// copy.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include <iostream>

#include <windows.h>
#include <winbase.h>

#include <vss.h>
#include <VsWriter.h>
#include <VsBackup.h>

int main()
{
    int retCode = 0;
    int i=0;
    HRESULT hr;
    IVssEnumObject *pIEnumSnapshots;
    IVssBackupComponents *ab;
    IVssAsync *pPrepareForBackupResults;
    GUID SnapshotSetID = GUID_NULL;

    VSS_OBJECT_PROP Prop;
    WCHAR wszVolumePathName[MAX_PATH]; 
    GUID snapshotID; 
    wcscpy(wszVolumePathName, L"E:\\");

    VSS_SNAPSHOT_PROP snapshotProperties;
    WCHAR existingFilePath[MAX_PATH] = TEXT("\\temp\\");
    WCHAR newFileLocation[MAX_PATH] = TEXT("c:\\Users\\");
    LPWCH pwszExposed;
    int *x;
    LONG deletedsnapshots = 0 ;
    GUID nondeletedsnapshots;
    TCHAR existingFileLocation[MAX_PATH];

    if (CoInitialize(NULL) != S_OK)
    {
        printf("CoInitialize failed!\n");
        return 1;
    }

    hr = CreateVssBackupComponents(&ab);
    if(hr != S_OK)
    {
        printf("Failed at CreateVssBackupComponents Stage");
        return 1;
    }

    hr = ab->InitializeForBackup();
    if(hr != S_OK)
    {
        printf("Failed at InitializeForBackup Stage");
        std::cout<<hr;
        return 1;
    }

    hr = ab->SetContext( VSS_CTX_FILE_SHARE_BACKUP);

    hr = ab->StartSnapshotSet(&SnapshotSetID);

    if(hr != S_OK)
    {
        printf("Failed at StartSnapshotset Stage");
        return 1;
    }

    hr = ab->AddToSnapshotSet(wszVolumePathName, GUID_NULL, &snapshotID); 

    if(hr != S_OK)
    {
        printf("Failed at AddtoSnapshotset Stage");
        return 1;
    }
    hr = ab->PrepareForBackup(&pPrepareForBackupResults);
    if(hr != S_OK)
    {
        printf("Failed at Backup");
    }

    hr = ab->DoSnapshotSet(&pPrepareForBackupResults);

    if(hr != S_OK)
    {
        printf("Failed at DoSnapshotset Stage");
        return 1;
    }

    while(true){
        pPrepareForBackupResults->QueryStatus(&hr, NULL);
        if(hr == VSS_S_ASYNC_FINISHED){
            break;
        }
    }

    hr = ab->GetSnapshotProperties(snapshotID, &snapshotProperties);
    if(hr != S_OK)
    {
        printf("Failed at GetSnapshotset Stage");
        return 1;
    }

    hr = ab->ExposeSnapshot(snapshotID, NULL, VSS_VOLSNAP_ATTR_EXPOSED_LOCALLY, L"C:\ShadowOff", &pwszExposed);

    wcscpy(existingFilePath,snapshotProperties.m_pwszOriginalVolumeName);
    wcscat(existingFilePath, L"downloads\\aa.exe");

    HANDLE hSourceFile = CreateFile(existingFilePath, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);

    hr = ab->DeleteSnapshots(SnapshotSetID, VSS_OBJECT_SNAPSHOT_SET ,FALSE, &deletedsnapshots, &nondeletedsnapshots);
    if(hr != S_OK)
    {
        printf("Failed at DeleteSnapshotset Stage");
        return 1;
    }
    return retCode;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:46:42+00:00Added an answer on May 23, 2026 at 1:46 pm

    You have to use the Windows Shadow Copy SDK for Windows versions prior to Windows Vista:
    http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=23490

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem with signal() : This code compiles fine: #include <stdio.h> #include
I have added some code which compiles cleanly and have just received this Windows
In Microsoft Oslo SDK CTP 2008 (using Intellipad) the following code compiles fine: module
This code compiles: private static void Main(string[] args) { bool? fred = true; if
I am a bit confused why this code compiles. I leave out the necessary
I am baffled by the linker error when using the following code: // static_const.cpp
The following code compiles correctly under VC++ 8 on XPSP3, but running it causes
While browsing some code I found a call to OpenPrinter() . The code compiles
Ultimately, code compiles down (eventually) into instructions for a CPU. Code, however, (in my
The code below compiles, but has different behavior for the char type than for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.