StorPort Registry Access

Hi,
I am using StorPortRegistryWrite, StorPortRegistryRead APIs to create and
store Adapter settings in the registry.

According to Microsoft documents,
StorPort creates Global key-values under
“HKLM/System/CCS/Services/%ServiceName%/Parameters/Device” key.
StorPort creates local (Per Device specific) key-values in
HKLM/System/CCS/Services/%ServiceName%/Parameters/Device0, …/Device%N

I have only one adapter, When I create key-values from FindAdapter
routine, the key-values are written under
“HKLM/System/CCS/Services/%ServiceName%/Parameters/Device0” key.

When I try to update the values again from other context,
new key-values are created under different key.
“HKLM/System/CCS/Services/%ServiceName%/Parameters/Device2”,

Instead of updating the key-values under
“HKLM/System/CCS/Services/%ServiceName%/Parameters/Device0” key
StorPort creates new key-values under
“HKLM/System/CCS/Services/%ServiceName%/Parameters/Device2”.

I have no idea about where “Device1” gone, Why it is creating Device2 key
instead of using the Device0.

If any one encountered similar problems or have a solution,
Pls. let me know.

vijay