Page 328 - DCAP103_Principle of operating system
P. 328

Unit 10: Introduction of Windows and its Programming



            Processes, threads, synchronization, memory management, file I/O, and security system calls   Notes
            are nothing new. Other operating systems have them too, although generally not hundreds of
            them, as Win32 does. But what really distinguishes Win32 are the thousands upon thousands
            of calls for the graphical interface. There are calls for creating, destroying, managing and using
            windows, menus, tool bars, status bars, scroll bars, dialog boxes, icons, and many more items that
            appear on the screen. There are calls for drawing geometric figures, filling them in, managing the
            colour palettes they use, dealing with fonts, and placing icons on the screen. Finally, there are
            calls for dealing with the keyboard, mouse and other input devices as well as audio, printing,
            and other output devices. In short, the Win32 API (especially the GUI part) is immense and
            we could not even begin to describe it in any detail in this unit, so we will not try. Interested
            readers should consult one of the many sites on Win32.
            Although the Win32 API is available on Windows 98 (as well as on the consumer electronics
            operating  system,  Windows  CE),  not  every  version  of  Windows  implements  every  call  and
            sometimes there are minor differences as well. For example, Windows 98 does not have any
            security, so those API calls that relate to security just return error codes on Windows 98. Also,
            Windows 2000 file names use the Unicode character set, which is not available on Windows
            98 and Windows 98 file names are not case sensitive, whereas Windows 2000 file names are
            case sensitive (although some kinds of searches on file names are not case sensitive). There are
            also differences in parameters to some API function calls. On Windows 2000, for example, all
            the screen coordinates given in the graphics functions are true 32-bit numbers; on Windows
            95, only the low-order 16 bits are used because much of the graphics subsystem is still 16-bit
            code. The existence of the Win32 API on several different operating systems makes it easier to
            port programs between them, but since these minor variations exist, some care must be taken
            to achieve portability.





                    How to differentiate between Win32 and Win64?



            10.2.2 Registry
            Windows needs to keep track of a great deal of information about hardware, software, and users.
            In Windows 3.x, this information was stored in hundreds of .int (initialization) files spread all
            over the disk. Starting with Windows 95, nearly all the information needed for booting and
            configuring the system and tailoring it to the current user was gathered in a big central database
            called the registry. In this section we will give an overview of the Windows 2000 registry.
            To start with, it is worth noting that although many parts of Windows 2000 are complicated and
            messy, the registry is one of the worst, and the cryptic nomenclature does not make it much
            better. Fortunately, entire sites have been written describing it. That said, the idea behind the
            registry is very simple. It consists of a collection of directories, each of which contains either
            subdirectories or entries. In this respect it is a kind of file system for very small files. It has
            directories and entries (the files).
            The confusion starts with the fact that Microsoft calls a directory a key, which is definitely not.
            Furthermore, all the top-level directories start with the string HKEY, which means handle to
            key. Subdirectories tend to have somewhat better chosen names, although not always.

            At the bottom of the hierarchy are the entries, called values, which contain the information.
            Each value has three parts: a name, a type, and the data. The name is just a Unicode string, often
            default if the directory contains only one value. The type is one of 11 standard types. The most
            common ones are Unicode string, a list of Unicode strings, a 32-bit integer an arbitrary length




                                             LOVELY PROFESSIONAL UNIVERSITY                                   321
   323   324   325   326   327   328   329   330   331   332   333