Two questions (Win update / Communication)

Home Forums PFM Developer Support Two questions (Win update / Communication)

This topic contains 3 posts, has 2 voices, and was last updated by  Dhebug 1 month, 1 week.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts

  • Dhebug
    Posts: 11

    Hi,
    first, thanks for the recent updates, which fixed all the blue screen issues.

    I do have two questions:

    1) I’ve noticed something strange, apparently related to the deployment of the major windows 10 updates (like the Fall Creators update and the previous large one a few months ago).

    When one of these large major updates is ready for installation, it seems to be causing conflicts with the virtual file system folder which suddenly become impossible to access, rename or delete.

    After installing the Windows update and rebooting, everything works again just fine.

    Do you have any idea about what could be causing this?

    2) Some of my users have asked if I could add a way to “control” my application from the outside so some operations could be managed by some command line scripts, like “update to last revision” or “sync to a particular version” or other similar commands acting on the content of the virtual file system.

    At the moment I have all these features, but they are available in the actual GUI, with buttons and combos.

    I’ve been thinking of various ways to implement that, like handling windows messages, having some local network port open, etc… but I did not really found a satisfactory (ie: Simple to use, maintainable) cross platform solution to the problem.

    If you have any suggestion, I’ll be interested to hear them :)

    My latest idea is to have a fake file in the file system, and have the user write commands to it, like for example:

    ECHO "-sync latest" > C:\Volumes\MyProject\SomeFakeFile.txt

    That has the advantage of being simple to handle on the caller side, but it’s not trivial to get some return code to check for errors (or maybe have one additional fake file for the results?), I’m also not sure if PFM would be happy to have these fake files randomly change content without an obvious external cause…


    Joe Lowe
    Posts: 90

    1) Issues with major windows updates:

    I have not heard this, will watch for it. Major updates are essentially OS upgrades (like upgrading win8 to win8.1). I am not sure how they could cause issues between download and install. I could see there maybe being issues with updates that partially install before rebooting.

    2) Scriptable control over a PFM file server implementation:

    You could build a command line tool that used PfmAPI::MountPointOpen(…) and PfmMount::Control(…) . This turns into calls to PfmFormatterDispatch::Control() in the server.

    Using special files would also work. You would want to disable caching on the special files by returning pfmControlFlagForceUnbuffered on open/create of the special files. You also might return unique file-id for each open which would make sure the client considers each open to be of a unique file.


    Dhebug
    Posts: 11

    The MountPointOpen/Control approach seems interesting.

    Do you have any other documentation apart of this?
    http://pismotec.com/pfm/doc/#pfmmount-control

    I tried the following code:

    bool TestMountControl()
    {
      PfmApi* pfmApi=nullptr;
      int err = PfmApiFactory(&pfmApi);
      if (!err)
      {
        // virtual int PT_CCALL MountPointOpen( const wchar_t* mountPoint, PfmMount** mount) = 0
        PfmMount* mount = nullptr;
        const wchar_t* mediaLabel = L"MyMountName";
        err=pfmApi->MountSourceNameOpen (mediaLabel,&mount);
        if (!err)
        {
          // virtual int PT_CCALL Control( int controlCode, const void* input, size_t inputSize, void* output, size_t maxOutputSize, size_t* outputSize) = 0
          int controlCode = 0;
          char* input="This is a test";
          size_t inputSize = 5; // sizeof(input);
          char output[256];
          size_t maxOutputSize = sizeof(output);
          size_t outputSize=0;
          err = mount->Control(controlCode,input,inputSize,output,maxOutputSize,&outputSize);
          if (!err)
          {
            return true;
          }
        }
      }
      return false;
    }
    

    Before using ‘MountSourceNameOpen’ I tried ‘MountPointOpen’ but I got a “file not found” error (was not sure what the string was supposed to be).
    After using MountSourceNameOpen it worked, but then when calling “Control” I got an error 1 returned.

    I called the test code from my actual application UI, so maybe the problem is that I called the code from the actual PFM application? Or is it that I totally misunderstood how the Control function worked :) ?

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.