Document revision date: 15 July 2002
[Compaq] [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]
[OpenVMS documentation]

COM, Registry, and Events for OpenVMS Developer's Guide


Previous Contents Index

The NTA$EVENTW routine completes synchronously; that is, control is returned to the caller only after the request completes.

Use the following process to write event data:

  1. Register the event source.
    This operation defines the event log to which the system writes event data.
  2. Report the event.
    This operation causes the system to write the information to the appropriate event log.
  3. Deregister the event source.
    This operation frees resources acquired as part of the event source registration operation.

Condition Values Returned

SS$_NORMAL Service completed successfully.
SS$_ACCVIO One of the arguments cannot be read/written.
SS$_BADPARAM Bad parameter.
SS$_NOPRIV Insufficient privilege to access the specified event log.
SS$_TIMEOUT Request timed out.
SS$_UNREACHABLE Events service unavailable.
SS$_REJECT The Windows NT LAN Manager server encountered an error. See the Win32 status for more information.

15.3 Writing Your Own Events

By default, the system logs DCOM events generated by COM for OpenVMS. In addition to recording COM for OpenVMS events, the system can also log COM application events for COM applications that you create.

The COM for OpenVMS kit includes sample code that shows how to generate an application event using Win32 APIs. You can use this example as is on a Windows NT system. The example also builds correctly using the instructions for building COM for OpenVMS applications on OpenVMS (to get the required header files from DCOM$LIBRARY). See Chapter 7 for these instructions. The example also includes the linking instructions to build the example using Wind/U.

15.4 Troubleshooting OpenVMS Events

Errors that occur during event reporting can be difficult to trace because of the number of intervening software layers through which the event passes. The following list describes how OpenVMS Events pass through other software layers until they are recorded in the Windows NT log.

  1. An application calls one of the Win32 event functions ( RegisterEventSource , ReportEvent , or DeregisterEventSource ).
  2. Using the supplied arguments, the Win32 API builds an appropriate item list and calls the NTA$EVENTW routine.
  3. The NTA$EVENTW routine validates the information supplied (function code, item list, and so on) and builds an appropriate item list for the SYS$ACM system service.
    If NTA$EVENT detects any errors NTA$EVENT returns the errors to the Win32 API using R0 and the event status block.
  4. The SYS$ACM system service validates the information and passes it to the NT ACME.
    If SYS$ACM detects any errors, SYS$ACM returns the errors to NTA$EVENTW using R0 and the ACM status block..
  5. The NT ACME passes the supplied information (using an IPC pipe) to a dispatcher in the Compaq Advanced Server for OpenVMS.
    If the NT ACME detects any errors, the NT ACME returns the errors to the caller using the ACM status block.
  6. The Compaq Advanced Server for OpenVMS dispatcher validates the information and calls the appropriate routines to perform the requested operation (register, report, or deregister).
    If the Compaq Advanced Server for OpenVMS detects any errors, it reports the errors to the NT ACME. The NT ACME passes the errors back to the other callers.

Checking the contents of the event status block help you determine where the failure might have happened. Table 15-1 lists (in order of importance) the checks you should perform.

Table 15-1 Troubleshooting OpenVMS Events Failures
R0 Status Status Field Value Component to Check
Failure (bit 0 clear) EVT$L_NT_STATUS field is nonzero. Error most likely occurred within Compaq Advanced Server for OpenVMS.
Failure EVT$L_VMS_STATUS field is nonzero and the EVT$L_NT_STATUS is zero. Error most likely occurred within the SYS$ACM system service or the NT ACME.
Failure EVT$L_VMS_STATUS is zero and EVT$L_NT_STATUS is zero. Error most likely occurred within the SYS$ACM system service.

Note

The Win32 API usually converts the error status to an appropriate NT error status code and makes it available through the GetLastError Win32 API. (The status returned by the event API simply indicates a generic failure.)


Part 4
Appendixes

This part contains reference information about COM for OpenVMS and the OpenVMS Registry.

The appendixes provide information about the MIDL compiler, troubleshooting tips, COM sample code, running COM for OpenVMS in an unauthenticated environment, and APIs and interfaces.

This part also includes a glossary and a list of acronyms.


Appendix A
MIDL Compiler Options

A.1 Mode

