Thread: What permission issues in 64-bit Windows 7 might be causing this “124” return value?

  1. #1
    Registered User
    Join Date
    May 2006
    Posts
    100

    Question What permission issues in 64-bit Windows 7 might be causing 124 from SHFileOperation?

    Take the following code:

    Code:
    SHFileOp.hwnd = NULL;
    SHFileOp.wFunc = FO_COPY;
    SHFileOp.pFrom = szDisFileLst;
    SHFileOp.pTo = szFileLst;
    SHFileOp.fFlags = FOF_SIMPLEPROGRESS | FOF_SILENT | FOF_NOCONFIRMATION;    
    
    //The Copying Function
    x = SHFileOperation(&SHFileOp);
    This is part of a program which is supposed to grab a video off of a server and copy it over to the client's computer. It works in both 32-bit and 64-bit Windows 7 environments, despite the fact that it seems to be using some old-fashioned coding, but right now I'm having issues getting it to work on a particular 64-bit Windows 7 computer.

    Basically x is being set to 124, which supposedly means the source and/or destination are not in correct formats. This isn't the case though; I've compared both paths/filenames between this computer and another computer that they work just fine on - they're the same.

    Also I'm able to simply punch in the source into IE's URL textbox and immediately start watching the video in Windows Media Player (the URL involves the local IP), so connectivity or access to the other computer doesn't seem to be a problem. I did notice, however, that the computer this is having issues with is more locked-down with this "Run as Administrator" crap than the ones it has worked on, and from Googling around, it looks like SHFileOperation() can return 124 even when it's a permissions issue. I've shared the destination folder to everyone for read and write permissions, I'm running IE as an administrator, the program completes SHFileOperation() and then logs something in the destination's directory, etc.

    What else should I look at? This is not my program, and I'm not that good at programming specifically for Windows in C++. I would like to at least have some more leads to look into though. Thanks!

    ...By the way, I'm going to need to avoid changing the program as much as possible. Very tiny changes to barely make it work at the moment are fine, but replacing APIs or anything aren't gonna be a possibility for the time being.
    Last edited by jsrig88; 08-15-2012 at 04:08 PM.

  2. #2
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    Quote Originally Posted by jsrig88 View Post
    What else should I look at?
    The docs for the functions and structures you're using?

    Quote Originally Posted by msdn
    pFrom
    Type: PCZZTSTR

    Note This string must be double-null terminated.

    Although this member is declared as a single null-terminated string, it is actually a buffer that can hold multiple null-delimited file names. Each file name is terminated by a single NULL character. The last file name is terminated with a double NULL character ("\0\0") to indicate the end of the buffer.

    pTo
    Type: PCZZTSTR

    Note This string must be double-null terminated.
    Probably that obscure little requirement

  3. #3
    Registered User
    Join Date
    May 2006
    Posts
    100
    They are double-null-terminated.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Programming - Issues with return
    By Klcastillo in forum C Programming
    Replies: 3
    Last Post: 04-21-2012, 12:10 PM
  2. permission denied in windows 7
    By narendrav in forum C Programming
    Replies: 4
    Last Post: 03-16-2011, 12:26 PM
  3. windows linux compatibility issues
    By svaidya in forum C++ Programming
    Replies: 3
    Last Post: 08-26-2007, 04:57 PM
  4. Break statement issues, how to return to start of loop?
    By brdiger31 in forum C++ Programming
    Replies: 3
    Last Post: 06-01-2007, 03:29 PM
  5. Windows return error when input is made
    By newbie1234 in forum C Programming
    Replies: 8
    Last Post: 05-25-2006, 06:16 AM

Tags for this Thread