Hi,
This service is not my friend!
Context of construction of my Winpe:
In the comments of my script, I see the addition, then retract it, and then again the addition of this service.
But I don't know why. I do not always take the time to clarify and justify the additions.
Observation with my Winpe:
If the files are not "correct" then the staterepository service rebuilds these files when it starts.
This construction is long: 2 minutes minimum on my machines
And during this time, "explorer" is blocked and cannot build the "desktop".
And it happens very often that the software "Explorer.exe" ends abruptly.
In the case of Winpe "Flat" in a VHD, and on the second startup of Winpe, the service uses the previously modified files.
The current solution:
It is necessary to integrate these 2 files into the construction mechanism of in Winpe.
This requires me to take 2 files from a machine running the OS of the same version as the "target" Winpe
Their existence and size (about 10MB) are a handicap for the use of my script.
Observation with my Winpe for HyperV:
When adding FODs with Dism, the 2 files of this service are disrupted again.
And I have to pre-lift these 2 files again during a second winpe startup.
Then I inject them into my winpe building mechanism with HyperV.
Questions:
What is the role of this Staterepository service?
How can I not use this service in my Winpe with "explorer" for desktop?
Thank you for helping me, giving me informations or ideas.
Staterepository service needed ?
-
- Registered User
- Posts: 96
- Joined: Mon 07 Jun, 2021 9:04 am
- Location: Nantes France
Staterepository service needed ?
Knowledge increases when it is shared
-
- Registered User
- Posts: 96
- Joined: Mon 07 Jun, 2021 9:04 am
- Location: Nantes France
Re: Staterepository service needed ?
hi,
About StateRepository in 22H2....
I have been implementing the StateRepository service for several versions of Winpe.
Until now, I copied the 2 files taken in a normal windows of the same version.
But with the 22H2 version, this method crashes the desktop of "explorer.exe" as soon as it launches.
While analyzing the start of "explorer.exe", I noticed the loading of "Taskbar.dll".
Windbg shows me that this dll was the cause of the crash.
This dll contains functions with the same name as those contained in the "explorer.exe" file.
This dll calls functions that seem to me to be related to the "metro/modern/UWP" applications (after analyze with IDA V7)
It seemed impossible to avoid crashing if this dll was loaded.
Procmon allowed me to see that the loading of this dll was due to a call to the StateRepository service.
And I tried to stop, delete files, restart the StateRepository service.
And that ended the crash.
So I opted for the reconstruction of these 2 files by the service itself after deleting the contents of the directory.
This is not the only solution, of course.
for HyperV in Winpe, i'll need a new investigation.
About StateRepository in 22H2....
I have been implementing the StateRepository service for several versions of Winpe.
Until now, I copied the 2 files taken in a normal windows of the same version.
But with the 22H2 version, this method crashes the desktop of "explorer.exe" as soon as it launches.
While analyzing the start of "explorer.exe", I noticed the loading of "Taskbar.dll".
Windbg shows me that this dll was the cause of the crash.
This dll contains functions with the same name as those contained in the "explorer.exe" file.
This dll calls functions that seem to me to be related to the "metro/modern/UWP" applications (after analyze with IDA V7)
It seemed impossible to avoid crashing if this dll was loaded.
Procmon allowed me to see that the loading of this dll was due to a call to the StateRepository service.
And I tried to stop, delete files, restart the StateRepository service.
And that ended the crash.
So I opted for the reconstruction of these 2 files by the service itself after deleting the contents of the directory.
This is not the only solution, of course.
for HyperV in Winpe, i'll need a new investigation.
Knowledge increases when it is shared
-
- Registered User
- Posts: 96
- Joined: Mon 07 Jun, 2021 9:04 am
- Location: Nantes France
Re: Staterepository service needed ?
Hi,
I forgot to write down the names of the 2 files built and updated by the StatreRepository service.
These are the files contained in the directory:
x:\ProgramData\Microsoft\Windows\AppRepository
StateRepository-Deployment.srd
StateRepository-Machine.srd
If you have any information about the role of this service and these files, please share it with me.

I forgot to write down the names of the 2 files built and updated by the StatreRepository service.
These are the files contained in the directory:
x:\ProgramData\Microsoft\Windows\AppRepository
StateRepository-Deployment.srd
StateRepository-Machine.srd
If you have any information about the role of this service and these files, please share it with me.

Knowledge increases when it is shared
Re: Staterepository service needed ?
install.wim\Windows\Containers\WindowsDefenderApplicationGuard.wim
you can get the .srd files from this wim file.
you can get the .srd files from this wim file.