AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

GetDriveType and DRIVE_REMOTE

Ein Thema von user · begonnen am 17. Jan 2011 · letzter Beitrag vom 17. Jan 2011
Antwort Antwort
user

Registriert seit: 13. Jul 2010
25 Beiträge
 
Delphi 2 Desktop
 
#1

GetDriveType and DRIVE_REMOTE

  Alt 17. Jan 2011, 04:06
I want to list all networks drives in a PC. My current code to list local drive is GetDriveType. So I look at MSDN.

From MSDN, if the return value of GetDriveType is 4, that means DRIVE_REMOTE (The drive is a remote (network) drive)

The problem is GetDriveType can not retrieve the network drive. Here my way to produce a network drive (Win 7) : Open Network, Select a shared folder and choose map network drive.. then there will be a new drive in Window Explorer.

I know there are another API to list network drive. My question is, Does GetDriveType can not detect mapped network drive? If yes, that means mapped network drive is different with remote (network) drive?
  Mit Zitat antworten Zitat
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#2

AW: GetDriveType and DRIVE_REMOTE

  Alt 17. Jan 2011, 07:45
There is nothing wrong with GetDriveType(), if you are dealing with connected network drives.
If you are looking for remembered network drives too, have a look at WNetOpenEnum().
  Mit Zitat antworten Zitat
user

Registriert seit: 13. Jul 2010
25 Beiträge
 
Delphi 2 Desktop
 
#3

AW: GetDriveType and DRIVE_REMOTE

  Alt 17. Jan 2011, 09:06
GetDriveType works fine to get the network drive in XP.

I got this link

Zitat:
When UAC is enabled, administrators without elevation and administrators
with elevation are treated as different users. If the network mapped drives
were created by an admin without elevation, only that admin (without
elevation) can use the mapped drive and get the right drive type from
GetDriveType. This explains why GetDriveType returns DRIVE_NO_ROOT_DIR when
the application is elevated.
What is "admin without elevation" ?

FYI, my app use elevation and I uses admin account when mapping drive.
  Mit Zitat antworten Zitat
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#4

AW: GetDriveType and DRIVE_REMOTE

  Alt 17. Jan 2011, 18:37
Sorry for not noticing your mention of WIN7. My remarks were aimed at the pre-Vista world.

Zitat von user:
What is "admin without elevation" ?
Elevation - or User Account Control - is all about privileges and is tied to processes, not users. The support engineer you are quoting just failed in rewording the referenced knowledge base article, if I am to judge, so don't bother with "admin without elevation" too long.

Better you stick to the knowlege base article. It explains quite good, why you get DRIVE_NO_ROOT_DIR instead of DRIVE_REMOTE as a result from GetDriveType(). This is what you are experiencing, I understand.
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:33 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz