SetOwner

3.1

  void SetOwner(hSel, hOwner)    
  WORD hSel; /* selector of segment, */  
  HANDLE hOwner; /* handle of information block */

The SetOwner function associates the given segment with an executable file or application.

Parameters

hSel

Specifies a selector or handle identifying the segment to be associated with the executable file or application.

hOwner

Identifies the information bock in the Windows (new-style) executable-file header for the application that contains the segment.

Return Value

This function does not return a value.

Comments

The Windows header information block identified by the hOwner parameter specifies the linker version number, the length of various tables of data, offsets to these tables, heap and stack sizes, and so on. For a description of the Windows header, see the Microsoft Windows Programmer's Reference, Volume 4.

The SetOwner function is one of three functions required for self-loading
Windows applications. The application developer must provide the code for
this function and store a pointer to it at offset 0x0004 in the application's loader
code and data table.

After the kernel allocates memory for a segment by using the MyAlloc function, it calls SetOwner.