BWAPI
trunk/bwapi/Storm/storm.h
Go to the documentation of this file.
00001 #pragma once
00002 #include <windows.h>
00003 #include <WinUser.h>
00004 #include <Winsock.h>
00005 #include <stdio.h>
00006 #include <stdlib.h>
00007 #include <ddraw.h>
00008 
00009 /* Note to self: If you get a linker error then you were retarded
00010  *               and forgot to return a value in the cpp.
00011  */
00012 
00013 #ifndef STORMAPI
00014 #define STORMAPI __stdcall
00015 #endif
00016 
00017 #define arrsize(x) (sizeof(x)/sizeof(x[0]))   // Official name
00018 #define countof(x) arrsize(x)                 // Personal name
00019 
00020 #ifndef SMAX
00021 #define SMAX(x,y) (x < y ? y : x)
00022 #endif
00023 
00024 #ifndef SSIZEMAX
00025 #define SSIZEMAX(x,y) (SMAX(sizeof(x),sizeof(y)))
00026 #endif
00027 
00028 #ifndef SMIN
00029 #define SMIN(x,y) (x < y ? x : y)
00030 #endif
00031 
00032 #ifndef SSIZEMIN
00033 #define SSIZEMIN(x,y) (SMAX(sizeof(x),sizeof(y)))
00034 #endif
00035 
00036 #ifndef BLIZZ_STRUCTS
00037 #define BLIZZ_STRUCTS
00038 typedef struct _WRECT
00039 {
00040   WORD  left;
00041   WORD  top;
00042   WORD  right;
00043   WORD  bottom;
00044 } WRECT, *PWRECT;
00045 
00046 typedef struct _WPOINT
00047 {
00048   WORD  x;
00049   WORD  y;
00050 } WPOINT, *PWPOINT;
00051 
00052 typedef struct _WSIZE
00053 {
00054   WORD  cx;
00055   WORD  cy;
00056 } WSIZE, *PWSIZE;
00057 #endif
00058 
00059 #ifndef GAMESTATE_PRIVATE
00060 
00061 #define GAMESTATE_PRIVATE 0x01
00062 #define GAMESTATE_FULL    0x02
00063 #define GAMESTATE_ACTIVE  0x04
00064 #define GAMESTATE_STARTED 0x08
00065 #define GAMESTATE_REPLAY  0x80
00066 #endif
00067 
00068 BOOL STORMAPI SNetCreateGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID);
00069 BOOL STORMAPI SNetDestroy();
00070 BOOL STORMAPI SNetEnumProviders(int (STORMAPI *callback)(DWORD, DWORD, DWORD, DWORD), int mincaps);
00071 
00072 BOOL STORMAPI SNetEnumGames(int (STORMAPI *callback)(DWORD, DWORD, DWORD), int *hintnextcall);
00073 
00074 /*  SNetDropPlayer @ 106
00075  * 
00076  *  Drops a player from the current game.
00077  *  
00078  *  playerid:     The player ID for the player to be dropped.
00079  *  flags:        
00080  *
00081  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00082  */
00083 BOOL
00084 STORMAPI
00085 SNetDropPlayer(
00086       __in  int playerid,
00087       __in  DWORD flags);
00088 
00089 /*  SNetGetGameInfo @ 107
00090  * 
00091  *  Retrieves specific game information from Storm, such as name, password,
00092  *  stats, mode, game template, and players.
00093  *  
00094  *  type:         The type of data to retrieve. See GAMEINFO_ flags.
00095  *  dst:          The destination buffer for the data.
00096  *  length:       The maximum size of the destination buffer.
00097  *  byteswritten: The number of bytes written to the destination buffer.
00098  *
00099  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00100  */
00101 BOOL
00102 STORMAPI
00103 SNetGetGameInfo(
00104     __in  int type,
00105     __out void *dst,
00106     __in  size_t length,
00107     __out size_t *byteswritten = NULL);
00108 
00109 #ifndef SNGetGameInfo
00110 #define SNGetGameInfo(typ,dst) SNetGetGameInfo(typ, &dst, sizeof(dst));
00111 #endif
00112 
00113 #ifndef GAMEINFO_NAME
00114 
00115 #define GAMEINFO_NAME           1
00116 #define GAMEINFO_PASSWORD       2
00117 #define GAMEINFO_STATS          3
00118 #define GAMEINFO_MODEFLAG       4
00119 #define GAMEINFO_GAMETEMPLATE   5
00120 #define GAMEINFO_PLAYERS        6
00121 
00122 #endif
00123 
00124 BOOL STORMAPI SNetGetNumPlayers(int *firstplayerid, int *lastplayerid, int *activeplayers);
00125 
00126 #ifndef CAPS_STRUCT
00127 #define CAPS_STRUCT
00128 typedef struct _CAPS
00129 {
00130   DWORD dwSize;                 // Size of this structure  // sizeof(CAPS)
00131   DWORD dwUnk_0x04;
00132   DWORD maxmessagesize;         // Size of the packet buffer, must be beteen 128 and 512
00133   DWORD dwUnk_0x0C;
00134   DWORD dwDisplayedPlayerCount; // Displayed player count in the mode selection list
00135   DWORD dwUnk_0x14;             // some kind of timeout or timer related
00136   DWORD dwPlayerLatency;        // ... latency?
00137   DWORD dwPlayerCount;          // the number of players that can participate, must be between 1 and 20
00138   DWORD dwCallDelay;            // the number of calls before data is sent over the network // between 2 and 8; single player is set to 1
00139 } CAPS, *PCAPS;
00140 #endif
00141 
00142 BOOL STORMAPI SNetGetPlayerCaps(char playerid, PCAPS playerCaps);
00143 
00144 /*  SNetGetPlayerName @ 113
00145  * 
00146  *  Retrieves the name of a player given their player ID.
00147  *  
00148  *  playerid:     The player's ID.
00149  *  buffer:       The buffer that will receive the name.
00150  *  buffersize:   The maximum size of buffer.
00151  *
00152  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00153  */
00154 BOOL
00155 STORMAPI
00156 SNetGetPlayerName(
00157       __in  int playerid, 
00158       __out char *buffer, 
00159       __in  size_t buffersize);
00160 
00161 /*  SNetGetProviderCaps @ 114
00162  * 
00163  *  Retrieves network provider capacity information.
00164  *  
00165  *  providerCaps: A pointer to a CAPS structure that will receive the information.
00166  *
00167  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00168  */
00169 BOOL 
00170 STORMAPI 
00171 SNetGetProviderCaps(
00172       __out PCAPS providerCaps);
00173 
00174 /*  SNetGetTurnsInTransit @ 115
00175  * 
00176  *  Retrieves the number of turns (buffers) that have been queued
00177  *  before sending them over the network.
00178  *  
00179  *  turns: A pointer to an integer that will receive the value.
00180  *
00181  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00182  */
00183 BOOL
00184 STORMAPI
00185 SNetGetTurnsInTransit(
00186       __out int *turns);
00187 
00188 
00189 BOOL STORMAPI SNetInitializeDevice(int a1, int a2, int a3, int a4, int *a5);
00190 
00191 #ifndef PROVIDER_STRUCTS
00192 #define PROVIDER_STRUCTS
00193 typedef struct _clientInfo
00194 {
00195   DWORD dwSize; // 60
00196   char  *pszName;
00197   char  *pszVersion;
00198   DWORD dwProduct;
00199   DWORD dwVerbyte;
00200   DWORD dwUnk5;
00201   DWORD dwMaxPlayers;
00202   DWORD dwUnk7;
00203   DWORD dwUnk8;
00204   DWORD dwUnk9;
00205   DWORD dwUnk10; // 0xFF
00206   char  *pszCdKey;
00207   char  *pszCdOwner;
00208   DWORD dwIsShareware;
00209   DWORD dwLangId;
00210 } clientInfo;
00211 
00212 typedef struct _userInfo
00213 {
00214   DWORD dwSize; // 16
00215   char  *pszPlayerName;
00216   char  *pszUnknown;
00217   DWORD dwUnknown;
00218 } userInfo;
00219 
00220 typedef struct _battleInfo
00221 {
00222   DWORD dwSize;   // 92
00223   DWORD dwUnkType;
00224   HWND  hFrameWnd;
00225   void  *pfnBattleGetResource;
00226   void  *pfnBattleGetErrorString;
00227   void  *pfnBattleMakeCreateGameDialog;
00228   void  *pfnBattleUpdateIcons;
00229   DWORD dwUnk_07;
00230   void  *pfnBattleErrorDialog;
00231   void  *pfnBattlePlaySound;
00232   DWORD dwUnk_10;
00233   void  *pfnBattleGetCursorLink;
00234   DWORD dwUnk_12;
00235   void  *pfnUnk_13;
00236   DWORD dwUnk_14;
00237   void  *pfnBattleMakeProfileDialog;
00238   char  *pszProfileStrings;
00239   void  *pfnBattleDrawProfileInfo;
00240   void  *pfnUnk_18;
00241   DWORD dwUnk_19;
00242   void  *pfnUnk_20;
00243   void  *pfnUnk_21;
00244   void  *pfnBattleSetLeagueName;
00245 } battleInfo;
00246 
00247 typedef struct _moduleInfo
00248 {
00249   DWORD dwSize; // 20
00250   char  *pszVersionString;
00251   char  *pszModuleName;
00252   char  *pszMainArchive;
00253   char  *pszPatchArchive;
00254 } moduleInfo;
00255 
00256 typedef struct _gameStruc
00257 {
00258   DWORD       dwIndex;
00259   DWORD       dwGameState;
00260   DWORD       dwUnk_08;
00261   SOCKADDR    saHost;
00262   DWORD       dwUnk_1C;
00263   DWORD       dwTimer;
00264   DWORD       dwUnk_24;
00265   char        szGameName[128];
00266   char        szGameStatString[128];
00267   _gameStruc  *pNext;
00268   void        *pExtra;
00269   DWORD       dwExtraBytes;
00270   DWORD       dwProduct;
00271   DWORD       dwVersion;
00272 } gameStruc;
00273 
00274 typedef struct _stormHead
00275 {
00276   WORD wChecksum;
00277   WORD wLength;
00278   WORD wSent;
00279   WORD wReceived;
00280   BYTE bCommandClass;
00281   BYTE bCommandType;
00282   BYTE bPlayerId;
00283   BYTE bFlags;
00284 } stormHead;
00285 
00286 #endif
00287 
00288 #ifndef STRAFFIC_NORMAL
00289 
00290 #define STRAFFIC_NORMAL 0
00291 #define STRAFFIC_VERIFY 1
00292 #define STRAFFIC_RESEND 2
00293 #define STRAFFIC_REPLY  4
00294 
00295 #endif
00296 
00297 /*  SNetInitializeProvider @ 117
00298  * 
00299  *  Initializes a provider by storing the provider callbacks, and calling
00300  *  spiInitialize() using the parameters passed to this function.
00301  *  Note: The use of the parameters is determined by the network
00302  *  module.
00303  *  
00304  *  providerName:     The provider's identifier. Example: 'TENB' (BNET).
00305  *  gameClientInfo:   A pointer to a clientInfo structure containing 
00306  *                    information about the game client.
00307  *  userData:         A pointer to a userInfo structure containing information 
00308  *                    about the player.
00309  *  bnCallbacks:      A pointer to a battleInfo structure containing callbacks
00310  *                    and other information that is specific to Battle.net.
00311  *  moduleData:       A pointer to a moduleInfo structure containing the
00312  *                    executable information and paths to MPQ archives.
00313  *
00314  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00315  */
00316 BOOL
00317 STORMAPI
00318 SNetInitializeProvider(
00319       __in  DWORD       providerName, 
00320       __in  clientInfo  *gameClientInfo,
00321       __in  userInfo    *userData,
00322       __in  battleInfo  *bnCallbacks,
00323       __in  moduleInfo  *moduleData);
00324 
00325 
00326 BOOL STORMAPI SNetJoinGame(unsigned int a1, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid);
00327 
00328 /*  SNetLeaveGame @ 119
00329  * 
00330  *  Notifies Storm that the player has left the game. Storm will
00331  *  notify all connected peers through the network provider.
00332  *  
00333  *  type: The leave type. It doesn't appear to be important, no documentation available.
00334  *
00335  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00336  */
00337 BOOL
00338 STORMAPI
00339 SNetLeaveGame(
00340     __in int type);
00341 
00342 BOOL STORMAPI SNetPerformUpgrade(DWORD *upgradestatus);
00343 BOOL STORMAPI SNetReceiveMessage(int *senderplayerid, char **data, int *databytes);
00344 BOOL STORMAPI SNetReceiveTurns(int a1, int arraysize, char **arraydata, unsigned int *arraydatabytes, DWORD *arrayplayerstatus);
00345 
00346 // Values for arrayplayerstatus
00347 #ifndef SNET_PS_OK
00348 
00349 #define SNET_PS_OK             0
00350 #define SNET_PS_WAITING        2
00351 #define SNET_PS_NOTRESPONDING  3
00352 #define SNET_PS_UNKNOWN        default
00353 
00354 #endif
00355 
00356 #ifndef STORM_EVENT
00357 #define STORM_EVENT
00358 
00359 typedef struct _s_evt
00360 {
00361   DWORD dwFlags;
00362   int   dwPlayerId;
00363   void  *pData;
00364   DWORD dwSize;
00365 } S_EVT, *PS_EVT;
00366 #endif
00367 
00368 /* @TODO: "type" is unknown. */
00369 HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(PS_EVT));
00370 
00371 int  STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid);
00372 
00373 /*  SNetSendMessage @ 127
00374  * 
00375  *  Sends a message to a player given their player ID. Network message
00376  *  is sent using class 01 and is retrieved by the other client using
00377  *  SNetReceiveMessage().
00378  *  
00379  *  playerID:   The player index of the player to receive the data.
00380  *              Conversely, this field can be one of the following constants:
00381  *                  SNPLAYER_ALL      | Sends the message to all players, including oneself.
00382  *                  SNPLAYER_OTHERS   | Sends the message to all players, except for oneself.
00383  *  data:       A pointer to the data.
00384  *  databytes:  The amount of bytes that the data pointer contains.
00385  *
00386  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00387  */
00388 BOOL
00389 STORMAPI
00390 SNetSendMessage(
00391       __in int    playerID,
00392       __in void   *data,
00393       __in size_t databytes);
00394 
00395 
00396 #ifndef SNPLAYER_ALL
00397 
00398 #define SNPLAYER_ALL    -1
00399 #define SNPLAYER_OTHERS -2
00400 
00401 #endif
00402 
00403 /*  SNetSendTurn @ 128
00404  * 
00405  *  Sends a turn (data packet) to all players in the game. Network data
00406  *  is sent using class 02 and is retrieved by the other client using
00407  *  SNetReceiveTurns().
00408  *  
00409  *  data:       A pointer to the data.
00410  *  databytes:  The amount of bytes that the data pointer contains.
00411  *
00412  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00413  */
00414 BOOL
00415 STORMAPI
00416 SNetSendTurn(
00417       __in  void    *data,
00418       __in  size_t  databytes);
00419 
00420 /*  SNetSetGameMode @ 130
00421  * 
00422  *  Set's the game's mode flags, notifying the network
00423  *  provider that the state of the game has changed.
00424  *  For example: notifies Battle.net when the game is
00425  *  full.
00426  *  
00427  *  You should first call SNetGetGameInfo to retrieve
00428  *  the existing mode flags.
00429  *
00430  *  modeFlags:  The new flags for the game mode.
00431  *                  GAMESTATE_PRIVATE     | The game is passworded.
00432  *                  GAMESTATE_FULL        | The game is full.
00433  *                  GAMESTATE_ACTIVE      | The game is available.
00434  *                  GAMESTATE_STARTED     | The game is in progress.
00435  *                  GAMESTATE_REPLAY      | The game is a replay.
00436  *  a2:         The purpose of this parameter is not known
00437  *              or not used.
00438  *
00439  *  Returns TRUE if the function was called successfully and FALSE otherwise.
00440  */
00441 BOOL
00442 STORMAPI
00443 SNetSetGameMode(
00444       __in DWORD modeFlags,
00445       char a2 = 0);
00446 
00447 
00448 BOOL STORMAPI SNetEnumGamesEx(int a1, int a2, int (__fastcall *callback)(DWORD, DWORD, DWORD), int *hintnextcall);
00449 BOOL STORMAPI SNetSendServerChatCommand(const char *command);
00450 
00451 BOOL STORMAPI SNetGetPlayerNames(DWORD flags);
00452 BOOL STORMAPI SNetCreateLadderGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, DWORD dwGameLadderType, DWORD dwGameModeFlags, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID);
00453 BOOL STORMAPI SNetReportGameResult(unsigned int a1, int size, int a3, int a4, int a5);
00454 
00455 int  STORMAPI SNetSendLeagueCommand(char *cmd, char *callback);
00456 int  STORMAPI SNetSendReplayPath(int a1, int a2, char *replayPath);
00457 int  STORMAPI SNetGetLeagueName(int leagueID);
00458 BOOL STORMAPI SNet144(char *buffer);
00459 int  STORMAPI SNetLeagueLogout(char *bnetName);
00460 int  STORMAPI SNetGetLeaguePlayerName(char *curPlayerLeageName, size_t nameSize);
00461 
00462 HGDIOBJ STORMAPI SDlgDefDialogProc(HWND hDlg, signed int DlgType, HDC textLabel, HWND hWnd);
00463 
00464 HANDLE STORMAPI SDlgDialogBoxIndirectParam(HMODULE hModule, LPCSTR lpName, HWND hWndParent, LPVOID lpParam, LPARAM lParam);
00465 
00466 BOOL STORMAPI SDlgEndDialog(HWND hDlg, HANDLE nResult);
00467 
00468 BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *buffer2, char *buffer, int flags, int mask);
00469 
00470 BOOL STORMAPI SDlgBltToWindowE(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop);
00471 BOOL STORMAPI SDlgSetBitmapE(HWND hWnd, int a2, char *src, int mask1, int flags, int a6, int a7, int width, int a9, int mask2);
00472 
00473 int  STORMAPI Ordinal224(int a1);
00474 
00475 BOOL STORMAPI SFileCloseArchive(HANDLE hArchive);
00476 BOOL STORMAPI SFileCloseFile(HANDLE hFile);
00477 
00478 BOOL STORMAPI SFileDdaBeginEx(HANDLE directsound, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove, signed __int32 volume, signed int a6, int a7);
00479 BOOL STORMAPI SFileDdaDestroy();
00480 BOOL STORMAPI SFileDdaEnd(HANDLE directsound);
00481 BOOL STORMAPI SFileDdaGetPos(HANDLE directsound, int a2, int a3);
00482 
00483 BOOL STORMAPI SFileDdaInitialize(HANDLE directsound);
00484 BOOL STORMAPI SFileDdaSetVolume(HANDLE directsound, signed int bigvolume, signed int volume);
00485 
00486 BOOL STORMAPI SFileGetFileArchive(HANDLE hFile, HANDLE archive);
00487 LONG STORMAPI SFileGetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);
00488 BOOL STORMAPI SFileOpenArchive(const char *szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE *phMpq);
00489 
00490 // values for dwFlags
00491 #ifndef MPQ_NO_LISTFILE
00492 
00493 #define MPQ_NO_LISTFILE       0x0010
00494 #define MPQ_NO_ATTRIBUTES     0x0020
00495 #define MPQ_FORCE_V1          0x0040
00496 #define MPQ_CHECK_SECTOR_CRC  0x0080
00497 
00498 #endif
00499 
00500 BOOL STORMAPI SFileOpenFile(const char *filename, HANDLE *phFile);
00501 BOOL STORMAPI SFileOpenFileEx(HANDLE hMpq, const char *szFileName, DWORD dwSearchScope, HANDLE *phFile);
00502 
00503 // values for dwSearchScope
00504 #ifndef SFILE_FROM_MPQ
00505 
00506 #define SFILE_FROM_MPQ        0x00000000
00507 #define SFILE_FROM_ABSOLUTE   0x00000001
00508 #define SFILE_FROM_RELATIVE   0x00000002
00509 #define SFILE_UNKNOWN_04      0x00000004
00510 
00511 #endif
00512 
00513 BOOL STORMAPI SFileReadFile(HANDLE hFile, void *buffer, DWORD nNumberOfBytesToRead, DWORD *read, LONG lpDistanceToMoveHigh);
00514 
00515 void STORMAPI SFileSetLocale(LCID lcLocale);
00516 
00517 BOOL STORMAPI SFileSetIoErrorMode(int mode, BOOL (STORMAPI *callback)(char*,int,int) );
00518 BOOL STORMAPI SFileGetArchiveName(HANDLE hArchive, char *name, int length);
00519 BOOL STORMAPI SFileGetFileName(HANDLE hFile, char *buffer, int length);
00520 
00521 BOOL STORMAPI SFileLoadFile(char *filename, void *buffer, int buffersize, int a4, int a5);
00522 BOOL STORMAPI SFileUnloadFile(HANDLE hFile);
00523 BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, int a5, DWORD searchScope, struct _OVERLAPPED *lpOverlapped);
00524 
00525 BOOL STORMAPI SBltROP3(void *lpDstBuffer, void *lpSrcBuffer, int width, int height, int a5, int a6, int a7, DWORD rop);
00526 BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt, int a4, void *lpSrcBuffer, RECT *lpSrcRect, POINT *lpSrcPt, int a8, int a9, DWORD rop);
00527 
00528 #ifndef SBMP_DEFAULT
00529 
00530 #define SBMP_DEFAULT  0
00531 #define SBMP_BMP      1
00532 #define SBMP_PCX      2
00533 #define SBMP_TGA      3
00534 
00535 #endif
00536 
00537 
00538 /*  SBmpDecodeImage @ 321
00539  * 
00540  *  Decodes an image that has already been loaded into a buffer.
00541  *  
00542  *  dwImgType:        Optional, the image type. See SBMP_ macros.
00543  *  pSrcBuffer:       A pointer to the source buffer.
00544  *  dwSrcBuffersize:  The size of the data in the source buffer.
00545  *  pPalette:         An optional buffer that receives the image palette.
00546  *  pDstBuffer:       A buffer that receives the image data.
00547  *  dwDstBuffersize:  The size of the specified image buffer. If the size of the 
00548  *                    destination buffer is 0, then the destination buffer is not used.
00549  *  pdwWidth:         An optional variable that receives the image width.
00550  *  pdwHeight:        An optional variable that receives the image height.
00551  *  pdwBpp:           An optional variable that receives the image bits per pixel.
00552  *
00553  *  Returns TRUE if the image was supported and decoded correctly, FALSE otherwise.
00554  */
00555 BOOL 
00556 STORMAPI 
00557 SBmpDecodeImage(
00558     __in_opt  DWORD        dwImgType,
00559     __in      void         *pSrcBuffer,
00560     __in      DWORD        dwSrcBuffersize,
00561     __out_opt PALETTEENTRY *pPalette        = NULL,
00562     __out     void         *pDstBuffer      = NULL,
00563     __out     DWORD        dwDstBuffersize  = 0,
00564     __out_opt DWORD        *pdwWidth        = NULL,
00565     __out_opt DWORD        *pdwHeight       = NULL,
00566     __out_opt DWORD        *pdwBpp          = NULL);
00567 
00568 
00569 /*  SBmpLoadImage @ 323
00570  * 
00571  *  Load an image from an available archive into a buffer.
00572  *  
00573  *  pszFileName:  The name of the graphic in an active archive.
00574  *  pPalette:     An optional buffer that receives the image palette.
00575  *  pBuffer:      A buffer that receives the image data.
00576  *  dwBuffersize: The size of the specified image buffer.
00577  *  pdwWidth:     An optional variable that receives the image width.
00578  *  pdwHeight:    An optional variable that receives the image height.
00579  *  pdwBpp:       An optional variable that receives the image bits per pixel.
00580  *
00581  *  Returns TRUE if the image was supported and loaded correctly, FALSE otherwise.
00582  */
00583 BOOL
00584 STORMAPI
00585 SBmpLoadImage(
00586     __in      const char   *pszFileName,
00587     __out_opt PALETTEENTRY *pPalette    = NULL,
00588     __out     void         *pBuffer     = NULL,
00589     __out     DWORD        dwBuffersize = 0,
00590     __out_opt DWORD        *pdwWidth    = NULL,
00591     __out_opt DWORD        *pdwHeight   = NULL,
00592     __out_opt DWORD        *pdwBpp      = NULL);
00593 
00594 /*  SBmpSaveImage @ 324
00595  * 
00596  *  Save an image from a buffer to a file. The image format is determined 
00597  *  from the filename and is either .gif, .pcx, .tga, or .bmp being the default.
00598  *  
00599  *  pszFileName:  The name of the file to create.
00600  *  pPalette:     A pointer to a palette array containing 256 entries.
00601  *  pBuffer:      A buffer containing the image data.
00602  *  pdwWidth:     The width of the image.
00603  *  pdwHeight:    The height of the image.
00604  *  pdwBpp:       The bits per pixel.
00605  *
00606  *  Returns TRUE if the image was saved correctly, FALSE otherwise.
00607  */
00608 BOOL
00609 STORMAPI
00610 SBmpSaveImage(
00611     __in  const char    *pszFileName,
00612     __in  PALETTEENTRY  *pPalette,
00613     __in  void          *pBuffer,
00614     __in  DWORD         dwWidth,
00615     __in  DWORD         dwHeight,
00616     __in  DWORD         dwBpp = 8);
00617 
00618 
00619 HANDLE STORMAPI SBmpAllocLoadImage(const char *fileName, PALETTEENTRY *palette, void **buffer, int *width, int *height, int unused6, int unused7, void *(STORMAPI *allocFunction)(DWORD));
00620 
00621 BOOL STORMAPI SCodeCompile(char *directives1, char *directives2, char *loopstring, unsigned int maxiterations, unsigned int flags, HANDLE handle);
00622 BOOL STORMAPI SCodeDelete(HANDLE handle);
00623 
00624 int  STORMAPI SCodeExecute(HANDLE handle, int a2);
00625 
00626 BOOL STORMAPI SDrawAutoInitialize(HINSTANCE hInst, LPCSTR lpClassName, LPCSTR lpWindowName, WNDPROC pfnWndProc, int nMode, int nWidth, int nHeight, int nBits);
00627 
00628 
00629 /*  SDrawCaptureScreen @ 342
00630  * 
00631  *  Saves a screenshot from the primary surface being handled by Storm.
00632  *  
00633  *  pszOutput: The name of the output file. The save format is automatically set by the extension.
00634  *             The extensions supported are .gif, .pcx, .tga, and .bmp. It will write a bitmap by default.
00635  *
00636  *  Returns TRUE if successful and FALSE otherwise.
00637  */
00638 BOOL 
00639 STORMAPI 
00640 SDrawCaptureScreen(
00641     __in const char *pszOutput);
00642 
00643 
00644 /*  SDrawGetFrameWindow @ 346
00645  *
00646  *  Retrieves the window handle that was specified in
00647  *  SDrawManualInitialize or created in SDrawAutoInitialize.
00648  *  
00649  *  sdraw_framewindow: Optional variable that receives the returned handle.
00650  *
00651  *  Returns the handle of the window.
00652  */
00653 HWND
00654 STORMAPI
00655 SDrawGetFrameWindow(
00656     __out_opt HWND *sdraw_framewindow = NULL);
00657 
00658 
00659 /*  SDrawGetObjects @ 347
00660  *  
00661  *  Retrieves the object information that was initialized using
00662  *  SDrawManualInitialize or SDrawAutoInitialize.
00663  *  
00664  *  ddInterface:    The DirectDraw interface.
00665  *  primarySurface: The primary DirectDraw surface.
00666  *  surface2:       A second unknown surface.
00667  *  surface3:       A third unknown surface.
00668  *  backSurface:    The back DirectDraw surface.
00669  *  ddPalette:      The DirectDraw palette.
00670  *  hPalette:       The palette handle.
00671  *
00672  *  Returns FALSE if the direct draw interface has not been initialized.
00673  */
00674 BOOL
00675 STORMAPI
00676 SDrawGetObjects(
00677     __out_opt LPDIRECTDRAW        *ddInterface    = NULL,
00678     __out_opt LPDIRECTDRAWSURFACE *primarySurface = NULL,
00679     __out_opt LPDIRECTDRAWSURFACE *surface2       = NULL,
00680     __out_opt LPDIRECTDRAWSURFACE *surface3       = NULL,
00681     __out_opt LPDIRECTDRAWSURFACE *backSurface    = NULL,
00682     __out_opt LPDIRECTDRAWPALETTE *ddPalette      = NULL,
00683     __out_opt HPALETTE            *hPalette       = NULL);
00684 
00685 
00686 /*  SDrawGetScreenSize @ 348
00687  *  
00688  *  Obtains information for the current screen resolution.
00689  *
00690  *  pdwWidth:   Optional variable that receives the screen width.
00691  *  pdwHeight:  Optional variable that receives the screen height.
00692  *  pdwBpp:     Optional variable that receives the bits per pixel.
00693  *
00694  *  Returns FALSE if no variables were specified.
00695  */
00696 BOOL
00697 STORMAPI
00698 SDrawGetScreenSize(
00699     __out_opt DWORD *pdwWidth,
00700     __out_opt DWORD *pdwHeight,
00701     __out_opt DWORD *pdwBpp);
00702 
00703 
00704 // undefined
00705 BOOL STORMAPI SDrawLockSurface(int surfacenumber, RECT *lpDestRect, void **lplpSurface, int *lpPitch, int arg_unused);
00706 
00707 
00708 /*  SDrawManualInitialize @ 351
00709  *  
00710  *  Sets the DirectDraw variables to be referenced in Storm.
00711  *
00712  *  hWnd:           The handle of the DirectDraw window.
00713  *  ddInterface:    The DirectDraw interface.
00714  *  primarySurface: The first and primary surface.
00715  *  surface2:       A second surface. Behaviour not completely known.
00716  *  surface3:       A third surface. Behaviour not completely known.
00717  *  backSurface:    The fourth and final surface. The back surface.
00718  *  ddPalette:      The DirectDraw palette if the application requires it.
00719  *  hPalette:       The palette handle that belongs to the window.
00720  *                  If this is NULL and ddPalette is specified, then it
00721  *                  will be created automatically. A palette can be created
00722  *                  using the CreatePalette WinAPI function.
00723  *
00724  *  Returns FALSE if no variables were specified.
00725  */
00726 BOOL
00727 STORMAPI
00728 SDrawManualInitialize(
00729     __in_opt  HWND hWnd                           = NULL,
00730     __in_opt  LPDIRECTDRAW ddInterface            = NULL,
00731     __in_opt  LPDIRECTDRAWSURFACE primarySurface  = NULL,
00732     __in_opt  LPDIRECTDRAWSURFACE surface2        = NULL,
00733     __in_opt  LPDIRECTDRAWSURFACE surface3        = NULL,
00734     __in_opt  LPDIRECTDRAWSURFACE backSurface     = NULL,
00735     __in_opt  LPDIRECTDRAWPALETTE ddPalette       = NULL,
00736     __in_opt  HPALETTE hPalette                   = NULL);
00737 
00738 
00739 /*  SDrawPostClose @ 353
00740  *
00741  *  Posts a WM_QUIT message to the active drawing window specified 
00742  *  in SDrawManualInitialize or created in SDrawAutoInitialize.
00743  *
00744  *  Returns TRUE if successful and FALSE otherwise.
00745  */
00746 BOOL
00747 STORMAPI
00748 SDrawPostClose();
00749 
00750 
00751 // undefined
00752 BOOL STORMAPI SDrawRealizePalette();
00753 
00754 BOOL STORMAPI SDrawUnlockSurface(int surfacenumber, void *lpSurface, int a3, RECT *lpRect);
00755 BOOL STORMAPI SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4);
00756 
00757 BOOL STORMAPI SEvtDispatch(DWORD dwMessageID, DWORD dwFlags, int type, PS_EVT pEvent);
00758 
00759 BOOL STORMAPI SGdiDeleteObject(HANDLE handle);
00760 
00761 BOOL STORMAPI SGdiExtTextOut(int a1, int a2, int a3, int a4, unsigned int a8, signed int a6, signed int a7, const char *string, unsigned int arg20);
00762 BOOL STORMAPI SGdiImportFont(HGDIOBJ handle, int windowsfont);
00763 
00764 BOOL STORMAPI SGdiSelectObject(int handle);
00765 BOOL STORMAPI SGdiSetPitch(int pitch);
00766 
00767 BOOL STORMAPI Ordinal393(char *string, int, int);
00768 
00769 
00770 /*  SMemAlloc @ 401
00771  *  
00772  *  Allocates a block of memory. This block is different
00773  *  from the standard malloc by including a header containing
00774  *  information about the block. 
00775  *
00776  *  amount:       The amount of memory to allocate, in bytes.
00777  *  logfilename:  The name of the file or object that this call belongs to.
00778  *  logline:      The line in the file or one of the SLOG_ macros.
00779  *  defaultValue: The default value of a byte in the allocated memory.
00780  *
00781  *  Returns a pointer to the allocated memory. This pointer does NOT include
00782  *  the additional storm header.
00783  */
00784 void*
00785 STORMAPI
00786 SMemAlloc(
00787     __in  int   amount,
00788     __in  char  *logfilename,
00789     __in  int   logline,
00790     __in  char  defaultValue = 0);
00791 
00792 #ifndef SMAlloc
00793 #define SMAlloc(amount) SMemAlloc((amount), __FILE__, __LINE__)
00794 #endif
00795 
00796 
00797 /*  SMemFree @ 403
00798  *  
00799  *  Frees a block of memory that was created using SMemAlloc, 
00800  *  includes the log file and line for debugging purposes.
00801  *
00802  *  location:     The memory location to be freed.
00803  *  logfilename:  The name of the file or object that this call belongs to.
00804  *  logline:      The line in the file or one of the SLOG_ macros.
00805  *  defaultValue: 
00806  *
00807  *  Returns TRUE if the call was successful and FALSE otherwise.
00808  */
00809 BOOL
00810 STORMAPI
00811 SMemFree(
00812     __in  void *location,
00813     __in  char *logfilename,
00814     __in  int  logline,
00815     __in  char defaultValue = 0);
00816 
00817 #ifndef SMFree
00818 #define SMFree(loc) SMemFree((loc), __FILE__, __LINE__)
00819 #endif
00820 
00821 
00822 #ifndef SLOG_EXPRESSION
00823 
00824 #define SLOG_EXPRESSION    0
00825 #define SLOG_FUNCTION     -1
00826 #define SLOG_OBJECT       -2
00827 #define SLOG_HANDLE       -3
00828 #define SLOG_FILE         -4
00829 
00830 #endif
00831 
00832 BOOL STORMAPI SRegLoadData(const char *keyname, const char *valuename, int size, LPBYTE lpData, BYTE flags, LPDWORD lpcbData);
00833 BOOL STORMAPI SRegLoadString(const char *keyname, const char *valuename, BYTE flags, char *buffer, size_t buffersize);
00834 BOOL STORMAPI SRegLoadValue(const char *keyname, const char *valuename, BYTE flags, int *value);
00835 BOOL STORMAPI SRegSaveData(const char *keyname, const char *valuename, int size, BYTE *lpData, DWORD cbData);
00836 BOOL STORMAPI SRegSaveString(const char *keyname, const char *valuename, BYTE flags, char *string);
00837 BOOL STORMAPI SRegSaveValue(const char *keyname, const char *valuename, BYTE flags, DWORD result);
00838 
00839 BOOL STORMAPI SRegDeleteValue(const char *keyname, const char *valuename, BYTE flags);
00840 
00841 #ifndef SREG_NONE
00842 // Flags for SReg functions
00843 
00844 // Default behaviour checks both HKEY_LOCAL_MACHINE and HKEY_CURRENT_USER
00845 // relative to the "Software\\Blizzard Entertainment\\" key in both hives.
00846 
00847 #define SREG_NONE                   0x00000000
00848 #define SREG_EXCLUDE_LOCAL_MACHINE  0x00000001  // excludes checking the HKEY_LOCAL_MACHINE hive
00849 #define SREG_BATTLE_NET             0x00000002  // sets the relative key to "Software\\Battle.net\\" instead
00850 #define SREG_EXCLUDE_CURRENT_USER   0x00000004  // excludes checking the HKEY_CURRENT_USER hive
00851 #define SREG_ABSOLUTE               0x00000010  // specifies that the key is not a relative key
00852 
00853 #endif
00854 
00855 BOOL STORMAPI STransBlt(void *lpSurface, int x, int y, int width, HANDLE hTrans);
00856 BOOL STORMAPI STransBltUsingMask(void *lpSurface, void *lpSource, int pitch, int width, HANDLE hTrans);
00857 
00858 BOOL STORMAPI STransDelete(HANDLE hTrans);
00859 
00860 BOOL STORMAPI STransDuplicate(HANDLE hTransSource, HANDLE hTransDest);
00861 BOOL STORMAPI STransIntersectDirtyArray(HANDLE hTrans, int dirtyarraymask, unsigned __int8 dirtyarray, int sourcemask);
00862 BOOL STORMAPI STransInvertMask(HANDLE hTrans, int sourcemask);
00863 
00864 BOOL STORMAPI STransSetDirtyArrayInfo(int width, int height, int depth, int bits);
00865 
00866 BOOL STORMAPI STransPointInMask(HANDLE hTrans, int x, int y); // Name is a pure guess
00867 BOOL STORMAPI STransCombineMasks(HANDLE hTrans, int a2, int a3, int a4, int depth, int a6);
00868 
00869 BOOL STORMAPI STransCreateE(void *pBuffer, int width, int height, int bpp, int a5, int bufferSize, HANDLE *phTransOut);
00870 
00871 BOOL STORMAPI SVidDestroy();
00872 BOOL STORMAPI SVidGetSize(HANDLE video, int width, int height, int zero);
00873 BOOL STORMAPI SVidInitialize(HANDLE video);
00874 BOOL STORMAPI SVidPlayBegin(char *filename, int arg4, int a3, int a4, int a5, int a6, HANDLE video);
00875 
00876 BOOL STORMAPI SVidPlayContinueSingle(HANDLE video, int a2, int a3);
00877 BOOL STORMAPI SVidPlayEnd(HANDLE video);
00878 
00879 
00880 /*  SErrGetErrorStr @ 462
00881  *  
00882  *  Retrieves a string that describes the specified error code for
00883  *  the system, Storm, DirectDraw, or DirectSound.
00884  *
00885  *  dwErrCode:    The error code to look up.
00886  *  buffer:       The destination buffer to receive the string.
00887  *  bufferchars:  The size of the destination buffer.
00888  *
00889  *  Returns TRUE if the call was successful and FALSE otherwise.
00890  */
00891 BOOL
00892 STORMAPI
00893 SErrGetErrorStr(
00894     __in  DWORD dwErrCode,
00895     __out char *buffer,
00896     __in  size_t bufferchars);
00897 
00898 
00899 /*  SErrGetLastError @ 463
00900  *  
00901  *  Retrieves the last error that was specifically
00902  *  set for the Storm library.
00903  *
00904  *  Returns the last error set within the Storm library.
00905  */
00906 DWORD
00907 STORMAPI
00908 SErrGetLastError();
00909 
00910 
00911 /*  SErrSetLastError @ 465
00912  *  
00913  *  Sets the last error for the Storm library and the Kernel32 library.
00914  *
00915  *  dwErrCode:  The error code that will be set.
00916  */
00917 void
00918 STORMAPI
00919 SErrSetLastError(
00920     __in DWORD dwErrCode = NO_ERROR);
00921 
00922 
00923 void STORMAPI SErrSuppressErrors(BOOL suppressErrors);
00924 
00925 // Values for dwErrCode
00926 #ifndef STORM_ERROR_ASSERTION
00927 
00928 #define STORM_ERROR_ASSERTION                    0x85100000
00929 #define STORM_ERROR_BAD_ARGUMENT                 0x85100065
00930 #define STORM_ERROR_GAME_ALREADY_STARTED         0x85100066
00931 #define STORM_ERROR_GAME_FULL                    0x85100067
00932 #define STORM_ERROR_GAME_NOT_FOUND               0x85100068
00933 #define STORM_ERROR_GAME_TERMINATED              0x85100069
00934 #define STORM_ERROR_INVALID_PLAYER               0x8510006a
00935 #define STORM_ERROR_NO_MESSAGES_WAITING          0x8510006b
00936 #define STORM_ERROR_NOT_ARCHIVE                  0x8510006c
00937 #define STORM_ERROR_NOT_ENOUGH_ARGUMENTS         0x8510006d
00938 #define STORM_ERROR_NOT_IMPLEMENTED              0x8510006e
00939 #define STORM_ERROR_NOT_IN_ARCHIVE               0x8510006f
00940 #define STORM_ERROR_NOT_IN_GAME                  0x85100070
00941 #define STORM_ERROR_NOT_INITIALIZED              0x85100071
00942 #define STORM_ERROR_NOT_PLAYING                  0x85100072
00943 #define STORM_ERROR_NOT_REGISTERED               0x85100073
00944 #define STORM_ERROR_REQUIRES_CODEC1              0x85100074
00945 #define STORM_ERROR_REQUIRES_CODEC2              0x85100075
00946 #define STORM_ERROR_REQUIRES_CODEC3              0x85100076
00947 #define STORM_ERROR_REQUIRES_UPGRADE             0x85100077
00948 #define STORM_ERROR_STILL_ACTIVE                 0x85100078
00949 #define STORM_ERROR_VERSION_MISMATCH             0x85100079
00950 #define STORM_ERROR_MEM_NOT_ALLOCATED            0x8510007a
00951 #define STORM_ERROR_MEM_CORRUPTED                0x8510007b
00952 #define STORM_ERROR_MEM_INVALID                  0x8510007c
00953 #define STORM_ERROR_MEM_MANAGER_NOT_INITIALIZED  0x8510007d
00954 #define STORM_ERROR_MEM_NOT_FREED                0x8510007e
00955 #define STORM_ERROR_RESOURCES_NOT_RELEASED       0x8510007f
00956 #define STORM_ERROR_OUT_OF_BOUNDS                0x85100080
00957 #define STORM_ERROR_NULL_POINTER                 0x85100081
00958 #define STORM_ERROR_CDKEY_MISMATCH               0x85100082
00959 #define STORM_ERROR_FILE_CORRUPTED               0x85100083
00960 #define STORM_ERROR_FATAL                        0x85100084
00961 #define STORM_ERROR_GAMETYPE_UNAVAILABLE         0x85100085
00962 
00963 #endif
00964 
00965 
00966 /*  SMemCopy @ 491
00967  *  
00968  *  Copies a block of memory from source to destination.
00969  *  This function immediately calls memcpy. See online documentation
00970  *  of memcpy for more details.
00971  *
00972  *  dest:   The destination buffer.
00973  *  source: The source buffer.
00974  *  size:   The number of bytes to copy.
00975  */
00976 void
00977 STORMAPI
00978 SMemCopy(
00979     __out void *dest, 
00980     __in  const void *source, 
00981     __in  size_t size);
00982 
00983 #ifndef SMCopy
00984 #define SMCopy(d,s) ( SMemCopy(d, s, SSIZEMIN(s,d)) )
00985 #endif
00986 
00987 /*  SMemFill @ 492
00988  *  
00989  *  Fills a block of memory with the specified character.
00990  *  This function immediately calls memset. See online documentation
00991  *  of memset for more details.
00992  *
00993  *  dest:   The destination buffer.
00994  *  source: The size of the destination buffer.
00995  *  size:   The format to use.
00996  */
00997 void
00998 STORMAPI
00999 SMemFill(
01000     __in  void *location,
01001     __in  size_t length,
01002     __in  char fillWith = 0);
01003 
01004 #ifndef SMFill
01005 #define SMFill(l,f) (SMemFill(l, sizeof(l), f))
01006 #endif
01007 
01008 /*  SMemZero @ 494
01009  *  
01010  *  Fills a block of memory with the integer 0x00 (Zero).
01011  *
01012  *  location: The location to write at.
01013  *  length:   The amount of bytes to write.
01014  */
01015 void 
01016 STORMAPI 
01017 SMemZero(
01018     __in  void *location,
01019     __in  size_t length);
01020 
01021 #ifndef SMZero
01022 #define SMZero(l) (SMemZero(l, sizeof(l)))
01023 #endif
01024 
01025 int   STORMAPI SMemCmp(void *location1, void *location2, DWORD size);
01026 
01027 #ifndef SMCmp
01028 #define SMCmp(l,x) ( SMemCmp(l, x, SSIZEMIN(x,l)) )
01029 #endif
01030 
01031 /*  SStrCopy @ 501
01032  *  
01033  *  Copies a string from src to dest (including NULL terminator)
01034  *  until the max_length is reached.
01035  *
01036  *  dest:         The destination array.
01037  *  src:          The source array.
01038  *  max_length:   The maximum length of dest.
01039  *
01040  *  Returns the number of characters copied.
01041  */
01042 int
01043 STORMAPI
01044 SStrCopy(
01045     __out char *dest, 
01046     __in  const char *src,
01047     __in  int max_length = 0x7FFFFFFF);
01048 
01049 #ifndef SSCopy
01050 #define SSCopy(d,s) (SStrCopy(d, s, sizeof(d)))
01051 #endif
01052 
01053 #ifndef STORM_HASH_ABSOLUTE
01054 #define STORM_HASH_ABSOLUTE 1
01055 #endif
01056 
01057 /*  SStrHash @ 502
01058  *  
01059  *  Creates a simple hash for the string. This function
01060  *  should NOT be used for sensitive information.
01061  *
01062  *  string:   The input string.
01063  *  flags:    If STORM_HASH_ABSOLUTE is set then this
01064               function uses the absolute string, otherwise
01065               it will convert backslashes to forward
01066               slashes and some other processing.
01067  *  seed:     The hash seed. If this value is 0 then the
01068  *            default value 0x7FED7FED will be used.
01069  *
01070  *  Returns the 32-bit hash of the string.
01071  */
01072 DWORD
01073 STORMAPI
01074 SStrHash(
01075       __in  const char *string,
01076       __in  DWORD flags = 0,
01077       __in  DWORD Seed  = 0);
01078 
01079 int   STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length);
01080 
01081 /*  SStrLen @ 506
01082  *  
01083  *  Retrieves the length of a string.
01084  *
01085  *  string:   The input string of which to obtain a
01086  *            length for.
01087  *
01088  *  Returns the length of the string.
01089  */
01090 int
01091 STORMAPI
01092 SStrLen(
01093       __in  const char *string);
01094 
01095 /*  SStrCmp @ 508
01096  *  
01097  *  Compares two strings case sensitive.
01098  *
01099  *  string1:  The first string.
01100  *  string2:  The second string.
01101  *  size:     The maximum amount of characters to compare.
01102  *
01103  *  Returns 0 if strings are equal. See strcmp documentation for more details.
01104  */
01105 int
01106 STORMAPI
01107 SStrCmp(
01108       __in  const char *string1, 
01109       __in  const char *string2, 
01110       __in  size_t size);
01111 
01112 #ifndef SSCmp
01113 #define SSCmp(s,x) ( SStrCmp(s,x,SSIZEMIN(s,x)) )
01114 #endif
01115 
01116 /*  SStrCmpI @ 509
01117  *  
01118  *  Compares two strings case insensitive.
01119  *
01120  *  string1:  The first string.
01121  *  string2:  The second string.
01122  *  size:     The maximum amount of characters to compare.
01123  *
01124  *  Returns 0 if strings are equal. See strcmpi documentation for more details.
01125  */
01126 int
01127 STORMAPI
01128 SStrCmpI(
01129       __in  const char *string1, 
01130       __in  const char *string2, 
01131       __in  size_t size);
01132 
01133 #ifndef SSCmpI
01134 #define SSCmpI(s,x) ( SStrCmpI(s,x,SSIZEMIN(s,x)) )
01135 #endif
01136 
01137 /*  SStrUpper @ 510
01138  *  
01139  *  Converts all lower-case alpha characters of a string to upper-case.
01140  *
01141  *  string:   The string to convert.
01142  *  
01143  *  Returns the same pointer given in the input.
01144  */
01145 char*
01146 STORMAPI
01147 SStrUpper(
01148       __inout char* string);
01149 
01150 void  STORMAPI SRgn523(HANDLE hRgn, RECT *pRect, int a3, int a4);
01151 void  STORMAPI SRgnCreateRegion(HANDLE *hRgn, int a2);
01152 void  STORMAPI SRgnDeleteRegion(HANDLE hRgn);
01153 
01154 void  STORMAPI SRgn529i(int handle, int a2, int a3);
01155 
01156 /*  SStrChr @ 571
01157  *  
01158  *  Searches a string for the given character. See 
01159  *  strchr documentation for more details.
01160  *
01161  *  string:   The string to search.
01162  *  c:        The character to search for.
01163  *  
01164  *  Returns a pointer to the first occurance of the character.
01165  */
01166 char*
01167 STORMAPI
01168 SStrChr(
01169     __in  const char *string, 
01170     __in  char c);
01171 
01172 
01173 char *STORMAPI SStrChrR(const char *string, char c);
01174 
01175 
01176 /*  SStrVPrintf @ 578
01177  *  
01178  *  Prints a formatted string to a destination buffer.
01179  *  This function calls vsnprintf with some extra error handling.
01180  *  See online documentation of vsnprintf for more details.
01181  *
01182  *  dest:   The destination buffer.
01183  *  size:   The size of the destination buffer.
01184  *  format: The format to use.
01185  *
01186  *  Returns the number of characters written.
01187  */
01188 size_t
01189 SStrVPrintf(
01190     __out char *dest, 
01191     __in  size_t size, 
01192     __in  const char *format, ...);
01193 
01194 
01195 int STORMAPI SBigDel(void *buffer);
01196 
01197 int STORMAPI SBigFromBinary(void *buffer, const void *str, size_t size);
01198 
01199 int STORMAPI SBigNew(void **buffer);
01200 
01201 int STORMAPI SBigPowMod(void *buffer1, void *buffer2, int a3, int a4);
01202 
01203 int STORMAPI SBigToBinaryBuffer(void *buffer, int length, int a3, int a4);
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines