WinPmem: Default service name conflicts with Microsoft (pmem)

We have spent some time trying to understand how WinPmem interacts with Microsofts persistent memory driver. (Some random docs mentioning it: HCI, SQL, PS)

Unfortunately, WinPmem completely ignores it, removes the service, and does not restore it.

Also, if the driver is already loaded, the service cannot be stopped, and WinPmem fails to run.

This should only be an issue on Windows 10 or newer.

C:\>sc qc pmem
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: pmem
        TYPE               : 1  KERNEL_DRIVER
        START_TYPE         : 3   DEMAND_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : \SystemRoot\System32\drivers\pmem.sys
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : Microsoft persistent memory disk driver
        DEPENDENCIES       :
        SERVICE_START_NAME :

I would suggest, instead of making WinPmem test different cases if the driver is loaded or not, and trying to restore it, I would just rename the WinPmem service to winpmem instead of pmem.

Also, a command-line argument for the service name would also be nice, as an optional extra. But not a high priority.

Also, WinPmem as a name, is that for physical memory? Because imo, that’s assumed, in my mind. Pmem means persistent memory. But that’s not what I’m creating this issue for! 😁

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18 (4 by maintainers)

Most upvoted comments

So it was the servicename, in the end. Hopefully this is the issue. Here is the minitool, using servicename winpmem now. I would like to know if this works?

winpmem_minitool_6June2024_test.zip

Thanks for testing - as you pointed out the syntax is a bit different as there is also an extract command to be able to decompress the compressed image later. I found empirically that S2 compression is slightly faster than raw image (due to less IO) and takes significantly less space.

As you can see with no compression we write a sparse file on NTFS which helps keep disk use down a bit already.

I tried to rebuild the C imager and it seems very outdated and difficult to maintain - So I wrote a new Go based imager on the releases page. It is much simpler for us to maintain going forward and also supports some compression out of the box (as well as allowing the service name to be changed). Please test and see if it solves this issue.

Now Scudette needs to make a new release. ^^

I don’t know, there’s pro and contra, I leave this up to Scudette. For now it’s not important enough. ;-D