System Name from Driver

Hello,

What is the correct way to get the system name on a windows system from a
driver?

Thanks,
-Raj P.

From a service, or from the registry where you put it. In general drivers
don’t need to know the system name.

Mark Roddy

On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan <
xxxxx@gmail.com> wrote:

Hello,

What is the correct way to get the system name on a windows system from a
driver?

Thanks,
-Raj P.
— NTDEV is sponsored by OSR OSR is HIRING!! See
http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

In my case, I do need some unique identifier of a windows system which I
thought computer name would be unique as long as in the same domain.

If you could provide bit more detail to get the system name (or any other
unique system identifier) would be helpful.

thanks,
-Raj P.

On Tue, Feb 12, 2013 at 8:58 AM, Mark Roddy wrote:

> From a service, or from the registry where you put it. In general drivers
> don’t need to know the system name.
>
> Mark Roddy
>
>
> On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan <
> xxxxx@gmail.com> wrote:
>
>> Hello,
>>
>> What is the correct way to get the system name on a windows system from a
>> driver?
>>
>> Thanks,
>> -Raj P.
>> — NTDEV is sponsored by OSR OSR is HIRING!! See
>> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>> the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>
>
> — NTDEV is sponsored by OSR OSR is HIRING!! See
> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

You are assuming one network / NIC that is global to the machine. A machine can be multi homed on multiple network (types). Why do you need a unique id?

d

From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Rajinikanth Pandurangan
Sent: Tuesday, February 12, 2013 9:44 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] System Name from Driver

In my case, I do need some unique identifier of a windows system which I thought computer name would be unique as long as in the same domain.

If you could provide bit more detail to get the system name (or any other unique system identifier) would be helpful.

thanks,
-Raj P.
On Tue, Feb 12, 2013 at 8:58 AM, Mark Roddy > wrote:
From a service, or from the registry where you put it. In general drivers don’t need to know the system name.

Mark Roddy

On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan > wrote:
Hello,

What is the correct way to get the system name on a windows system from a driver?

Thanks,
-Raj P.
— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Rajinikanth Pandurangan wrote:

In my case, I do need some unique identifier of a windows system which
I thought computer name would be unique as long as in the same domain.

The computer name is easily changed.

If you could provide bit more detail to get the system name (or any
other unique system identifier) would be helpful.

Unique for how long? Is this for copy protection? If so, you’ll do
nothing but piss off your good customers. How will you handle VMs?
What if my hard drive goes bad and I need to rebuild? Do I have to
throw out your product? What if I move the hard drive to another
machine? What if I clone it using something like Ghost?

Any solution that seems to require a unique identifier is hosed from the
start.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

I agree with Doron, in that that you should explain why you need this
since the need is pretty rare. If you are going to do it, have you
looked at ExUuidCreate, and RtlStringFromGUID?

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Doron Holan” wrote in message
news:xxxxx@ntdev:

> You are assuming one network / NIC that is global to the machine. A machine can be multi homed on multiple network (types). Why do you need a unique id?
>
> d
>
> From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Rajinikanth Pandurangan
> Sent: Tuesday, February 12, 2013 9:44 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] System Name from Driver
>
>
> In my case, I do need some unique identifier of a windows system which I thought computer name would be unique as long as in the same domain.
>
> If you could provide bit more detail to get the system name (or any other unique system identifier) would be helpful.
>
> thanks,
> -Raj P.
> On Tue, Feb 12, 2013 at 8:58 AM, Mark Roddy > wrote:
> From a service, or from the registry where you put it. In general drivers don’t need to know the system name.
>
> Mark Roddy
>
> On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan > wrote:
> Hello,
>
> What is the correct way to get the system name on a windows system from a driver?
>
> Thanks,
> -Raj P.
> — NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
> — NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer
>
> — NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Here is my situation:

Let’s say device D1 in system M1 and device D2 in system M2. My driver on
each system would store UuID of the system in its device.
If some moved D1 into M2, my driver should be able to identify it’s native
device, in this case it’s D2.

Thanks,
-Raj P

On Tue, Feb 12, 2013 at 10:13 AM, Don Burn wrote:

