I'm stuck, and I need help from anyone who might have experience with
the NetUse* apis or with RegConnectRegistry.
I'm trying to connect to a specially stripped-down version of Windows NT
4 on a workgroup, to edit its registry remotely so that I can come up
with an administration tool for our embedded system.
There's some weird behavior involved, however.
For a connect using RegEdit to succeed, I need to have used "NET USE
\\servername password /USER:servername\Administrator" to create the
\\servername\IPC$ connection. Regardless of whether I provide the
correct logon details in the RegEdit credentials-request dialog, this
step needs to happen first before it will work.
I'm slightly confused as to why this would be the case, but my guess is
that this is some form of legacy method for providing credentials --
certainly, there doesn't seem to be much (if any) info out there
regarding this on MSDN.
In code, I've tried something similar; I call RevertToSelf, then
LogonUser with the appropriate info (Administrator, password,
servername), get the security token, and then impersonate the account,
and call RegConnectRegistry.
This works, right up until I try to open a registry key with
STANDARD_RIGHTS_READ | KEY_QUERY_VALUE | STANDARD_RIGHTS_WRITE |
KEY_SET_VALUE as the SAM parameter. At which point, I get told that I
don't have permission to access it.
So then I tried to use NetUseAdd to connect to the machine. This API
appears to be half-broken; the documentation says that it's a
unicode-only function, but the API headers itself (at least in the
latest SDKs) are of the form LPTSTR instead of LPWSTR. Either way, when
I call the API using USE_INFO_1, I get an error stating that my Remote
parameter is wrong.
I've now tried this with \\servername, \\servername\, and
\\servername\IPC$ -- none of them work.
Does anyone have any ideas as to what I'm doing wrong? Or if there's a
different way to get RegConnectRegistry permissions that I'm just not
getting right?
Thanks,
Simon
"Simon Cooke" <simon...@earthlink.net> wrote in message
news:eBR8t$uoCHA.1628@TK2MSFTNGP12...
Simon
arkadyf <ark...@hotmail.com> scribbled:
--
Looking for an accomplished Win32 developer to work on your project in
the Seattle area? Please check out my resume and portfolio:
http://home.earthlink.net/~simoncooke/resume.htm ;
http://home.earthlink.net/~simoncooke/portfolio.htm
http://home.earthlink.net/~simoncooke/otherhistory.htm Experienced in
UI development and design, applications architecture, and shipping
projects on time and on budget.