Switch Use
/ms_ext Microsoft extensions to the IDL language (default)
/c_ext Allow Microsoft C extensions in the IDL file (default)
/osf OSF mode - disables /ms_ext and /c_ext options
/app_config Allow selected ACF attributes in the IDL file
/mktyplib203 MKTYPLIB Version 2.03 compatibility mode

A.2 Input

Switch Use
/acf filename Specify the attribute configuration file
/I directory-list Specify one or more directories for include path
/no_def_idir Ignore the current and the INCLUDE directories

A.3 Output File Generation

Switch Use
/client none Do not generate client files
/client stub Generate client stub file only
/out directory Specify destination directory for output files
/server none Generate no server files
/server stub Generate server stub file only
/syntax_check Check syntax only; do not generate output files
/Zs Check syntax only; do not generate output files
/old Generate old format type libraries
/new Generate new format type libraries

A.4 Output File Names

Switch Use
/cstub filename Specify client stub file name
/dlldata filename Specify dlldata file name
/h filename Specify header file name
/header filename Specify header file name
/iid filename Specify interface UUID file name
/proxy filename Specify proxy file name
/sstub filename Specify server stub file name
/tlb filename Specify type library file name

A.5 C Compiler and Preprocessor Options

Switch Use
/cpp_cmd cmd_line Specify name of C++ preprocessor
/cpp_opt options Specify additional C++ preprocessor options
/D name[=def] Pass #define name, optional value to C++ preprocessor
/no_cpp Turn off the C++ preprocessing option
/nocpp Turn off the C++ preprocessing option
/U name Remove any previous definition (undefine)

A.6 Environment

Switch Use
/char signed C++ compiler default char type is signed
/char unsigned C++ compiler default char type is unsigned
/char ascii7 Char values limited to 0-127
/dos Target environment is MS-DOS client
/env dos Target environment is MS-DOS client
/env mac Target environment is Apple Macintosh
/env powermac Target environment is Apple PowerMac
/env win16 Target environment is Microsoft Windows 16-bit (Win 3.x)
/env win32 Target environment is Microsoft Windows 32-bit (NT)
/mac Target environment is Apple Macintosh
/ms_union Use Midl 1.0 non-DCE wire layout for non-encapsulated unions
/oldnames Do not mangle version number into names
/powermac Target environment is Apple PowerMac
/rpcss Automatically activate rpc_sm_enable_allocate
/use_epv Generate server side application calls via entry-pt vector
/no_default_epv Do not generate a default entry-point vector
/prefix client str Add "str" prefix to client-side entry points
/prefix server str Add "str" prefix to server-side manager routines
/prefix switch str Add "str" prefix to switch routine prototypes
/prefix all str Add "str" prefix to all routines
/win16 Target environment is Microsoft Windows 16-bit (Win 3.x)
/win32 Target environment is Microsoft Windows 32-bit (NT)

A.7 Error and Warning Messages

Switch Use
/error none Turn off all error checking options
/error allocation Check for out of memory errors
/error bounds_check Check size vs transmission length specification
/error enum Check enum values to be in allowable range
/error ref Check ref pointers to be non-null
/error stub_data Emit additional check for server side stub data validity
/no_warn Suppress compiler warning messages

A.8 Optimization

Switch Use
/align {1|2|4|8} Designate packing level of structures
/pack {1|2|4|8} Designate packing level of structures
/Zp{1|2|4|8} Designate packing level of structures
/Oi Generate fully interpreted stubs
/Oic Generate fully interpreted stubs for standard interfaces and stubless proxies for object interfaces as of NT 3.51 release
/Oicf Generate fully interpreted stubs with extensions and stubless proxies for object interfaces as of NT 4.0 release
/Os Generate inline stubs
/hookole Generate HookOle debug info for local object interfaces

A.9 Miscellaneous

Switch Use
@response_file Accept input from a response file
/? Display a list of MIDL compiler switches
/confirm Display options without compiling MIDL source
/help Display a list of MIDL compiler switches
/nologo Suppress displaying of the banner lines
/o filename Redirects output from screen to a file
/W{0|1|2|3|4} Specify warning level 0-4 (default = 1)
/WX Report warnings at specified /W level as errors


Previous Next Contents Index

  [Go to the documentation home page] [How to order documentation] [Help on this site] [How to contact us]  
  privacy and legal statement  
6539PRO_017.HTML