Why does call to Process.GetCurrentProcess() access the floppy drive?

K

Ken Varn

Everytime I call Process.GetCurrentProcess() the system goes out to the
floppy drive. Why does this happen. I decided to use FileMon to get a log
of what is happening when this occurs. Here is the log:

1 4:31:10 PM BlockedConfigAp:1340 IRP_MJ_CREATE A: DASD SUCCESS Attributes:
Any Options: Open
2 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_DEVICE_CONTROL A: DASD INVALID
DEVICE REQUEST IOCTL: 0x560000
3 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_CLEANUP A: DASD SUCCESS
4 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_CLOSE A: DASD SUCCESS

Can someone tell me how to prevent the floppy drive access from occurring
when this call is performed?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
(e-mail address removed)
-----------------------------------
 
W

Willy Denoyette [MVP]

Ken Varn wrote:
|| Everytime I call Process.GetCurrentProcess() the system goes out to
|| the floppy drive. Why does this happen. I decided to use FileMon
|| to get a log of what is happening when this occurs. Here is the log:
||
|| 1 4:31:10 PM BlockedConfigAp:1340 IRP_MJ_CREATE A: DASD SUCCESS
|| Attributes: Any Options: Open
|| 2 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_DEVICE_CONTROL A: DASD
|| INVALID DEVICE REQUEST IOCTL: 0x560000
|| 3 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_CLEANUP A: DASD SUCCESS
|| 4 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_CLOSE A: DASD SUCCESS
||
|| Can someone tell me how to prevent the floppy drive access from
|| occurring when this call is performed?
||
|| --
|| -----------------------------------
|| Ken Varn
|| Senior Software Engineer
|| Diebold Inc.
|| (e-mail address removed)
|| -----------------------------------

No floppy access when I call GetCurrentProcess() on XP and W2k3.
Are you sure this happens when calling GetCurrentProcess()? What OS version, version of the framework are you running on?

Willy.
 
K

Ken Varn

I am running .NET Framework 1.1.4322. on a Windows 2000 Pro machine with SP4
on it.

Since my function is calling Process.GetCurrentProcess().ProcessName, it
could be happening on the ProcessName
property call, but it is definitely happening on either GetCurrentProcess or
GetCurrentProcess.ProcessName.



--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
(e-mail address removed)
-----------------------------------
Willy Denoyette said:
Ken Varn wrote:
|| Everytime I call Process.GetCurrentProcess() the system goes out to
|| the floppy drive. Why does this happen. I decided to use FileMon
|| to get a log of what is happening when this occurs. Here is the log:
||
|| 1 4:31:10 PM BlockedConfigAp:1340 IRP_MJ_CREATE A: DASD SUCCESS
|| Attributes: Any Options: Open
|| 2 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_DEVICE_CONTROL A: DASD
|| INVALID DEVICE REQUEST IOCTL: 0x560000
|| 3 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_CLEANUP A: DASD SUCCESS
|| 4 4:31:11 PM BlockedConfigAp:1340 IRP_MJ_CLOSE A: DASD SUCCESS
||
|| Can someone tell me how to prevent the floppy drive access from
|| occurring when this call is performed?
||
|| --
|| -----------------------------------
|| Ken Varn
|| Senior Software Engineer
|| Diebold Inc.
|| (e-mail address removed)
|| -----------------------------------

No floppy access when I call GetCurrentProcess() on XP and W2k3.
Are you sure this happens when calling GetCurrentProcess()? What OS
version, version of the framework are you running on?
 
P

Peter Davidson [MS]

Ken,

I can answer why this happens.

Internally the current 1.0 and 1.1 frameworks call performance counters as
part of the Process object. As the perf system initializes, it will load
in various perf objects. When the disk object loads, it will enumerate the
known disks (this is Windows 2000). The disk performance counters changed
between Windows 2000 and XP (2k3).

This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

John Eikanger [MSFT]

hi, Ken

Peter asked me to follow up with you.. There is no supported way to do
this on Win2K. If you want to try something speculative, you can disable
the disk perf counters.
HKLM\SYSTEM\CurrentControlSet\Services\Perfdisk\performance

Add a DWORD value called "Disable Performance Counters" and set it to 1.
No disk monitoring will work now. But their perf will increase.

To reenable these counters, you should delete the key, or set it to 0

This is an ugly, ugly solution, and we do NOT recommend using it. A better
solution would be to physically disconnect the floppy drive, given how
rarely they are used these days.

Please get back to me if you have further questions.

HTH,

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
(c) 2003 Microsoft Corporation. All rights reserved.
--------------------
| Reply-To: "Ken Varn" <[email protected]>
| From: "Ken Varn" <[email protected]>
| References: <urJD5w#[email protected]>
<epIne8#[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Why does call to Process.GetCurrentProcess() access the
floppy drive?
| Date: Tue, 15 Jul 2003 12:33:48 -0400
| Lines: 30
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Is there anyway to configure Win 2000 so that it does not go to the floppy
| drive for performance counters? This really kills application performance
| when the floppy drive is accessed.
|
| --
| -----------------------------------
| Ken Varn
| Senior Software Engineer
| Diebold Inc.
| (e-mail address removed)
| -----------------------------------
| | > Ken,
| >
| > I can answer why this happens.
| >
| > Internally the current 1.0 and 1.1 frameworks call performance counters
as
| > part of the Process object. As the perf system initializes, it will
load
| > in various perf objects. When the disk object loads, it will enumerate
| the
| > known disks (this is Windows 2000). The disk performance counters
| changed
| > between Windows 2000 and XP (2k3).
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| >
|
|
|
 
K

Ken Varn

Thanks. That seems to work.

I would think that disconnecting the floppy drive is a much uglier solution
than disabling disk performance counters.

--
 
J

John Eikanger [MSFT]

Hi, Ken

From a software perspective hacking the registry this way is like eating
your lunch over the PC motherboard. You REALLY want to do this as little
as possible.

Peter's recommendation is still don't do this. If you must do this, flip
this key value in code just before you call Process.GetCurrentProcess() and
restore it afterward. You do NOT want to leave perf counters disabled.
Make sure you check which OS you are using and only do this on Win2K. If
this is used on a limited set of machines, Get them upgraded to WinXP or
Win2k3 as soon as you can.

HTH,

John Eikanger
Microsoft Developer Support

This posting is provided “AS IS” with no warranties, and confers no rights.
(c) 2003 Microsoft Corporation. All rights reserved.
--------------------
| Reply-To: "Ken Varn" <[email protected]>
| From: "Ken Varn" <[email protected]>
| References: <urJD5w#[email protected]>
<epIne8#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Why does call to Process.GetCurrentProcess() access the
floppy drive?
| Date: Wed, 16 Jul 2003 10:40:29 -0400
| Lines: 94
| Organization: Diebold Inc.
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.general
| NNTP-Posting-Host: 204.151.249.23
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.general:101356
| X-Tomcat-NG: microsoft.public.dotnet.general
|
| Thanks. That seems to work.
|
| I would think that disconnecting the floppy drive is a much uglier
solution
| than disabling disk performance counters.
|
| --
| -----------------------------------
| Ken Varn
| Senior Software Engineer
| Diebold Inc.
| (e-mail address removed)
| -----------------------------------
| | > hi, Ken
| >
| > Peter asked me to follow up with you.. There is no supported way to do
| > this on Win2K. If you want to try something speculative, you can
disable
| > the disk perf counters.
| > HKLM\SYSTEM\CurrentControlSet\Services\Perfdisk\performance
| >
| > Add a DWORD value called "Disable Performance Counters" and set it to 1.
| > No disk monitoring will work now. But their perf will increase.
| >
| > To reenable these counters, you should delete the key, or set it to 0
| >
| > This is an ugly, ugly solution, and we do NOT recommend using it. A
| better
| > solution would be to physically disconnect the floppy drive, given how
| > rarely they are used these days.
| >
| > Please get back to me if you have further questions.
| >
| > HTH,
| >
| > John Eikanger
| > Microsoft Developer Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > (c) 2003 Microsoft Corporation. All rights reserved.
| > --------------------
| > | Reply-To: "Ken Varn" <[email protected]>
| > | From: "Ken Varn" <[email protected]>
| > | References: <urJD5w#[email protected]>
| > <epIne8#[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | Subject: Re: Why does call to Process.GetCurrentProcess() access the
| > floppy drive?
| > | Date: Tue, 15 Jul 2003 12:33:48 -0400
| > | Lines: 30
| > | X-Tomcat-NG: microsoft.public.dotnet.general
| > |
| > | Is there anyway to configure Win 2000 so that it does not go to the
| floppy
| > | drive for performance counters? This really kills application
| performance
| > | when the floppy drive is accessed.
| > |
| > | --
| > | -----------------------------------
| > | Ken Varn
| > | Senior Software Engineer
| > | Diebold Inc.
| > | (e-mail address removed)
| > | -----------------------------------
| > | | > | > Ken,
| > | >
| > | > I can answer why this happens.
| > | >
| > | > Internally the current 1.0 and 1.1 frameworks call performance
| counters
| > as
| > | > part of the Process object. As the perf system initializes, it will
| > load
| > | > in various perf objects. When the disk object loads, it will
| enumerate
| > | the
| > | > known disks (this is Windows 2000). The disk performance counters
| > | changed
| > | > between Windows 2000 and XP (2k3).
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | >
| > |
| > |
| > |
| >
|
|
|
 
K

Ken Varn

The Win2K install is on our own device hardware that we control. So
changing the registry is not a problem since we distribute both hardware and
software as a complete system.

It sounds like there is some other issue with disabling disk performance
counters. Is there some negative ramification in doing this? I know that
in Windows NT they were off by default. Is there some reason why they are
on by default in Win2K?

--
-----------------------------------
Ken Varn
Senior Software Engineer
Diebold Inc.
(e-mail address removed)
 
G

Gang Peng

This is a known bug which will be fixed in next release.
The reason is that Process is trying to get index for some performance
counters.

Thanks,
Gang Peng
[MS]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top