Win32 Programming Lesson 8a: Jobs. Where are we?  Grouping processes into logical groups: Jobs  However, processes don’t retain a parent- child relationship.

Slides:



Advertisements
Similar presentations
IEs Protected Mode in Windows Vista TM January 20, 2006 Marc Silbey Program Manager.
Advertisements

MUMS API CUEL IMAN MLIM 2010/11/18. CUEL Module Function Description – This function allows the caller to request that the module name be added to the.
TA for the Palm Handheld ******* VIP Tone Pty Ltd (Aust)
1 Part 3: TA for the PDA *******. 2 Introduction TA is an application designed to: Integrate with the host SIS (EDSAS) Provide a mobile solution to tracking.
Lesson 12: Kernel-mode Thread Sync (aka: Why I love Gentoo)
Operating-System Structures
Win32 Programming Lesson 8: Processes. Where are we?  We’re starting to have some foundational understanding of Windows  But really, we don’t know how.
15.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 15: Configuring a Windows.
计算机系 信息处理实验室 Lecture 8 Processes, Threads, and Jobs (2)
1 Created by Another Process Reason: modeling concurrent sub-tasks Fetch large amount data from network and process them Two sub-tasks: fetching  processing.
1 JMH Associates © 2004, All rights reserved Chapter 6 Process Management.
Project 1 Roadmap.
ISP – 3 rd Recitation “The joy of Windows API” Processes Threads Handles Relevant functions A simple code example.
CMSC 414 Computer and Network Security Lecture 9 Jonathan Katz.
MIS Chapter 91 Ch. 9 – Implement and Use Group Policy MIS 431 – created Spring 2006.
New UI Changes for Endpoint Security in LDMS 9.6 SP2.
7.1 © 2004 Pearson Education, Inc. Exam Managing and Maintaining a Microsoft® Windows® Server 2003 Environment Lesson 7: Introducing Group Accounts.
Terminal Server © N. Ganesan, Ph.D.. Reference Thin-Client Concept Thin-Client concept tutorial.
Mastering Windows Network Forensics and Investigation Chapter 14: Other Audit Events.
Opening SharePoint to External Users.  Centralize all files  Eliminate the need for Matching Subs RFI’s to our RFI’s (Dan Campbell, ETC)  Create a.
70-270: MCSE Guide to Microsoft Windows XP Professional Chapter 5: Users, Groups, Profiles, and Policies.
Working with Workgroups and Domains
Win32 Programming Lesson 9: Jobs & Thread Basics.
Collections Management Museums EMu 4.0 EMu (And where to from there!) Alex Fell Operations Manager KE Software (UK)
With Windows XP, you can share files and documents with other users on your computer and with other users on a network. There is a new user interface.
Home Media Network Hard Drive Training for Update to 2.0 By Erik Collett Revised for Firmware Update.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
70-294: MCSE Guide to Microsoft Windows Server 2003 Active Directory, Enhanced Chapter 5: Active Directory Logical Design.
Win32 Programming Lesson 16: Virtual Memory. Where are we?  We’ve covered the theory of Windows memory, and poked around some  Now let’s use how to.
Cisco Router Hardware Software overview. In this lecture we will investigate an overview of Cisco router hardware and software. We will first turn our.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS4: Scheduling and Dispatch 4.2. Windows Processes.
Win32 Programming Lesson 10: Thread Scheduling and Priorities.
Win32 Programming Lesson 20: Advanced DLL Techniques.
Win32 Programming Lesson 22: DLL Magic Part Deux All your base are belong to us…
Yen-Chin Chen Outline Job Object Introduction Windows functions to create and manipulate job objects CPU-related and memory-related limits.
Win32 Programming Lesson 7: Kernel Objects. Abstract  Many of the concepts we’ll look at today won’t make complete sense until you use them  However,
Win32 Programming Lesson 18: More Memory Mapped Files and the HEAP (Finally, cool stuff!)
Lesson 1-Logging On to the System. Overview Importance of UNIX/Linux. Logging on to the system.
Fall 2002 CS 325 Class Notes Page 1 Lecture 25 Today –exec() in Unix –CreateProcess in Windows Announcements.
Managing Services and Registry Chapter 16 powered by dj.
NetTech Solutions Security and Security Permissions Lesson Nine.
Win32 Programming Lesson 17: Memory Mapped Files (Finally, cool stuff again, all this work is getting tedious!)
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Understand Permissions LESSON Security Fundamentals.
Windows Internals 4th Chapter 4 (continued) Team 6 Service ~ Startup Errors 洪健惟 Accepting the Boot and Last Known Good ~ Service Control Program.
Win32 Programming Lesson 15: Practical Windows Memory (If you can read this you have good vision)
Stanislaus County Employee Access DataStore Application Presented By: Melanie Lema, Information Technology Unit Stanislaus County Department of Child.
Report Manager works with any Sage Accpac ERP product. GL,AR,AP,IC,PO,SN,VM, etc. Use Report Manager to design simple user interfaces with finders, drop.
Memory Mapped I/O Gregory Mortensen CSIS 4330, Advanced Windows Programming – UVSC.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Windows XP Professional Not Finish Yet
Wrong Presentation Put In
Introducing, Installing, and Upgrading Windows 7
Unit 2, Lesson 5 Windows User Accounts
Intercompany Concepts
Operating Systems: A Modern Perspective, Chapter 6
File Management.
2P13 Week 2.
Linux Fork/Exec Example
Chapter 2: System Structures
Figure 6-9: Managing Users and Groups
Process Description and Control
UNIX Fork/Exec Example
Chapter 2 Processes and Threads 2.1 Processes 2.2 Threads
Chapter 2: Operating-System Structures
Implementing Processes, Threads, and Resources
Linux Fork/Exec Example
Areas Of Focus Image format Firmware Memory management Problem areas
ITAS Risk Reporting Integration to an ERP
Presentation transcript:

