Welcome to Microsoft Q&A!
As far as I'm concerned, you should start from the beginning.
About the components into which the Windows Filtering Platform (WFP) API is divided, I suggest you could refer to the Doc: https://learn.microsoft.com/en-us/windows/win32/fwp/api-sets
If you want to add the rules that are already programmed when the service executable restarts due to exception or other error via WFP API, as far as I'm concerned it is impossible.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.