> I agree with Doron, in that that you should explain why you need this
> since the need is pretty rare. If you are going to do it, have you looked
> at ExUuidCreate, and RtlStringFromGUID?
>
>
> Don Burn
> Windows Filesystem and Driver Consulting
> Website: http://www.windrvr.com
> Blog: http://msmvps.com/blogs/**WinDrvr http:
>
>
>
>
> “Doron Holan” wrote in message
> news:xxxxx@ntdev:
>
> You are assuming one network / NIC that is global to the machine. A
>> machine can be multi homed on multiple network (types). Why do you need a
>> unique id?
>>
>> d
>>
>> From: xxxxx@lists.osr.**com[mailto:
>> bounce-526272-26293@lists.osr.com ]
>> On Behalf Of Rajinikanth Pandurangan
>> Sent: Tuesday, February 12, 2013 9:44 AM
>> To: Windows System Software Devs Interest List
>> Subject: Re: [ntdev] System Name from Driver
>>
>>
>> In my case, I do need some unique identifier of a windows system which I
>> thought computer name would be unique as long as in the same domain.
>>
>> If you could provide bit more detail to get the system name (or any other
>> unique system identifier) would be helpful.
>>
>> thanks,
>> -Raj P.
>>
>> On Tue, Feb 12, 2013 at 8:58 AM, Mark Roddy >> m
xxxxx@hollistech.com >> wrote:
>> From a service, or from the registry where you put it. In general drivers
>> don’t need to know the system name.
>>
>> Mark Roddy
>>
>> On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan <
>> xxxxx@gmail.com< mailto:xxxxx@gmail.com >> wrote:
>> Hello,
>>
>> What is the correct way to get the system name on a windows system from a
>> driver?
>>
>> Thanks,
>> -Raj P.
>> — NTDEV is sponsored by OSR OSR is HIRING!! See
>> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>> the List Server section of OSR Online at http://www.osronline.com/page.
>> cfm?name=ListServer http:
>>
>> — NTDEV is sponsored by OSR OSR is HIRING!! See
>> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>> the List Server section of OSR Online at http://www.osronline.com/page.

>> cfm?name=ListServer http:
>>
>> — NTDEV is sponsored by OSR OSR is HIRING!! See
>> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>> the List Server section of OSR Online at http://www.osronline.com/page.
>> cfm?name=ListServer http:
>>
>
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.
cfm?name=ListServerhttp:
></http:></http:></http:></http:></http:>

Why?

d

debt from my phone


From: Rajinikanth Pandurangan
Sent: 2/12/2013 3:45 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] System Name from Driver

Here is my situation:

Let’s say device D1 in system M1 and device D2 in system M2. My driver on each system would store UuID of the system in its device.
If some moved D1 into M2, my driver should be able to identify it’s native device, in this case it’s D2.

Thanks,
-Raj P

On Tue, Feb 12, 2013 at 10:13 AM, Don Burn > wrote:
I agree with Doron, in that that you should explain why you need this since the need is pretty rare. If you are going to do it, have you looked at ExUuidCreate, and RtlStringFromGUID?

Don Burn
Windows Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr

“Doron Holan” > wrote in message news:xxxxx@ntdev:

You are assuming one network / NIC that is global to the machine. A machine can be multi homed on multiple network (types). Why do you need a unique id?

d

From: xxxxx@lists.osr.commailto:xxxxx [mailto:xxxxx@lists.osr.commailto:xxxxx] On Behalf Of Rajinikanth Pandurangan
Sent: Tuesday, February 12, 2013 9:44 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] System Name from Driver

In my case, I do need some unique identifier of a windows system which I thought computer name would be unique as long as in the same domain.

If you could provide bit more detail to get the system name (or any other unique system identifier) would be helpful.

thanks,
-Raj P.

On Tue, Feb 12, 2013 at 8:58 AM, Mark Roddy mailto:xxxxx>> wrote:
From a service, or from the registry where you put it. In general drivers don’t need to know the system name.

Mark Roddy

On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan mailto:xxxxx>> wrote:
Hello,

What is the correct way to get the system name on a windows system from a driver?

Thanks,
-Raj P.
— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

— NTDEV is sponsored by OSR OSR is HIRING!! See http://www.osr.com/careers For our schedule of WDF, WDM, debugging and other seminars visit: http://www.osr.com/seminars To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer</mailto:xxxxx></mailto:xxxxx></mailto:xxxxx></mailto:xxxxx>

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\ComputerName\ActiveComputerName

value name = ComputerName type REG_SZ

------ Original Message ------
From: “Rajinikanth Pandurangan”
To: “Windows System Software Devs Interest List”
Sent: 13/02/2013 12:44:35 p.m.
Subject: Re: [ntdev] System Name from Driver
>Here is my situation:
>
>Let’s say device D1 in system M1 and device D2 in system M2. My driver
>on each system would store UuID of the system in its device.
>If some moved D1 into M2, my driver should be able to identify it’s
>native device, in this case it’s D2.
>
>Thanks,
>-Raj P
>
>
>
>On Tue, Feb 12, 2013 at 10:13 AM, Don Burn wrote:
>>I agree with Doron, in that that you should explain why you need this
>>since the need is pretty rare. If you are going to do it, have you
>>looked at ExUuidCreate, and RtlStringFromGUID?
>>
>>
>>Don Burn
>>Windows Filesystem and Driver Consulting
>>Website: http://www.windrvr.com
>>Blog: http://msmvps.com/blogs/WinDrvr
>>
>>
>>
>>
>>“Doron Holan” wrote in message
>>news:xxxxx@ntdev:
>>
>>>You are assuming one network / NIC that is global to the machine. A
>>>machine can be multi homed on multiple network (types). Why do you
>>>need a unique id?
>>>
>>>d
>>>
>>>From: xxxxx@lists.osr.com
>>>[mailto:xxxxx@lists.osr.com] On Behalf Of Rajinikanth
>>>Pandurangan
>>>Sent: Tuesday, February 12, 2013 9:44 AM
>>>To: Windows System Software Devs Interest List
>>>Subject: Re: [ntdev] System Name from Driver
>>>
>>>
>>>In my case, I do need some unique identifier of a windows system
>>>which I thought computer name would be unique as long as in the same
>>>domain.
>>>
>>>If you could provide bit more detail to get the system name (or any
>>>other unique system identifier) would be helpful.
>>>
>>>thanks,
>>>-Raj P.
>>>
>>>On Tue, Feb 12, 2013 at 8:58 AM, Mark Roddy
>>>> wrote:
>>>From a service, or from the registry where you put it. In general
>>>drivers don’t need to know the system name.
>>>
>>>Mark Roddy
>>>
>>>On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan
>>>> wrote:
>>>Hello,
>>>
>>>What is the correct way to get the system name on a windows system
>>>from a driver?
>>>
>>>Thanks,
>>>-Raj P.
>>>— NTDEV is sponsored by OSR OSR is HIRING!! See
>>>http://www.osr.com/careers For our schedule of WDF, WDM, debugging
>>>and other seminars visit: http://www.osr.com/seminars To unsubscribe,
>>>visit the List Server section of OSR Online at
>>>http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>— NTDEV is sponsored by OSR OSR is HIRING!! See
>>>http://www.osr.com/careers For our schedule of WDF, WDM, debugging
>>>and other seminars visit: http://www.osr.com/seminars To unsubscribe,
>>>visit the List Server section of OSR Online at
>>>http://www.osronline.com/page.cfm?name=ListServer
>>>
>>>— NTDEV is sponsored by OSR OSR is HIRING!! See
>>>http://www.osr.com/careers For our schedule of WDF, WDM, debugging
>>>and other seminars visit: http://www.osr.com/seminars To unsubscribe,
>>>visit the List Server section of OSR Online at
>>>http://www.osronline.com/page.cfm?name=ListServer
>>
>>
>>—
>>NTDEV is sponsored by OSR
>>
>>OSR is HIRING!! See http://www.osr.com/careers
>>
>>For our schedule of WDF, WDM, debugging and other seminars visit:
>>http://www.osr.com/seminars
>>
>>To unsubscribe, visit the List Server section of OSR Online at
>>http://www.osronline.com/page.cfm?name=ListServer
>
>— NTDEV is sponsored by OSR OSR is HIRING!! See
>http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>the List Server section of OSR Online at
>http://www.osronline.com/page.cfm?name=ListServer

We would like to give some preference for the native device when comes to
resource allocation for the devices.

On Tue, Feb 12, 2013 at 3:57 PM, Doron Holan wrote:

> Why?
>
> d
>
> debt from my phone
> ------------------------------
> From: Rajinikanth Pandurangan
> Sent: 2/12/2013 3:45 PM
>
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] System Name from Driver
>
> Here is my situation:
>
> Let’s say device D1 in system M1 and device D2 in system M2. My driver
> on each system would store UuID of the system in its device.
> If some moved D1 into M2, my driver should be able to identify it’s native
> device, in this case it’s D2.
>
> Thanks,
> -Raj P
>
>
>
> On Tue, Feb 12, 2013 at 10:13 AM, Don Burn wrote:
>
>> I agree with Doron, in that that you should explain why you need this
>> since the need is pretty rare. If you are going to do it, have you looked
>> at ExUuidCreate, and RtlStringFromGUID?
>>
>>
>> Don Burn
>> Windows Filesystem and Driver Consulting
>> Website: http://www.windrvr.com
>> Blog: http://msmvps.com/blogs/**WinDrvr http:
>>
>>
>>
>>
>> “Doron Holan” wrote in message
>> news:xxxxx@ntdev:
>>
>> You are assuming one network / NIC that is global to the machine. A
>>> machine can be multi homed on multiple network (types). Why do you need a
>>> unique id?
>>>
>>> d
>>>
>>> From: xxxxx@lists.osr.**com[mailto:
>>> bounce-526272-26293@**lists.osr.com ]
>>> On Behalf Of Rajinikanth Pandurangan
>>> Sent: Tuesday, February 12, 2013 9:44 AM
>>> To: Windows System Software Devs Interest List
>>> Subject: Re: [ntdev] System Name from Driver
>>>
>>>
>>> In my case, I do need some unique identifier of a windows system which
>>> I thought computer name would be unique as long as in the same domain.
>>>
>>> If you could provide bit more detail to get the system name (or any
>>> other unique system identifier) would be helpful.
>>>
>>> thanks,
>>> -Raj P.
>>>
>>> On Tue, Feb 12, 2013 at 8:58 AM, Mark Roddy >>> mailto:m>> wrote:
>>> From a service, or from the registry where you put it. In general
>>> drivers don’t need to know the system name.
>>>
>>> Mark Roddy
>>>
>>> On Tue, Feb 12, 2013 at 10:11 AM, Rajinikanth Pandurangan <
>>> xxxxx@gmail.com<**mailto:xxxxx@gmail.com *>> wrote:
>>> Hello,
>>>
>>> What is the correct way to get the system name on a windows system from
>>> a driver?
>>>
>>> Thanks,
>>> -Raj P.
>>> — NTDEV is sponsored by OSR OSR is HIRING!! See
>>> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>>> the List Server section of OSR Online at http://www.osronline.com/page.*
>>> cfm?name=ListServer http:
>>>
>>> — NTDEV is sponsored by OSR OSR is HIRING!! See
>>> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>>> the List Server section of OSR Online at http://www.osronline.com/page.

>>> cfm?name=ListServer http:
>>>
>>> — NTDEV is sponsored by OSR OSR is HIRING!! See
>>> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
>>> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
>>> the List Server section of OSR Online at http://www.osronline.com/page.

>>> cfm?name=ListServer http:
>>>
>>
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.
cfm?name=ListServerhttp:
>>
>
> — NTDEV is sponsored by OSR OSR is HIRING!! See
> http://www.osr.com/careers For our schedule of WDF, WDM, debugging and
> other seminars visit: http://www.osr.com/seminars To unsubscribe, visit
> the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
></http:></http:></http:></http:></mailto:m></http:>

Each time my driver starts, I would look for a GUID in the Registry (perhaps under my device key).

The first time my driver loads for the device, or even during installation, I would generate a GUID and store that GUID in the Registry. I would also store this GUID on the device.

After the first time, if you find the GUID in the Registry, you simply compare that to the one stored in your device. If it matches… the device is on its “home” system. If it does not match, the device has been moved.

Does that not meet your needs? It’s WAAAAY better than trying to use the system name, which is subject to change without notice,

Peter
OSR

Rajinikanth Pandurangan wrote:

We would like to give some preference for the native device when comes
to resource allocation for the devices.

The notion of “native device” seems completely foreign. I’m having a
really hard time envisioning a use case that doesn’t go pear-shaped
really quickly.

Let’s say your device is a FancyMouse. I have two of them, plugged into
two different systems. Now, you unplug FM from system #1 and plug it in
to system #2. How will you tell the difference between them? Why is
one of them “native”? Let’s say I now reboot. Are they both now
“native”? Why not? What if I swap the two devices, so that FM #2 is
plugged into machine #1, and FM #1 is plugged into machine #2. Now who
is “native”?

I think your concept is flawed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

i, too, wondered about what a “native device” is, and furthermore, how
could the hypothesized “system ID” be used to identify it? And what does
“preference” mean? It means limiting some other device when it asks for
the unidentified “resources”. And what “resources” would a device eed?
Interrupt vectors? PCI bridge ranges? How is the PCI BIOS going to learn
about tbe “native” device? Memory? How is the allocator going to know
that some file system filter is aking for memory but tbe device seven
levels below it is a “non-native” device? Does the OP have an example in
which any of this matters, or is this just an attempt to solve a
nonexistent problem?
joe

Rajinikanth Pandurangan wrote:
> We would like to give some preference for the native device when comes
> to resource allocation for the devices.

The notion of “native device” seems completely foreign. I’m having a
really hard time envisioning a use case that doesn’t go pear-shaped
really quickly.

Let’s say your device is a FancyMouse. I have two of them, plugged into
two different systems. Now, you unplug FM from system #1 and plug it in
to system #2. How will you tell the difference between them? Why is
one of them “native”? Let’s say I now reboot. Are they both now
“native”? Why not? What if I swap the two devices, so that FM #2 is
plugged into machine #1, and FM #1 is plugged into machine #2. Now who
is “native”?

I think your concept is flawed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

Yes, this sounds better. Thanks Pete and All. By the way there are couple
of reasons for us know whether a device is native/migrated.

  1. We want to log this info about the Migrated device for customer to
    review. (As RAID controller does it today)
  2. Currently our driver has some limitation so we just want handle Native
    devices for now. - Of course, this limitation can be removed but still
    knowing the difference is always good in our case.

Once again, Many Thanks to all.
-Raj P

On Wed, Feb 13, 2013 at 6:29 AM, wrote:

> Each time my driver starts, I would look for a GUID in the Registry
> (perhaps under my device key).
>
> The first time my driver loads for the device, or even during
> installation, I would generate a GUID and store that GUID in the Registry.
> I would also store this GUID on the device.
>
> After the first time, if you find the GUID in the Registry, you simply
> compare that to the one stored in your device. If it matches… the device
> is on its “home” system. If it does not match, the device has been moved.
>
> Does that not meet your needs? It’s WAAAAY better than trying to use the
> system name, which is subject to change without notice,
>
> Peter
> OSR
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

Why not use something that uniquely identifies the device instead of the host, and store that device identifier in the registry. If it’s a storage device, the SN or NAA are generally unique.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, February 13, 2013 9:42 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] System Name from Driver

Rajinikanth Pandurangan wrote:

We would like to give some preference for the native device when comes
to resource allocation for the devices.

The notion of “native device” seems completely foreign. I’m having a really hard time envisioning a use case that doesn’t go pear-shaped really quickly.

Let’s say your device is a FancyMouse. I have two of them, plugged into two different systems. Now, you unplug FM from system #1 and plug it in to system #2. How will you tell the difference between them? Why is one of them “native”? Let’s say I now reboot. Are they both now “native”? Why not? What if I swap the two devices, so that FM #2 is plugged into machine #1, and FM #1 is plugged into machine #2. Now who is “native”?

I think your concept is flawed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Yes, I agree. But there might be more than one devices and wanted to have
a single UID to cover all, so I think Peter’s suggestion sounds better for
my case.

Thanks!

On Wed, Feb 13, 2013 at 12:40 PM, Speer, Kenny wrote:

> Why not use something that uniquely identifies the device instead of the
> host, and store that device identifier in the registry. If it’s a storage
> device, the SN or NAA are generally unique.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com [mailto:
> xxxxx@lists.osr.com] On Behalf Of Tim Roberts
> Sent: Wednesday, February 13, 2013 9:42 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] System Name from Driver
>
> Rajinikanth Pandurangan wrote:
> > We would like to give some preference for the native device when comes
> > to resource allocation for the devices.
>
> The notion of “native device” seems completely foreign. I’m having a
> really hard time envisioning a use case that doesn’t go pear-shaped really
> quickly.
>
> Let’s say your device is a FancyMouse. I have two of them, plugged into
> two different systems. Now, you unplug FM from system #1 and plug it in to
> system #2. How will you tell the difference between them? Why is one of
> them “native”? Let’s say I now reboot. Are they both now “native”? Why
> not? What if I swap the two devices, so that FM #2 is plugged into machine
> #1, and FM #1 is plugged into machine #2. Now who is “native”?
>
> I think your concept is flawed.
>
> –
> Tim Roberts, xxxxx@probo.com
> Providenza & Boekelheide, Inc.
>
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>

The problem is that this presunes all devices have user-writeable storage
that can be used for end-user puposes and can hold at least a GUID, or,
alternatively, as a serial number or other unique ID that can be read.
Otherwise, a driver which is loaded has no way to tell a “native” device
from any other device.

Furthermore, the original question was irrelevant. And the correction was
equally irrelevant. The REAL question now appears to be, "how can I
detect if a new device, not on the approved-for-this-computer list, is now
connected? Of course, this is completely inadequate from a security
viewpoint; I could compromise the driver, or add a filter driver. So, in
the absence of a properly-formed question, I still see no usable answer
except in a few very limited special cases.

Perhaps the OP can ask the right question, and increase the probability of
getting either a useful answer or an answer that definitively says “can’t
be done”, which coud save months of agony and ultimate heartbreak (not to
mention job loss for having promised to accomplish the impossible, and
failing to deliver a usable solution).

Oh, yes, and if the device has writeable storage, what’s to stop me from
having installed in its driver a handler for the undocumented IOCTL
“please download the code I stored in the device?” And only a few
customers are shipped the devices that have the rootkit installed in the
device…

joe

Yes, this sounds better. Thanks Pete and All. By the way there are couple
of reasons for us know whether a device is native/migrated.

  1. We want to log this info about the Migrated device for customer to
    review. (As RAID controller does it today)
  2. Currently our driver has some limitation so we just want handle Native
    devices for now. - Of course, this limitation can be removed but still
    knowing the difference is always good in our case.

Once again, Many Thanks to all.
-Raj P

On Wed, Feb 13, 2013 at 6:29 AM, wrote:
>
>> Each time my driver starts, I would look for a GUID in the Registry
>> (perhaps under my device key).
>>
>> The first time my driver loads for the device, or even during
>> installation, I would generate a GUID and store that GUID in the
>> Registry.
>> I would also store this GUID on the device.
>>
>> After the first time, if you find the GUID in the Registry, you simply
>> compare that to the one stored in your device. If it matches… the
>> device
>> is on its “home” system. If it does not match, the device has been
>> moved.
>>
>> Does that not meet your needs? It’s WAAAAY better than trying to use
>> the
>> system name, which is subject to change without notice,
>>
>> Peter
>> OSR
>>
>> —
>> NTDEV is sponsored by OSR
>>
>> OSR is HIRING!! See http://www.osr.com/careers
>>
>> For our schedule of WDF, WDM, debugging and other seminars visit:
>> http://www.osr.com/seminars
>>
>> To unsubscribe, visit the List Server section of OSR Online at
>> http://www.osronline.com/page.cfm?name=ListServer
>>
>
> —
> NTDEV is sponsored by OSR
>
> OSR is HIRING!! See http://www.osr.com/careers
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer

> Why not use something that uniquely identifies the device instead of the

host, and store that device identifier in the registry. If it’s a storage
device, the SN or NAA are generally unique.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Tim Roberts
Sent: Wednesday, February 13, 2013 9:42 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] System Name from Driver

Rajinikanth Pandurangan wrote:
> We would like to give some preference for the native device when comes
> to resource allocation for the devices.

As I pointed out, this criterion makes no sense. What “resource” is being
managed?. How can you tell if a “resource” is being allocated for a
“native” device? Is there an existing example of a situation in which the
allocation of the undefined concept of “resource” to a “non-native” device
precluded the operation of a “native” device? How does the system know
that it needs to not allocate some undefined “resource” because the
allocation of this “resource” will interfere with some future “resource”
need of a “native” device?

Or, more to the point, why is what appears to be a noexistent problem
require any solution at all, let alone the complex ones being
contemplated?

In the absence of any meaningful definition of “resource”, it is hard to
imagine what “management” of such “resources” could mean. It is even hard
to imagine what kind of “limitation” could exist in a driver that allows
it to work only with “native” devices, other than misuse of global and
static variables that means only one instance of the driver can exist, and
the fix there is obvious, and vastly simpler than trying to introduce some
bizarre concept not supported by the OS.

It is not possible to give a meaningful answer to a question that morphs
every time it is asked.
joe

The notion of “native device” seems completely foreign. I’m having a
really hard time envisioning a use case that doesn’t go pear-shaped really
quickly.

Let’s say your device is a FancyMouse. I have two of them, plugged into
two different systems. Now, you unplug FM from system #1 and plug it in
to system #2. How will you tell the difference between them? Why is one
of them “native”? Let’s say I now reboot. Are they both now “native”?
Why not? What if I swap the two devices, so that FM #2 is plugged into
machine #1, and FM #1 is plugged into machine #2. Now who is “native”?

I think your concept is flawed.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

In UM, the API is GetComputerObjectName with NameUniqueId. I have no ideal if there is a KM equivalent as I have never had a requirement to look. I assume that you want to implement something like the ‘import foreign disk’ option. If that is correct, it is probably best to record the state of a particular device on the host rather than recording the ‘home’ host on the device. To do this, simply store something unique about the device in the registry, and have a second list of ‘accepted’ devices. Your driver can disable the device if it is not on the second list, and the UM tool you use to ‘import’ the device can update it
“Rajinikanth Pandurangan” wrote in message news:xxxxx@ntdev…
Yes, this sounds better. Thanks Pete and All. By the way there are couple of reasons for us know whether a device is native/migrated.

1. We want to log this info about the Migrated device for customer to review. (As RAID controller does it today)
2. Currently our driver has some limitation so we just want handle Native devices for now. - Of course, this limitation can be removed but still knowing the difference is always good in our case.

Once again, Many Thanks to all.
-Raj P

On Wed, Feb 13, 2013 at 6:29 AM, wrote:

Each time my driver starts, I would look for a GUID in the Registry (perhaps under my device key).

The first time my driver loads for the device, or even during installation, I would generate a GUID and store that GUID in the Registry. I would also store this GUID on the device.

After the first time, if you find the GUID in the Registry, you simply compare that to the one stored in your device. If it matches… the device is on its “home” system. If it does not match, the device has been moved.

Does that not meet your needs? It’s WAAAAY better than trying to use the system name, which is subject to change without notice,

Peter
OSR


NTDEV is sponsored by OSR

OSR is HIRING!! See http://www.osr.com/careers

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Given the vague description of this device, it seems to be a “licensing”
dongle
which helps to detect “migration” of some software (with the dongle) to
other machines.
If so, generating the ID and storing it in the registry will work only until
the users find it and learn how to copy it :slight_smile:
– pa

“m” wrote in message news:xxxxx@ntdev…
> In UM, the API is GetComputerObjectName with NameUniqueId. I have no
> ideal if there is a KM equivalent as I have never had a requirement to
> look. I assume that you want to implement something like the ‘import
> foreign disk’ option. If that is correct, it is probably best to record
> the state of a particular device on the host rather than recording the
> ‘home’ host on the device. To do this, simply store something unique
> about the device in the registry, and have a second list of ‘accepted’
> devices. Your driver can disable the device if it is not on the second
> list, and the UM tool you use to ‘import’ the device can update it
> “Rajinikanth Pandurangan” wrote in message
> news:xxxxx@ntdev…
> Yes, this sounds better. Thanks Pete and All. By the way there are couple
> of reasons for us know whether a device is native/migrated.
>
> 1. We want to log this info about the Migrated device for customer to
> review. (As RAID controller does it today)
> 2. Currently our driver has some limitation so we just want handle Native
> devices for now. - Of course, this limitation can be removed but still
> knowing the difference is always good in our case.
>
> Once again, Many Thanks to all.
> -Raj P
>
>
> On Wed, Feb 13, 2013 at 6:29 AM, wrote:
>
> Each time my driver starts, I would look for a GUID in the Registry
> (perhaps under my device key).
>
> The first time my driver loads for the device, or even during
> installation, I would generate a GUID and store that GUID in the Registry.
> I would also store this GUID on the device.
>
> After the first time, if you find the GUID in the Registry, you simply
> compare that to the one stored in your device. If it matches… the
> device is on its “home” system. If it does not match, the device has been
> moved.
>
> Does that not meet your needs? It’s WAAAAY better than trying to use the
> system name, which is subject to change without notice,
>
> Peter
> OSR
>
>