Hallo p.specht,
bei AneR 57 war ich wohl auf dem Holzweg.
Zu AneR 58 hätte ich noch eine Frage:
Liegt die Profilstange immer mit einer Ecke auf dem Boden auf?
Tschau
Hallo p.specht,
bei AneR 57 war ich wohl auf dem Holzweg.
Zu AneR 58 hätte ich noch eine Frage:
Liegt die Profilstange immer mit einer Ecke auf dem Boden auf?
Tschau
Nein, immer mit zwei Ecken, also auf einer Seite. Das wäre ja sonst instabiel.
Also nichts mit in der Luft drehen?
Ich bin jetzt Vorsichtig geworden.
Tschau
Am Boden rollen, besser gesagt kippen.
P.S.: Wo kam das lange ie in "instabiel her?
Da ist kein ie weit und breit: instabil heißt es!
zu AneR 56 muss ich widersprechen.
Das Ergebnis bei mir ist 125
cls
Declare string ziffern
Declare int count,zaehler,digit
zaehler = 0
whileloop 1000,9999
ziffern = Str$(&loop)
count = 0
digit = Val(substr$(ziffern,1)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
digit = Val(substr$(ziffern,2)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
digit = Val(substr$(ziffern,3)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
digit = Val(substr$(ziffern,4)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
case count = 4 : print &loop,
if (count = 4) and ((&loop mod 5) = 0)
inc zaehler
endif
endwhile
print "\n\nAufgabe 56: Ergebnis =", zaehler
waitkey
end
Alles anzeigen
etwas klarer mit Hervorhebung
cls
Declare string ziffern
Declare int count,zaehler,digit
zaehler = 0
whileloop 1000,9999
ziffern = Str$(&loop)
count = 0
digit = Val(substr$(ziffern,1)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
digit = Val(substr$(ziffern,2)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
digit = Val(substr$(ziffern,3)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
digit = Val(substr$(ziffern,4)) : case (digit=1) or (digit=3) or (digit=5) or (digit=7) or (digit=9) : inc count
if (count = 4)
if (&loop mod 5) = 0
inc zaehler
Color 15,0
else
Color 0,15
endif
print &loop,
endif
endwhile
Color 0,15
print "\n\nAufgabe 56: Ergebnis =", zaehler
waitkey
end
Alles anzeigen
Sorry, ich habe es mir alles in Ruhe noch einmal durchgelesen.
Die Mathematik der Erklärungen ist wohl nicht so mein Fachgebiet.
Ich bevorzuge immer die Brute Force (na ja - fast immer).
Da steht eindeutig 125 - entschuldige.
@Michael Wodrich: Wunderschöne Ausgabe! Die Lösung 125 stimmt, war aber auch Ergebnis der Offiziellen Lösung, die dummerweise von mir als Lösung zu AneR 51 gekennzeichnet war, was erst im Folgebeitrag korrigiert wurde! Sorry nochmal!
Ergänzende Erläuterung zu AneR 58:
----------------------------------
Die Stange mit Dreicksprofil von je 3 cm Seitenlänge liegt am ebenen, rigiden Boden. Sie wird physisch weitergekickt, rutscht aber nicht, sondern kippt drei mal. Physikalisch würde die Stange dabei etwas einsinken und wäre auch nicht wirklich spitz, im Beispiel schon. Am Ende ist die obere Profilkante wieder oben. Die Frage war, welche kreisförmige Wegstrecke sie zurückgelegt hat.
Abt. Die Mathematik hinter Quantencomputern
===================================
Der junge Microsoft-Wissenschaftler Andrew Helwer erklärt in diesem engl. Youtube-Video die Mechanismen hinter Quantenbits. Der mathematische Ansatz gibt Einblicke vom einfachen Quanten-Gatter bis hin zum instantanen Verschränkungsphänomen und zur Quantenteleportation. Anschließende Demonstrationen werden mit der Microsoft-Programmmiersprache Q# (Q-sharp) durchgeführt, die auf F# basiert ( - welche wiederum auf C# basiert, welches auf C++ basiert, welches auf C basiert, das wiederum einfache Assemblerbefehle als Hochsprache zusammenfasste. Und Assembler fasst Microcode-Sequenzen zusammen, welche bits und Bytes manipulieren. Damit ist die Verbindung zwischen Qbits und bits gegeben )
Gruss
P.S.: Erstaunlich, aber wahr: Erst durch die Wirkung von nicht-Zeit-verbrauchenden Verschränkungsprozessen ist sichergestellt, daß im gesamten Universum die selben physikallischen Naturgesetze gelten: Zeit ist erst ein makroskopisches Phänomen, ähnlich wie Wärme. Für ein Photon, das mit Lichtgeschwindigkeit dahinrast, vergeht selbst eben keine Zeit.
Lösung zu AneR 58
==============
Beim ersten Kippvorgang legt die Spitze einen Weg zurück, der dem Aussenwinkel des Profils von 120° entspricht. Beim zweiten Kippvorgang bildet sie den Drehpunkt, legt also keinen Weg zurück. Beim dritten Kippvorgang wandert sie wieder nach oben, legt also ein weiteres Mal 120° mit einem Radius zurück, der der Seitenbreite entspricht. Somit haben wir insgesamt zweimal 120 ° = 240 °, jedesmal von einem Kreis mit Radius 3 cm entspricht.
Der ganze Kreis hätte 360°, daher einen Umfang U = 2*r*Pi = 2*3*3.14159 = 18.85 cm
Die obere Ecke hat aber nur 240°/360°= 2/3 davon zurückgelegt.
Antwort: Die obere Ecke hat 12.57 cm zurückgelegt.
Abt. AneR 59
==========
Bei periodischen Dezimalzahlen ist es üblich, die sich laufend wiederholende Periode mit einem Start-Punkt und einem End-Punkt über den Beginn- und End-Ziffern der Periode zu kennzeichnen. In diesem Forum ist das nicht ganz einfach, sodaß ich den periodischen Teil mit einem "Underscore"-Symbol eingeleitet habe. Die Periode reicht dann bis zur letzten angeschriebenen Dezimalziffer und beginnt sich dort unendlich zu wiederholen.
Frage: Welche der nachstehenden Zahlen ist dann mathematisch die Größte?
A 1.3542
B 1.354_2
C 1.35_42
D 1.3_542
E 1._3542
F -1._3542
Hallo p.specht,
Zu AneR 59 hätte ich noch eine Frage:
Normal kann man für 1/3 ja 0,3 mit dem Strich oben statt unten schreiben, meist Du es so?
Falls ja, wäre die Lösung D richtig.
Falsche Lösungen per Edith berichtigen ist uncool.
Tschau
@Oldi-40: Warum solltest Du etwas vollkommen richtiges korrigieren wollen?
Gratuliere, die korrekte Antwort ist D.
Abt. Ausnahmsweise? noch ein Rätsel - AneR 60
====================================
Kann man 1/7 als periodische Dezimalzahl schreiben?
Hallo p.specht,
Warum solltest Du etwas vollkommen richtiges korrigieren wollen?
Nee, ich lasse meine Fehler für die Nachwelt.
Zu AneR 60:
Jeder einfache Bruch lässt sich als periodische Dezimalzahl schreiben.
Z.B. 1/7 = 0,142857 (der Strich gehört natürlich über die Zahlen)
Es gibt natürlich Sonderfälle, wie Pi.
Tschau
Da staunten die alten Griechen Bauklötze, als sie Zahlen wie Pi und SQRT(2), irrationale Zahlen, entdeckten. Sie sollen sogar einen, der früher als sie draufgekommen war, ersäuft haben. Etwas Neues entdecken kann eben gefährlich sein ...
Abt. AneR 61
=========
Eine Eisenstange mit quadratischem Querschnitt und einer Seitenhöhe von 5 cm wird auf ebenem rigiden Boden vier mal in gleiche Richtung umgekippt, ohne zu rutschen. Welchen Weg legt die linke obere Ecke zurück?
Lösung zu AneR 61
--------------------
Annahme: Drehkippung der Stange nach rechts; Seitenhöhe der Stange s = 5 cm
I) Nach der 1. Kippung hat die linke obere Ecke einen Viertelkreis um die Diagonale des Querschnitts zurückgelegt: 1/4 * 2*(s*Sqrt(2))*Pi
II) Nach der 2. Kippung hat diese ursprünglich nun rechts oben liegende Ecke einen Viertelkreis um die Seitenhöhe s zurückgelegt und kommt nun unten rechts zu liegen: 1/4 * 2*s*Pi
III) Nach der 3. Kippung ändert sich nichts, weil die rechte untere Ecke den Drehpunkt bildet, und somit keinen Weg zurücklegt. Am Ende liegt sie nun links unten.
IV) Nach der 4. Kippung legt die Ecke nochmals einen Viertelkreis mit Radius = Seitenhöhe zurück: 1/4 * 2*s*Pi , und kommt wieder links oben zu liegen.
V) Zusammen wurde daher folgender Weg zurückgelegt:
1/4 * 2*(s*Sqrt(2))*Pi + 1/4 * 2*s*Pi + 0 + 1/4 * 2*s*Pi =
= s * ((Sqrt(2)+2)*Pi)/2 =
= s * ((1.414213562 + 2)*Pi)/2)=
= s * ( 3.414213562 * 3.141592654)/2
= s * 5.363034123 =
= 5 cm * 5.363034123
Antwort: Die Ecke hat einen Weg von 26.81517 cm zurückgelegt.
Abt. Prozesse, Threads und CPU-Kerne
========================
Im Zuge meiner Recherchen, wie man Prozesse (PExec-Befehl) und Threads (XPSE-Thread.Befehle) auf bestimmten CPU-Kernen zum Laufen bringen könnte, ist ein erster Einblick durch den CMD-Fenster-Befehl "START" möglich geworden. Das CMD-System (Teil von Windows, der ehemalige 32bit-DOS Scripts so weit als möglich am Laufen halten will) kennt dazu den Begriff NUMA: Non-Uniform-Memory-Access. Das System berücksichtigt damit vermutlich, daß virtuelle Hyperthreading-Kernpaare schneller miteinander kommunizieren können als physisch getrennte CPU-Kerne. Ich gestehe, da bin ich erst am forschen.
Gruss
Auszug aus dem HELP-System des CMD-Befehls "START":
C:>HELP START
Startet ein eigenes Fenster, um ein Programm/einen Befehl auszuführen.
START ["Titel"] [/D Pfad] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME] | /ABOVENORMAL | /BELOWNORMAL]
[/NODE <NUMA-Knoten>] [/AFFINITY <Hex.-Affinitätsmaske>] [/WAIT] [/B]
[Befehl/Programm]
[Parameter]
"Titel" Der Titel des neuen Fensters.
Pfad Startverzeichnis.
B Startet Anwendung, ohne ein neues Fenster zu öffnen. Die
Anwendung ignoriert STRG+C. Wenn die Anwendung nicht
selbständig STRG+C überprüft, ist STRG+UNTBR die einzige
Möglichkeit, um die Anwendung abzubrechen.
I Die CMD.EXE beim Aufruf übergebene Umgebung soll die neue
aktuelle Umgebung sein.
MIN Startet das Fenster minimiert.
MAX Startet das Fenster maximiert.
SEPARATE Startet 16-Bit-Windows-Programm in separatem Speicherbereich.
SHARED Startet 16-Bit-Windows-Programm in gemeinsamen
Speicherbereich.
LOW Startet Anwendung in IDLE-Prioritätsklasse.
NORMAL Startet Anwendung in der NORMAL-Prioritätsklasse.
HIGH Startet Anwendung in der HIGH-Prioritätsklasse.
REALTIME Startet Anwendung in der REALTIME-Prioritätsklasse.
ABOVENORMAL Startet Anwendung in der ABOVENORMAL-Prioritätsklasse.
BELOWNORMAL Startet Anwendung in der BELOWNORMAL-Prioritätsklasse.
NODE Legt den Knoten der bevorzugten NUMA-Architektur
(Non-Uniform Memory Architecture) fest als Dezimalganzzahl
fest.
AFFINITY Legt die Prozessoraffinitätsmaske als Hexadezimalzahl fest.
Der Prozess kann nur auf diesen Prozessoren ausgeführt werden.
Die Affinitätsmaske wird abweichend interpretiert, wenn
/AFFINITY und /NODE kombiniert werden. Legt die
Affinitätsmaske so fest, als würde die Prozessormaske
des NUMA-Knotens nach rechts verschoben, um bei Bit null zu
beginnen. Der Prozess kann nur auf diesen gemeinsamen
Prozessoren zwischen der festgelegten Affinitätsmaske und dem
NUMA-Knoten ausgeführt werden. Wenn keine gemeinsamen
Prozessoren vorhanden sind, wird der Prozess auf
die Ausführung auf dem festgelegten NUMA-Knoten beschränkt.
WAIT Startet die Anwendung und wartet auf ihre Beendigung.
Befehl/Programm
Wenn es sich um einen internen "cmd"-Befehl oder eine
Batchdatei handelt, wird der Befehlszeilenprozessor "cmd.exe"
mit dem Parameter "/K" gestartet. Dies bedeutet, dass das
Fenster nach der Ausführung des Befehls nicht geschlossen
wird.
Wenn es sich nicht um einen internen "cmd"-Befehl oder eine
Batchdatei handelt, dann handelt es sich um ein Programm und
wird entweder in einem Fenster ausgeführt oder als
Konsolenanwendung.
Parameter Dies sind die an den Befehl oder das Programm übergebenen
Parameter.
HINWEIS:
Die Optionen SEPARATE und SHARED werden auf 64-Bit-Plattformen nicht unterstützt.
Durch die Festlegung von /NODE werden Prozesse auf eine Weise erstellt, durch
die Speicherorte auf NUMA-Systemen verwendet wird. ..
(Einschub Non-Uniform Memory Access oder kurz NUMA ist eine Computer-Speicher-Architektur für Multiprozessorsysteme, bei denen jeder Prozessor einen eigenen, lokalen Speicher hat, aber anderen Prozessoren über einen gemeinsamen Adressraum direkten Zugriff darauf gewährt (Distributed Shared Memory). Die Speicherzugriffszeiten in einem solchen Verbund hängen daher davon ab, ob sich eine Speicheradresse im lokalen oder im fremden Speicher befindet.) Weiter im Fließtext:
.. Beispielsweise können zwei Prozesse, die im hohen Maße über gemeinsam
genutzten Speicher miteinander kommunizieren, so erstellt werden, dass sie den
gleichen bevorzugten NUMA-Knoten gemeinsam verwenden, um die Speicherlatenz
zu verringern. Sie weisen nach Möglichkeit Speicher vom gleichen NUMA-Knoten zu, und sie können
auf Prozessoren außerhalb des festgelegten Knotens ausgeführt werden.
start /NODE 1 application1.exe
start /NODE 1 application2.exe
Diese beiden Prozesse können weiter eingeschränkt werden, damit sie auf
bestimmten Prozessoren innerhalb des gleichen NUMA-Knotens ausgeführt werden.
Im folgenden Beispiel wird application1 auf den beiden niedrigen Prozessoren
des Knotens ausgeführt, während application2 auf den folgenden beiden
Prozessoren des Knotens ausgeführt wird. In diesem Beispiel wird davon
ausgegangen, dass der angegebene Knoten über mindestens vier logische
Prozessoren verfügt. Beachten Sie, dass die Knotennummer für diesen Computer
zu jeder gültigen Knotennummer geändert werden kann, ohne dass die
Affinitätsmaske geändert werden muss.
start /NODE 1 /AFFINITY 0x3 application1.exe
start /NODE 1 /AFFINITY 0xc application2.exe
Wenn die Befehlserweiterungen aktiviert sind, wird der Aufruf von externen
Befehlen durch die Befehlszeile oder den START-Befehl folgendermaßen verändert:
Nicht-ausführbare Dateien können durch ihre Zuordnung zu einem Dateityp
einfach durch Eingabe des Namens als Befehl aufgerufen werden (z. B. würde
WORD.DOC die Anwendung starten, die der .DOC-Erweiterung zugeordnet ist).
Weitere Informationen, wie Sie diese Zuordnungen innerhalb eines Befehls-
skripts ändern, finden Sie beim ASSOC- bzw. FTYPE-Befehl.
Wird eine grafische 32-Bit-Anwendung aufgerufen, wartet CMD.EXE nicht auf
das Beenden dieser Anwendung, sondern kehrt sofort zur Eingabeauforderung
zurück. Das gilt NICHT, wenn diese Anwendung aus einem Befehlsskript
heraus aufgerufen wird.
Wenn eine Befehlszeile ausgeführt wird, die mit den Zeichen CMD ohne
Erweiterung oder Pfadname beginnt, wird CMD durch den Wert der
COMSPEC-Variablen ersetzt. Damit wird vermieden, dass man versehentlich
eine andere, ggf. zufällige Version der CMD.EXE verwendet.
Wenn eine Befehlszeile ausgeführt wird, die mit Zeichen beginnt, die keine
Dateierweiterung enthalten, dann verwendet CMD.EXE den Wert der Umgebungs-
variablen PATHEXT, um zu bestimmen, welche Erweiterungen in welcher
Reihenfolge verwendet werden. Der Standardwert für die PATHEXT-Variable
ist:
.COM;.EXE;.BAT;.CMD
Dabei ist die Syntax dieselbe wie in der PATH-Variablen, das heißt, die
einzelnen Einträge werden durch Semikolon getrennt.
Wenn mit dem START-Befehl ein Programm bzw. Befehl aufgerufen wird und keine
entsprechende Dateierweiterung gefunden wird, aber der Name ohne Erweiterung
einem Verzeichnisnamen entspricht, wird der Explorer mit diesem Pfad
aufgerufen. Von der Befehlszeile ausgeführt entspricht das einem CD /D mit
diesem Pfad.
Abt. SetProcessorAffinityMask - Was sagt MSDN?
==============================
SetProcessAffinityMask function
- Sets a processor affinity mask for (the threads of ???) the specified process.
Syntax
BOOL SetProcessAffinityMask(
HANDLE hProcess,
DWORD_PTR dwProcessAffinityMask
);
Parameters:
hProcess
A handle to the process whose affinity mask is to be set. This handle must have the PROCESS_SET_INFORMATION access right.
For more information, see Process Security and Access Rights.
dwProcessAffinityMask
The affinity mask for the threads of the process.
On a system with more than 64 processors, the affinity mask must specify processors in a single processor group.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.
To get extended error information, call GetLastError.
If the process affinity mask requests a processor that is not configured in the system, the last error code is ERROR_INVALID_PARAMETER.
On a system with more than 64 processors, if the calling process contains threads in more than one processor group, the last error code is ERROR_INVALID_PARAMETER.
Remarks
A process affinity mask is a bit vector in which each bit represents a logical processor on which the threads of the process are allowed to run. The value of the process affinity mask must be a subset of the system affinity mask values obtained by the GetProcessAffinityMask function. A process is only allowed to run on the processors configured into a system. Therefore, the process affinity mask cannot specify a 1 bit for a processor when the system affinity mask specifies a 0 bit for that processor.
Process affinity is inherited by any child process or newly instantiated local process.
Do not call SetProcessAffinityMask in a DLL that may be called by processes other than your own.
On a system with more than 64 processors, the SetProcessAffinityMask function can be used to set the process affinity mask only for processes with threads in a single processor group. Use the SetThreadAffinityMask function to set the affinity mask for individual threads in multiple groups. This effectively changes the group assignment of the process.
Requirements
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib DLL: Kernel32.dll
Siehe auch:
-------------
CreateProcess
GetProcessAffinityMask
Multiple Processors
Process and Thread Functions
Processes
Processor Groups
SetThreadAffinityMask
Abt. GetProcessAffinityMask - MSDN-Fehler?
============================
GetProcessAffinityMask function
Retrieves the process affinity mask for the specified process and the system affinity mask for the system.
Syntax:
BOOL GetProcessAffinityMask(
HANDLE hProcess,
PDWORD_PTR lpProcessAffinityMask,
PDWORD_PTR lpSystemAffinityMask
);
Parameters:
hProcess
A handle to the process whose affinity mask is desired.
This handle must have the PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION access right.
For more information, see Process Security and Access Rights.
Windows Server 2003 and Windows XP: The handle must have the PROCESS_QUERY_INFORMATION access right.
lpProcessAffinityMask
A pointer to a variable that receives the affinity mask for the specified process.
lpSystemAffinityMask
A pointer to a variable that receives the affinity mask for the system.
Return Value
If the function succeeds, the return value is nonzero and the function sets the variables pointed to by lpProcessAffinityMask and lpSystemAffinityMask to the appropriate affinity masks.
On a system with more than 64 processors, if the threads of the calling process are in a single processor group, the function sets the variables pointed to by lpProcessAffinityMask and lpSystemAffinityMask to the process affinity mask and the processor mask of active logical processors for that group. If the calling process contains threads in multiple groups, the function returns zero for both affinity masks.
If the function fails, the return value is zero, and the values of the variables pointed to by lpProcessAffinityMask and lpSystemAffinityMask are undefined. To get extended error information, call GetLastError.
Remarks
A process affinity mask is a bit vector in which each bit represents the processors that a process is allowed to run on. A system affinity mask is a bit vector in which each bit represents the processors that are configured into a system.
A process affinity mask is a subset of the system affinity mask. A process is only allowed to run on the processors configured into a system. Therefore, the process affinity mask cannot specify a 1 bit for a processor when the system affinity mask specifies a 0 bit for that processor.
Requirements
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header winbase.h (include Windows.h)
Library Kernel32.lib DLL Kernel32.dll
Siehe auch:
Multiple Processors
Process and Thread Functions
Processes
Processor Groups
SetProcessAffinityMask
SetThreadAffinityMask
Abt. Was sind PROCESS SECURITY und ACCESS RIGHTS ?
====================================
Process Security and Access Rights
The Microsoft Windows security model enables you to control access to process objects. For more information about security, see Access-Control Model.
When a user logs in, the system collects a set of data that uniquely identifies the user during the authentication process, and stores it in an access token. This access token describes the security context of all processes associated with the user. The security context of a process is the set of credentials given to the process or the user account that created the process.
Spätestens ab hier beginnt mein Gehirn zu käsen:
You can use a token to specify the current security context for a process using the CreateProcessWithTokenW function. You can specify a security descriptor for a process when you call the CreateProcess, CreateProcessAsUser, or CreateProcessWithLogonW function. If you specify NULL, the process gets a default security descriptor. The ACLs in the default security descriptor for a process come from the primary or impersonation token of the creator.
To retrieve a process's security descriptor, call the GetSecurityInfo function. To change a process's security descriptor, call the SetSecurityInfo function.
The valid access rights for process objects include the standard access rights and some process-specific access rights. The following table lists the standard access rights used by all objects.
Value Meaning
DELETE (0x00010000L)
Required to delete the object.
READ_CONTROL (0x00020000L)
Required to read information in the security descriptor for the object, not including the information in the SACL. To read or write the SACL, you must request the
ACCESS_SYSTEM_SECURITY access right.
For more information, see SACL Access Right.
SYNCHRONIZE (0x00100000L)
The right to use the object for synchronization. This enables a thread to wait until the object is in the signaled state.
WRITE_DAC (0x00040000L)
Required to modify the DACL in the security descriptor for the object.
WRITE_OWNER (0x00080000L)
Required to change the owner in the security descriptor for the object.
The following table lists the process-specific access rights.
Value Meaning
PROCESS_ALL_ACCESS
All possible access rights for a process object.Windows Server 2003 and Windows XP: The size of the PROCESS_ALL_ACCESS flag increased on Windows Server 2008 and Windows Vista. If an application compiled for Windows Server 2008 and Windows Vista is run on Windows Server 2003 or Windows XP, the PROCESS_ALL_ACCESS flag is too large and the function specifying this flag fails with ERROR_ACCESS_DENIED. To avoid this problem, specify the minimum set of access rights required for the operation. If PROCESS_ALL_ACCESS must be used, set _WIN32_WINNT to the minimum operating system targeted by your application (for example, #define _WIN32_WINNT _WIN32_WINNT_WINXP). For more information, see Using the Windows Headers.
PROCESS_CREATE_PROCESS (0x0080)
Required to create a process.
PROCESS_CREATE_THREAD (0x0002)
Required to create a thread.
PROCESS_DUP_HANDLE (0x0040)
Required to duplicate a handle using DuplicateHandle.
PROCESS_QUERY_INFORMATION (0x0400)
Required to retrieve certain information about a process, such as its token, exit code, and priority class (see OpenProcessToken).
PROCESS_QUERY_LIMITED_INFORMATION (0x1000)
Required to retrieve certain information about a process (see GetExitCodeProcess, GetPriorityClass, IsProcessInJob, QueryFullProcessImageName). A handle that has the
PROCESS_QUERY_INFORMATION access right is automatically granted
PROCESS_QUERY_LIMITED_INFORMATION
.Windows Server 2003 and Windows XP: This access right is not supported.
PROCESS_SET_INFORMATION (0x0200)
Required to set certain information about a process, such as its priority class (see SetPriorityClass).
PROCESS_SET_QUOTA (0x0100)
Required to set memory limits using SetProcessWorkingSetSize.
PROCESS_SUSPEND_RESUME (0x0800)
Required to suspend or resume a process.
PROCESS_TERMINATE (0x0001)
Required to terminate a process using TerminateProcess.
PROCESS_VM_OPERATION (0x0008)
Required to perform an operation on the address space of a process (see VirtualProtectEx and WriteProcessMemory).
PROCESS_VM_READ (0x0010)
Required to read memory in a process using ReadProcessMemory.
PROCESS_VM_WRITE (0x0020)
Required to write to memory in a process using WriteProcessMemory.
SYNCHRONIZE (0x00100000L)
Required to wait for the process to terminate using the wait functions.
To open a handle to another process and obtain full access rights, you must enable the SeDebugPrivilege privilege. For more information, see Changing Privileges in a Token.
The handle returned by the CreateProcess function has PROCESS_ALL_ACCESS access to the process object. When you call the OpenProcess function, the system checks the requested access rights against the DACL in the process's security descriptor. When you call the GetCurrentProcess function, the system returns a pseudohandle with the maximum access that the DACL allows to the caller.
You can request the ACCESS_SYSTEM_SECURITY access right to a process object if you want to read or write the object's SACL. For more information, see Access-Control Lists (ACLs) and SACL Access Right.
Warning
A process that has some of the access rights noted here can use them to gain other access rights. For example, if process A has a handle to process B with PROCESS_DUP_HANDLE access, it can duplicate the pseudo handle for process B. This creates a handle that has maximum access to process B. For more information on pseudo handles, see GetCurrentProcess.
Protected Processes
Windows Vista introduces protected processes to enhance support for Digital Rights Management. The system restricts access to protected processes and the threads of protected processes.
The following standard access rights are not allowed from a process to a protected process:
**DELETE** **READ\_CONTROL** **WRITE\_DAC** **WRITE\_OWNER**
The following specific access rights are not allowed from a process to a protected process:
**PROCESS\_ALL\_ACCESS** **PROCESS\_CREATE\_PROCESS** **PROCESS\_CREATE\_THREAD** **PROCESS\_DUP\_HANDLE** **PROCESS\_QUERY\_INFORMATION** **PROCESS\_SET\_INFORMATION** **PROCESS\_SET\_QUOTA** **PROCESS\_VM\_OPERATION** **PROCESS\_VM\_READ** **PROCESS\_VM\_WRITE**
The PROCESS_QUERY_LIMITED_INFORMATION right was introduced to provide access to a subset of the information available through PROCESS_QUERY_INFORMATION.
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!