CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    222

    How to Restore Encrypted Files

    Hi Guru's

    I want to restore encrypted file. For that i am using WriteEncryptedFileRaw API. When I am writting code in C- style it is working fine but same code is not working in c++ style code.

    I am working in vc++ 6.0 under Windows 2000 professional.

    Any body have any idea please help me.


    Thank in advance

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: How to Restore Encrypted Files

    Way too few details to say anything sensible...

    Please post some code.
    Do you get compilation errors using the "C++ style"? Or runtime errors?
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    Jul 2004
    Posts
    222

    Re: How to Restore Encrypted Files

    Hi Marc
    In a Application, i Call function WriteEncryptedFileRaw .
    DWORD ii = WriteEncryptedFileRaw(&WriteCallback, &hf, pvContext) ;

    It gives error code 1917.

    DWORD WINAPI WriteCallback(PBYTE pbData, PVOID pvCallbackContext, PULONG ulLength)
    {
    HANDLE *phRawFile=(HANDLE *)pvCallbackContext;

    unsigned long nBytesRead=0;

    bool bStop=false;

    if(!ReadFile(*phRawFile,(LPVOID)pbData,*ulLength,&nBytesRead,0))
    {
    bStop=true;
    }
    *ulLength=nBytesRead;
    // nTotalBytes+=nBytesRead;
    printf("\n %u", nBytesRead);
    return bStop;
    }


    How i solve the problem ........

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured