次の例は、ウィンドウの CMW ラベルを取得します。プロセスの機密ラベルはウィンドウの機密ラベルと同等であるため、特権は必要ありません。
/* ウィンドウの CMW ラベルを検出する */ retval = XTSOLgetResLabel(display, window, IsWindow, &cmwlabel); /* ラベルを文字列に変換し出力する */ retval = bcltos(&cmwlabel, &string, 0, LONG_WORDS); printf("CWM label = %s¥n", string);
printf(1) 文によって、次のように出力されます。
CMW label = UNCLASSIFIED[C]