EldoS | Feel safer!

Software components for data protection, secure storage and transfer

PreOpSampleSetValueKeyEvent in Sample code

Also by EldoS: Solid File System
A virtual file system that offers a feature-rich storage for application documents and data with built-in compression and encryption.
Posted: 02/25/2016 04:16:54
by Danny Kim (Basic support level)
Joined: 02/25/2016
Posts: 4


I'm testing GenSample's code and have a question in PreOpSampleSetValueKeyEvent function.
In this function, I can know the value's name by IN PCWSTR ValueName,
But I couldn't find the Registry Key Path which is accessing.

Is there a way to get the registry key path?

Posted: 02/25/2016 07:36:03
by Volodymyr Zinin (EldoS Corp.)

Thank you for interesting of our product. Save anything you need (key name, key handle, etc) in the UserContext parameter during the PreOpenKey or PostOpenKey callback call. I.e. allocate some defined by you structure, place there necessary information, and save a pointer to it in UserContext. Later you can get this pointer in any other callbacks. See how it is implemented in VirtOpSamplePreOpenKeyEvent.

Posted: 02/25/2016 21:37:40
by Danny Kim (Basic support level)
Joined: 02/25/2016
Posts: 4

Thank you for the replay. That's the one that I really want.
I have one more question.

In PreOpSampleSetValueKeyEvent, can I bypass writing the value to registry without throwing ECBRegError ?

Posted: 02/26/2016 03:53:41
by Volodymyr Zinin (EldoS Corp.)

Of course. Just do nothing in the callback. For example in GenSample in the PreOpSampleSetValueKeyEvent callback the "access denied" error is thrown only for the "time" value. Any other values are bypassed.
Posted: 02/29/2016 00:36:46
by Danny Kim (Basic support level)
Joined: 02/25/2016
Posts: 4

Thanks for the reply.
I'm sorry buy I said a mistake. I mean..

How to, Don't write the data to the registry, without sending a error.
When I do nothing at PreOpSampleSetValueKeyEvent, the data will be saved to the registry.
I don't want the data to be writed to the registry, without sending error messages.
Is is possible to do like this?

Posted: 02/29/2016 03:33:15
by Volodymyr Zinin (EldoS Corp.)

There is the Processed parameter. Set it to TRUE. I.e.
*Processed = TRUE;

BTW in order to see what requests come to the registry (and to the callbacks too) use Process Monitor from Microsoft.
Posted: 03/02/2016 04:41:58
by Danny Kim (Basic support level)
Joined: 02/25/2016
Posts: 4

*Processed = TRUE;
<- This was useful. Thanks.

I have another question.

In PreOpSamplePreQueryValueKeyEvent, [time] Value returns current time, like 11:22:33(8 letters)
The original value in the registry is 'any data'(also 8 letters)
If I return the value as longer than 8 letters(like PM11:22:33) regedit.exe returns an error, and the value doesn't come out.

Is there a way to return the value larger than the original value in the registry?

Posted: 03/02/2016 05:16:05
by Volodymyr Zinin (EldoS Corp.)

Perhaps the only way to workaround it is to change the value type in the OnPreEnumerateValueKey or OnPostEnumerateValueKey callback in order to make the value size to be more than 8 letters.
Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.



Topic viewed 3215 times



Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!