Win32 Programming Lesson 8a: Jobs

Where are we?  Grouping processes into logical groups: Jobs  However, processes don’t retain a parent- child relationship which can make life difficult… very difficult

Jobs  Introduced in Windows 2000  Based upon the Job Kernel Object  Ability to add restrictions to processes (and groups of processes)

CreateJobObject  HANDLE CreateJobObject( PSECURITY_ATTRIBUTES psa, PCTSTR pszName);  Like most calls, we first name our Job Object… can also open an existing object: HANDLE OpenJobObject( DWORD dwDesiredAccess, BOOL bInheritHandle, PCTSTR pszName);

Placing Restrictions on a Job  Jobs can be restricted in several ways Resource Limits UI Limits Security limits (registry, subkeys, files etc.)  Set by: BOOL SetInformationJobObject( HANDLE hJob, JOBOBJECTINFOCLASS JobObjectInformationClass, PVOID pJobObjectInformation, DWORD cbJobObjectInformationLength);

JobObjectInfoClass  Enumerated type setting the limit type Basic Limit Extended Basic Limit Basic UI Restrictions Security Limit  Defines the type of the 3 rd Parameter in the call

Basic Limits  typedef struct _JOBOBJECT_BASIC_LIMIT_INFORMATI ON { LARGE_INTEGER PerProcessUserTimeLimit; LARGE_INTEGER PerJobUserTimeLimit; DWORD LimitFlags; DWORD MinimumWorkingSetSize; DWORD MaximumWorkingSetSize; DWORD ActiveProcessLimit; DWORD_PTR Affinity; DWORD PriorityClass; DWORD SchedulingClass; } JOBOBJECT_BASIC_LIMIT_INFORMATION, *PJOBO BJECT_BASIC_LIMIT_INFORMATION;

Extended Limits  typedef struct _JOBOBJECT_EXTENDED_LIMIT_ INFORMATION { JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation; IO_COUNTERS IoInfo; SIZE_T ProcessMemoryLimit; SIZE_T JobMemoryLimit; SIZE_T PeakProcessMemoryUsed; SIZE_T PeakJobMemoryUsed; } JOBOBJECT_EXTENDED_LIMIT_INFORMAT ION, *PJOBOBJECT_EXTENDED_LIMIT_INFO RMATION;

UI Limits JOB_OBJECT_UILIMIT_EXITWINDOWS Prevents processes from logging off, shutting down, rebooting, or powering off the system via the ExitWindowsEx function JOB_OBJECT_UILIMIT_READCLIPBOARDPrevents processes from reading the clipboard JOB_OBJECT_UILIMIT_WRITECLIPBOARDPrevents processes from erasing the clipboard JOB_OBJECT_UILIMIT_SYSTEMPARAMETERSPrevents processes from changing system parameters via the SystemParametersInfo function JOB_OBJECT_UILIMIT_DISPLAYSETTINGSPrevents processes from changing the display settings via the ChangeDisplaySettings function JOB_OBJECT_UILIMIT_GLOBALATOMSGives the job its own global atom table and restricts processes in the job to accessing only the job's table JOB_OBJECT_UILIMIT_DESKTOPPrevents processes from creating or switching desktops using the CreateDesktop or SwitchDesktop function JOB_OBJECT_UILIMIT_HANDLESPrevents processes in a job from using USER objects (such as HWNDs) created by processes outside the same job

Placing a Process in a Job  BOOL AssignProcessToJobObject( HANDLE hJob, HANDLE hProcess);  Create the job…  Place restrictions on the job…  CreateProcess with CREATE_SUSPENDED  Call AssignProcessToJob New processes spawned by a job are automatically part of the job

Terminating All Processes in A Job  Simple! BOOL TerminateJobObject( HANDLE hJob, UINT uExitCode);

Job Accounting  Fairly simple Uses JOBOBJECT_BASIC_ACCOUNTING_INFORMATIO N  See brary/en-us/dllproc/base/isprocessinjob.asp brary/en-us/dllproc/base/isprocessinjob.asp

Notifications  It is possible to receive notifications from jobs as they complete, but it’s somewhat complicated  Should be aware of the I/O Completion Port Kernel Object  Example: JobLab example application