Autor Beitrag
mindtrap
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62



BeitragVerfasst: Mo 27.07.09 17:06 
Hallo,

meine Frage ist relativ "einfach".
Gibt es eine Methode, mit der ich erkennen kann, ob eine Partition sich verändert hat.
Will heißen, wenn z.B. eine Partition formatiert wurde etc.

MfG
mindtrap
R4id
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 28

Win XP Home, Win XP Prof.
D7 Prof., D2006 Arch., BCB2006 Arch.
BeitragVerfasst: Mo 27.07.09 17:11 
Belegter Speicher und Freier Speicher
mindtrap Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62



BeitragVerfasst: Mo 27.07.09 17:37 
Scheint, als hätte ich mich missverständlich ausgedrückt. :?

WM_DEVICECHANGE ist mein Schlagwort in diesem Fall.
Mit den Informationen, die man normalerweise erhält kann man einiges anfangen.
So z.B. auch erkennen, dass ein Volumen (gelöscht oder) neu angelegt wurde.

Mein Problem ist, dass ich zwar mit DBT_DEVICEARRIVAL feststellen kann, dass ein Volumen angelegt wurde,
aber:
Wenn ich sofort die Partitionsinformationen (Dateisystem, Freier Speicher, DiskExtents, Partitionsinformationen, Bitmap, etc.) abrufen möchte, bekomme ich ein Problem, wenn das Volumen gerade formatiert wird.
Kurz: Ich bekomme keine vernünftigen Daten.

(Passiert z.B. wenn man über diskmgmt.msc eine Partition löscht und wieder anlegt...)

Gibt es ein anderes Event (so etwas ähnliches wie DBT_DEVICEREMOVECOMPLETE nur eben für arrival :wink:), auf das ich reagieren kann?
Ich möchte eigentlich ungern das Volumen per Hand überwachen müssen.

MfG
mindtrap
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 28.07.09 11:51 
Was willst Du konkret denn anstellen mit der Info?

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
mindtrap Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62



BeitragVerfasst: Di 28.07.09 13:05 
Ich überwache in meinem Programm Zustände von Partitionen und Platten zur Protokollierung.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 28.07.09 13:10 
hmmm, dann schau mal während der WM_DEVICECHANGE-Nachricht in die WMI, was er dort meldet. Dort sollte ja auch was bzgl. Formatierung usw. stehen.

Ansonsten ist ja schon allein ein Fehler beim Zugriff "Protokollwürdig" ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
mindtrap Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 62



BeitragVerfasst: Mi 29.07.09 03:10 
Es geht weniger um die Frage, ob es protokollwürdig ist oder nicht, sondern eher darum,
dass der Benutzer im laufenden Betrieb angezeigt bekommen soll, wenn sich die Partitionsinformationen
verändert haben.

Mit DBT_DEVICEARRIVAL kann ich nur feststellen, ob ein Volumen entfernt oder hinzugefügt wurde.
Sollte z.B. das Volumen mit FAT formatiert sein und wird dann auf NTFS umformatiert, bekomme ich das
nicht mit.

Um die Informationen abzurufen öffne ich kurz ein Handle zum Volumen und schließe es wieder,
damit andere Prozesse damit weiterhin machen können, was sie wollen.
Ich will nur eben mitbekommen, dass sie was verändern. :D
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 29.07.09 07:41 
Die WMI hat für viele Ereignisse Notifications; schau da mal nach, vielleicht findet sich da ja was für die Partitionsgeschichten.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.