Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

halvprnt.c File Reference

#include <ntos.h>
#include <inbv.h>

Go to the source code of this file.

Typedefs

typedef unsigned char BYTE
typedef unsigned char * PBYTE

Functions

int xatoi (char c)
int fields (char *cp, int *zerofill, int *fieldwidth)
VOID putx (ULONG x, int digits, int zerofill, int *fieldwidth)
VOID puti (LONG i, int digits, int zerofill, int *fieldwidth)
VOID putu (ULONG u, int digits, int zerofill, int *fieldwidth)
VOID putc (CHAR c)
void vprintf (PCHAR cp, USHORT a1)
void puti (long i, int digits, int zerofill, int *fieldwidth)


Typedef Documentation

typedef unsigned char BYTE
 

Definition at line 31 of file halvprnt.c.

Referenced by _ClientEventCallback(), _GetClassData(), _GetClassLongPtr(), _GetKeyNameText(), _GetWindowLongPtr(), _GetWindowWord(), _HasCaptionIcon(), _PrintInxFriendlyStr(), _SetClassWord(), _SetWindowWord(), AdjustPushStateForKL(), AnimateBlend(), AnimateFade(), BanjaToJunja(), Base32Encode(), bCheckAndDeleteTTF(), CalcClientScrolling(), CalcMinZOrder(), CalculateMouseTable(), ChangeICMSetting(), CharLowerA(), CharUpperA(), CheckAttribute(), CheckColors(), CheckRestricted(), CheckTransferState(), CI_GetClrVal(), CliGetImeHotKeysFromRegistry(), CliReadRegistryValue(), ComboBoxDBCharHandler(), ComboBoxWndProcWorker(), CompStrAToCharA(), CompStrAToCharW(), CompStrWToCharA(), CompStrWToUndetA(), ConvertDIBBitmap(), CopyOutputString(), CopyRestrictedFile(), crc32(), CreateBSMEventSD(), CreateColorantArray(), CreateDbcsScreenBuffer(), CreateDeviceInfo(), CreateDIBPalette(), CreateDlgFont(), CreateHostLutCRD(), CreatePaletteFromBitmap(), DefWindowProcWorker(), df(), DIBtoDIBV5(), dmem(), DoStringPaste(), DsoDump(), DT_InitDrawTextInfo(), ECCreate(), ECGetDBCSVector(), ECImeComposition(), EcImeRequestHandler(), CProfile::Enumerate(), CPrinterList::Enumerate(), ExpandWindowList(), ExtractIconFromEXE(), FastGetProfileDwordW(), FillInstances(), FilterKeys(), FindCreateFont(), FixupDlgFaceName(), FixupDlgLogFont(), FontEnum(), FsgInvertCursor(), FsgReverseMousePointer(), FsgVgaInitializeHWFlags(), FsgWriteToFrameBuffer(), FsgWriteToScreenCommonLVB(), FsVgaReverseMousePointer(), GenerateNlsVkAltKey(), GenerateNlsVkKey(), GetAlignment(), GetClassWord(), GetColorMatchingModule(), GetCompStrJapan(), GetCompStrKorea(), GetCompStrPRC(), GetCompStrTaiwan(), GetCursorHeight(), GetErrorMode(), GetHostCSA(), CGlobals::GetPrinterHDC(), GetRegIntFromID(), GetResourceTablePE(), GetServerIMEKeyboardLayout(), HandleKeyEvent(), HFill(), HighContrastHotKey(), HMAllocObject(), HMFreeObject(), HMInitHandleTable(), ImmProcessKey(), ImmTranslateMessage(), InitAnsiOem(), InitExtendedEditKeys(), InitWindowMsgTable(), InquireIme(), InternalGetPS2PreviewCRD(), InternalRegisterCMM(), InternalSCS_RECONVERTSTRING(), InternalVkKeyScanEx(), IopCacheNetbiosNameForIpAddress(), IopSetDefaultGateway(), IsInterestingPath(), IsPushButton(), IsSRGBColorProfile(), JohabToKs(), JunjaToBanja(), KsToJohab(), LB_CreateLBLine(), LBGetVariableHeightItemHeight(), LBSetVariableHeightItemHeight(), main(), Map8(), MB_UpdateDlgItem(), MESSAGECALL(), MigrateSystem9x(), MLChar(), MouseKeys(), NlsAlphanumericModeProc(), NlsCodeInputToggleProc(), NlsGetCurrentInputMode(), NlsHiraganaModeProc(), NlsKanaEventProc(), NlsKatakanaModeProc(), NlsNumpadModeProc(), NlsRomanToggleProc(), NlsSbcsDbcsToggleProc(), NlsSendParamVk(), NtUserConvertMemHandle(), NtUserCreateLocalMemHandle(), NtUserCreateWindowEx(), NtUserCtxDisplayIOCtl(), NtUserDefSetText(), NtUserGetClassName(), NtUserGetImeInfoEx(), NtUserGetKeyboardState(), NtUserGetMenuBarInfo(), NtUserGetObjectInformation(), NtUserRegisterClassExWOW(), NtUserRemoteConnect(), NtUserSetImeInfoEx(), NtUserSetKeyboardState(), NtUserSystemParametersInfo(), NtUserToUnicodeEx(), CPrinterProfileManagement::OnInit(), PostUpdateKeyStateEvent(), ProbeAndCaptureSoftKbdData(), ProcessKeyboardInput(), ProcessUpdateKeyStateEvent(), ReadOutputString(), ReadRectFromScreenBuffer(), RecolorDeskPattern(), RegReadApcProcedure(), RemoteSyncToggleKeys(), RtlGetExpWinVer(), RVAtoP(), Scale424(), Scale48(), Scale824(), Scale88(), SCR_FAMILY(), ScrollScreen(), set_opaque_bkgnd_proc(), SetAppCompatFlags(), SetRAMFont(), SetRAMFontCodePage(), SetSelected(), SetSKT1Data(), SKC1ButtonUp(), SKT1ButtonUp(), SKT1SetCursor(), SKWndProcT1(), SLChar(), SoftModalMessageBox(), SrvAddConsoleAlias(), SrvAllocConsole(), SrvCreateConsoleScreenBuffer(), SrvExpungeConsoleCommandHistory(), SrvGetConsoleAlias(), SrvGetConsoleAliases(), SrvGetConsoleAliasesLength(), SrvGetConsoleAliasExes(), SrvGetConsoleCommandHistory(), SrvGetConsoleCommandHistoryLength(), SrvGetConsoleTitle(), SrvReadConsole(), SrvRegisterConsoleVDM(), SrvSetConsoleNumberOfCommands(), SrvSetConsoleTitle(), SrvVDMConsoleOperation(), SrvWin32HeapStat(), SrvWriteConsole(), SrvWriteConsoleOutput(), StaticCallback(), StaticWndProcWorker(), StoreKeyInfo(), ToggleKeys(), UpdateSKC1Window(), UpdateUserScreen(), UtilityManager(), ValidateState(), ValidateZorder(), VKFromVSC(), vSweepFonts(), WINNLSTranslateMessageK(), WndProc(), WriteAscii85(), WriteASCII85Cont(), WriteFixed2dot30(), WriteHNAToken(), WriteImeLayout(), WriteInt2ByteString(), WriteIntStringU2S(), WriteIntStringU2S_L(), WriteStringToken(), WWSB_FillOutput(), xxxBNDrawText(), xxxBNInitDC(), xxxCalcClientRect(), xxxCallHook2(), xxxCallJournalPlaybackHook(), xxxCallJournalRecordHook(), xxxDefWindowProc(), xxxDoHotKeyStuff(), xxxInternalActivateKeyboardLayout(), xxxInternalKeyEventDirect(), xxxInternalToUnicode(), xxxKeyEvent(), xxxLBBinarySearchString(), xxxLBInsertItem(), xxxLBoxCtlCharInput(), xxxLoadKeyboardLayoutEx(), xxxMakeWindowForegroundWithState(), xxxNumpadCursor(), xxxProcessKeyEvent(), xxxRedrawTitle(), xxxScanSysQueue(), xxxSetClassData(), xxxSetClassLongPtr(), xxxSetSysMenu(), xxxSetWindowLongPtr(), xxxShowWindow(), xxxSkipSysMsg(), xxxStaticLoadImage(), xxxStaticPaint(), xxxStickyKeys(), xxxToUnicodeEx(), xxxUpdateModifierState(), and zzzChangeStates().

typedef unsigned char * PBYTE
 

Definition at line 31 of file halvprnt.c.

Referenced by _BuildNameList(), _ClientCopyDDEIn1(), _ClientGetDDEHookData(), _CreateWindowEx(), _GetUserObjectInformation(), _MapDesktopObject(), _PrintInxClause(), _PrintInxStr(), _SetCursorIconData(), _UserTestForWinStaAccess(), AddPathEllipsis(), AddTagTableEntry(), AllocAce(), AllocAndSetDDEData(), AllocateCallbackData(), AllocCallbackMessage(), Ascii85Encode(), AsyncWindowPos(), BeginGlobalDict(), CaptureAnsiCallbackData(), CaptureCallbackData(), CaptureUnicodeCallbackData(), ChangeICMSetting(), ChangeTaggedElementSize(), CheckInputOutputTable(), CheckResMedHftnMatch(), CleanEventMessage(), CommitReadOnlyMemory(), CompStrAToCharA(), CompStrAToCharW(), CompStrAToStringA(), CompStrAToStringExA(), CompStrAToStringExW(), CompStrAToStringW(), CompStrAToUndetA(), CompStrAToUndetW(), CompStrWToCharA(), CompStrWToCharW(), CompStrWToStringA(), CompStrWToStringExA(), CompStrWToStringExW(), CompStrWToStringW(), CompStrWToUndetA(), CompStrWToUndetW(), CookedRead(), CopyRectangle(), CopySTR(), CreateAniIcon(), CreateColSpArray(), CreateColSpProc(), CreateCRDRevArray(), CreateDbcsScreenBuffer(), CreateFloatString(), CreateHostInputOutputArray(), CreateHostLutCRD(), CreateHostMatrixCSAorCRD(), CreateHostTRCInputTable(), CreateInputArray(), CreateLutCRD(), CreateMatrixCRD(), CreateMonoCRD(), CreateOutputArray(), CreateScreenBuffer(), CreateSecurityDescriptor(), CreateSetupNameArray(), CSMakeCall(), DeleteTaggedElement(), DIBtoBMP(), DoClientInStuff(), DoClientOutStuff(), DrawTextExWorker(), DsoDump(), DT_GetLineBreak(), DWordSkipSz(), EnableGlobalDict(), EndGlobalDict(), EnumColorProfilesW(), CProfile::Enumerate(), CPrinterList::Enumerate(), ExamineValueEntries(), FixupCallbackPointers(), FreeView(), GetBadAppCmdLine(), GetClassWOWWords(), GetCPElementData(), GetCPElementDataType(), GetCRDInputOutputArraySize(), GetHostCSA(), GetIconIdEx(), GetInxStr(), GetLpszItem(), GetMonitorData(), GetPS2CSA_ABC(), GetPS2CSA_ABC_Lab(), GetPS2CSA_DEFG(), GetPS2CSA_MONO_A(), GetRegistryValues(), GetRevCurve(), GetSystemLineJ(), GlobalCollect(), GrowProfile(), HMAllocObject(), HMGrowHandleTable(), IconFromBestImage(), Idmon(), Idso(), IGetDeviceData(), ImmProcessKey(), ImmTranslateMessage(), InitCreateSharedSection(), InitMapSharedSection(), InternalAssociateColorProfileWithDevice(), InternalCreateColorTransform(), InternalCreateDialog(), InternalDisassociateColorProfileFromDevice(), InternalEnumColorProfiles(), InternalGetColorDirectory(), InternalGetCompositionStringA(), InternalGetCompositionStringW(), InternalGetPS2ColorSpaceArray(), InternalGetPS2CSAFromLCS(), InternalGetPS2PreviewCRD(), InternalGetSCSProfile(), InternalInstallColorProfile(), InternalMapVirtualKeyEx(), InternalOpenColorProfile(), InternalSCS_CHANGEATTR(), InternalSetSCSProfile(), InternalUninstallColorProfile(), InternalVkKeyScanEx(), ISetDeviceData(), IsSRGBColorProfile(), LoadAniIcon(), LoadIME(), MakeCSCall(), MapDesktop(), MESSAGECALL(), MigrateSystem9x(), ObjectFromDIBResource(), CPrinterProfileManagement::OnInit(), OpenKeyboardLayoutFile(), PostUpdateKeyStateEvent(), PrepareFallbackKeyboardFile(), ProcessCommandLine(), ProcessCommandListInput(), ProcessCookedReadInput(), ProcessKeyboardInput(), QueryDeviceInfo(), ReadAByte(), ReadBuffer(), ReadChars(), ReadIconGuts(), ReadLayoutFile(), ReadOutputString(), ReadRectFromScreenBuffer(), ReCreateDbcsScreenBufferWorker(), RemoteConnect(), RemoveStringFromMultiSz(), ResizeScreenBuffer(), ScrollRegion(), SendCRDABC(), SendCRDBWPoint(), SendCRDLMN(), SendCRDOutputTable(), SendCRDPQR(), SendCRDRevArray(), SendCSABWPoint(), SetColorProfileElementSize(), SkipIDorString(), SkipSz(), SLUndo(), SrvInvalidateBitMapRect(), SrvVDMConsoleOperation(), StartDeviceRead(), StreamScrollRegion(), TableInterp3(), TableInterp4(), TranslateConsoleTitle(), UpdateLinkIfChanged(), UserCommitDesktopMemory(), UserCommitSharedMemory(), vprintf(), WndProc(), WordSkipSz(), WowGetDefWindowProcBits(), WriteBuffer(), WriteFixed2dot30(), WriteHexBuffer(), WriteNewLineObject(), WriteScreenBuffer(), WWSB_DoWriteConsole(), WWSB_WriteOutputString(), WWSB_WriteRectToScreenBuffer(), xxxCallJournalRecordHook(), xxxCBGetTextHelper(), xxxCreateDesktop2(), xxxDefWindowProc(), xxxInsertMenuItem(), xxxInternalToUnicode(), xxxInterSendMsgEx(), xxxLBInsertItem(), xxxLBoxCtlDelete(), xxxMNAllocMenuState(), xxxProcessEventMessage(), xxxRemoveDeleteMenuHelper(), xxxResolveDesktop(), xxxResolveDesktopForWOW(), ZeroTooltip(), zzzChangeStates(), and zzzSetDesktop().


Function Documentation

int fields char *  cp,
int *  zerofill,
int *  fieldwidth
[static]
 

Definition at line 281 of file halvprnt.c.

References xatoi().

Referenced by vprintf().

00282 { 00283 int incval = 0; 00284 00285 *zerofill = 0; 00286 *fieldwidth = 0; 00287 00288 if (*cp == '0') { 00289 *zerofill = 1; 00290 cp++; 00291 incval++; 00292 } 00293 00294 while ((*cp >= '0') && (*cp <= '9')) { 00295 *fieldwidth = (*fieldwidth * 10) + xatoi(*cp); 00296 cp++; 00297 incval++; 00298 } 00299 return incval; 00300 }

VOID putc CHAR  c  )  [static]
 

Definition at line 389 of file halvprnt.c.

References c, InbvDisplayString(), and VOID().

Referenced by puti(), putu(), putx(), and vprintf().

00392 { 00393 static UCHAR OneCharacter[2]; 00394 00395 OneCharacter[1] = '\0'; 00396 OneCharacter[0] = c; 00397 InbvDisplayString(OneCharacter); 00398 }

void puti long  i,
int  digits,
int  zerofill,
int *  fieldwidth
[static]
 

Definition at line 337 of file halvprnt.c.

References putc().

Referenced by vprintf().

00338 { 00339 if (i<0) { 00340 i = -i; 00341 putc((char)'-'); 00342 } 00343 00344 if (i/10) 00345 puti(i/10, digits+1, zerofill, fieldwidth); 00346 00347 if (*fieldwidth > digits) { 00348 while (*fieldwidth > digits) { 00349 if (zerofill) 00350 putc('0'); 00351 else 00352 putc(' '); 00353 *fieldwidth--; 00354 } 00355 } 00356 *fieldwidth = 0; 00357 00358 putc((char)((i%10)+'0')); 00359 }

VOID puti LONG  i,
int  digits,
int  zerofill,
int *  fieldwidth
[static]
 

void putu ULONG  u,
int  digits,
int  zerofill,
int *  fieldwidth
[static]
 

Definition at line 366 of file halvprnt.c.

References putc().

Referenced by vprintf().

00367 { 00368 if (u/10) 00369 putu(u/10, digits+1, zerofill, fieldwidth); 00370 00371 if (*fieldwidth > digits) { 00372 while (*fieldwidth > digits) { 00373 if (zerofill) 00374 putc('0'); 00375 else 00376 putc(' '); 00377 *fieldwidth--; 00378 } 00379 } 00380 *fieldwidth = 0; 00381 00382 putc((char)((u%10)+'0')); 00383 }

void putx ULONG  x,
int  digits,
int  zerofill,
int *  fieldwidth
[static]
 

Definition at line 306 of file halvprnt.c.

References putc().

Referenced by vprintf().

00307 { 00308 ULONG j; 00309 00310 if (x/16) 00311 putx(x/16, digits+1, zerofill, fieldwidth); 00312 00313 if (*fieldwidth > digits) { 00314 while (*fieldwidth > digits) { 00315 if (zerofill) 00316 putc('0'); 00317 else 00318 putc(' '); 00319 *fieldwidth--; 00320 } 00321 } 00322 *fieldwidth = 0; 00323 00324 00325 if((j=x%16) > 9) 00326 putc((char)(j+'A'- 10)); 00327 else 00328 putc((char)(j+'0')); 00329 00330 }

void vprintf PCHAR  cp,
USHORT  a1
 

Definition at line 110 of file halvprnt.c.

References c, fields(), NULL, PBYTE, putc(), puti(), putu(), putx(), and USHORT.

00111 { 00112 ULONG cb; 00113 USHORT b,c; 00114 PBYTE ap; 00115 PCHAR s; 00116 PSTRING str; 00117 ULONG Flags; 00118 int zerofill, fieldwidth; 00119 00120 // 00121 // Cast a pointer to the first word on the stack 00122 // 00123 00124 ap = (PBYTE)&a1; 00125 00126 00127 // Save flags in automatic variable on stack, turn off ints. 00128 00129 _asm { 00130 pushfd 00131 pop Flags 00132 cli 00133 } 00134 00135 // 00136 // Process the argements using the descriptor string 00137 // 00138 00139 while (b = *cp++) { 00140 if (b == '%') { 00141 cp += fields(cp, &zerofill, &fieldwidth); 00142 c = *cp++; 00143 00144 switch (c) { 00145 case '.': 00146 if (*cp != '*' || cp[1] != 's') { 00147 putc((char)b); 00148 putc((char)c); 00149 break; 00150 } 00151 cp += 2; 00152 cb = *((ULONG *)ap); 00153 ap += sizeof( ULONG ); 00154 s = *((PCHAR *)ap); 00155 ap += sizeof( PCHAR ); 00156 if (s == NULL) { 00157 s = "(null)"; 00158 cb = 6; 00159 } 00160 if (cb > 0xFFF) { 00161 s = "(overflow)"; 00162 cb = 10; 00163 } 00164 00165 while (cb--) { 00166 if (*s) { 00167 putc(*s++); 00168 } else { 00169 putc(' '); 00170 } 00171 } 00172 break; 00173 00174 case 'i': 00175 case 'd': 00176 puti((long)*((int *)ap), 1, zerofill, &fieldwidth); 00177 ap += sizeof(int); 00178 break; 00179 00180 case 'S': 00181 str = *((PSTRING *)ap); 00182 ap += sizeof (STRING *); 00183 b = str->Length; 00184 s = str->Buffer; 00185 if (s == NULL) 00186 s = "(null)"; 00187 while (b--) 00188 putc(*s++); 00189 break; 00190 00191 case 's': 00192 s = *((PCHAR *)ap); 00193 ap += sizeof( PCHAR ); 00194 if (s == NULL) 00195 s = "(null)"; 00196 while (*s) 00197 putc(*s++); 00198 break; 00199 00200 case 'c': 00201 putc(*((char *)ap)); 00202 ap += sizeof(int); 00203 break; 00204 00205 00206 // 00207 // If we cannot find the status value in the table, print it in 00208 // hex. 00209 // 00210 case 'C': 00211 case 'B': 00212 // 00213 // Should search bugcodes.h to display bug code 00214 // symbolically. For now just show as hex 00215 // 00216 00217 case 'X': 00218 case 'x': 00219 putx((ULONG)*((USHORT *)ap), 1, zerofill, &fieldwidth); 00220 ap += sizeof(int); 00221 break; 00222 00223 case 'u': 00224 putu((ULONG)*((USHORT *)ap), 1, zerofill, &fieldwidth); 00225 ap += sizeof(int); 00226 break; 00227 00228 case 'l': 00229 c = *cp++; 00230 00231 switch(c) { 00232 case 'u': 00233 putu(*((ULONG *)ap), 1, zerofill, &fieldwidth); 00234 ap += sizeof(long); 00235 break; 00236 00237 case 'C': 00238 case 'B': 00239 // 00240 // Should search bugcodes.h to display bug code 00241 // symbolically. For now just show as hex 00242 // 00243 00244 case 'X': 00245 case 'x': 00246 putx(*((ULONG *)ap), 1, zerofill, &fieldwidth); 00247 ap += sizeof(long); 00248 break; 00249 00250 case 'i': 00251 case 'd': 00252 puti(*((ULONG *)ap), 1, zerofill, &fieldwidth); 00253 ap += sizeof(long); 00254 break; 00255 } // inner switch 00256 break; 00257 00258 default : 00259 putc((char)b); 00260 putc((char)c); 00261 } // outer switch 00262 } // if 00263 else 00264 putc((char)b); 00265 } // while 00266 00267 // Restore flags from automatic variable on stack 00268 00269 _asm { 00270 push Flags 00271 popfd 00272 } 00273 return; 00274 }

int xatoi char  c  )  [static]
 

Definition at line 405 of file halvprnt.c.

References c.

Referenced by fields().

00406 { 00407 return c - '0'; 00408 }


Generated on Sat May 15 19:44:01 2004 for test by doxygen 1.3.7