Remove FX_DWORD from core/ and delete definition

Review URL: https://codereview.chromium.org/1832173003
diff --git a/core/fdrm/crypto/fx_crypt.cpp b/core/fdrm/crypto/fx_crypt.cpp
index d5cbdb5..f366506 100644
--- a/core/fdrm/crypto/fx_crypt.cpp
+++ b/core/fdrm/crypto/fx_crypt.cpp
@@ -12,7 +12,7 @@
 struct rc4_state {
   int x, y, m[256];
 };
-void CRYPT_ArcFourSetup(void* context, const uint8_t* key, FX_DWORD length) {
+void CRYPT_ArcFourSetup(void* context, const uint8_t* key, uint32_t length) {
   rc4_state* s = (rc4_state*)context;
   int i, j, k, *m, a;
   s->x = 0;
@@ -32,7 +32,7 @@
     }
   }
 }
-void CRYPT_ArcFourCrypt(void* context, unsigned char* data, FX_DWORD length) {
+void CRYPT_ArcFourCrypt(void* context, unsigned char* data, uint32_t length) {
   struct rc4_state* s = (struct rc4_state*)context;
   int i, x, y, *m, a, b;
   x = s->x;
@@ -50,24 +50,24 @@
   s->y = y;
 }
 void CRYPT_ArcFourCryptBlock(uint8_t* pData,
-                             FX_DWORD size,
+                             uint32_t size,
                              const uint8_t* key,
-                             FX_DWORD keylen) {
+                             uint32_t keylen) {
   rc4_state s;
   CRYPT_ArcFourSetup(&s, key, keylen);
   CRYPT_ArcFourCrypt(&s, pData, size);
 }
 struct md5_context {
-  FX_DWORD total[2];
-  FX_DWORD state[4];
+  uint32_t total[2];
+  uint32_t state[4];
   uint8_t buffer[64];
 };
 #define GET_FX_DWORD(n, b, i)                          \
   {                                                    \
-    (n) = (FX_DWORD)((uint8_t*)b)[(i)] |               \
-          (((FX_DWORD)((uint8_t*)b)[(i) + 1]) << 8) |  \
-          (((FX_DWORD)((uint8_t*)b)[(i) + 2]) << 16) | \
-          (((FX_DWORD)((uint8_t*)b)[(i) + 3]) << 24);  \
+    (n) = (uint32_t)((uint8_t*)b)[(i)] |               \
+          (((uint32_t)((uint8_t*)b)[(i) + 1]) << 8) |  \
+          (((uint32_t)((uint8_t*)b)[(i) + 2]) << 16) | \
+          (((uint32_t)((uint8_t*)b)[(i) + 3]) << 24);  \
   }
 #define PUT_FX_DWORD(n, b, i)                                 \
   {                                                           \
@@ -77,7 +77,7 @@
     (((uint8_t*)b)[(i) + 3]) = (uint8_t)(((n) >> 24) & 0xFF); \
   }
 void md5_process(struct md5_context* ctx, const uint8_t data[64]) {
-  FX_DWORD A, B, C, D, X[16];
+  uint32_t A, B, C, D, X[16];
   GET_FX_DWORD(X[0], data, 0);
   GET_FX_DWORD(X[1], data, 4);
   GET_FX_DWORD(X[2], data, 8);
@@ -190,9 +190,9 @@
   ctx->state[2] = 0x98BADCFE;
   ctx->state[3] = 0x10325476;
 }
-void CRYPT_MD5Update(void* pctx, const uint8_t* input, FX_DWORD length) {
+void CRYPT_MD5Update(void* pctx, const uint8_t* input, uint32_t length) {
   struct md5_context* ctx = (struct md5_context*)pctx;
-  FX_DWORD left, fill;
+  uint32_t left, fill;
   if (!length) {
     return;
   }
@@ -224,7 +224,7 @@
     0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 void CRYPT_MD5Finish(void* pctx, uint8_t digest[16]) {
   struct md5_context* ctx = (struct md5_context*)pctx;
-  FX_DWORD last, padn;
+  uint32_t last, padn;
   uint8_t msglen[8];
   PUT_FX_DWORD(ctx->total[0], msglen, 0);
   PUT_FX_DWORD(ctx->total[1], msglen, 4);
@@ -238,7 +238,7 @@
   PUT_FX_DWORD(ctx->state[3], digest, 12);
 }
 void CRYPT_MD5Generate(const uint8_t* input,
-                       FX_DWORD length,
+                       uint32_t length,
                        uint8_t digest[16]) {
   md5_context ctx;
   CRYPT_MD5Start(&ctx);
@@ -246,13 +246,13 @@
   CRYPT_MD5Finish(&ctx, digest);
 }
 static FX_BOOL (*g_PubKeyDecryptor)(const uint8_t* pData,
-                                    FX_DWORD size,
+                                    uint32_t size,
                                     uint8_t* data_buf,
-                                    FX_DWORD& data_len) = NULL;
+                                    uint32_t& data_len) = NULL;
 void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData,
-                                              FX_DWORD size,
+                                              uint32_t size,
                                               uint8_t* data_buf,
-                                              FX_DWORD& data_len)) {
+                                              uint32_t& data_len)) {
   g_PubKeyDecryptor = func;
 }
 #ifdef __cplusplus
diff --git a/core/fdrm/crypto/fx_crypt_aes.cpp b/core/fdrm/crypto/fx_crypt_aes.cpp
index b56d8fe..1a6eab4 100644
--- a/core/fdrm/crypto/fx_crypt_aes.cpp
+++ b/core/fdrm/crypto/fx_crypt_aes.cpp
@@ -804,9 +804,9 @@
   FXSYS_memcpy(ctx->iv, iv, sizeof(iv));
 }
 void CRYPT_AESSetKey(void* context,
-                     FX_DWORD blocklen,
+                     uint32_t blocklen,
                      const uint8_t* key,
-                     FX_DWORD keylen,
+                     uint32_t keylen,
                      FX_BOOL bEncrypt) {
   aes_setup((AESContext*)context, blocklen, key, keylen);
 }
@@ -819,13 +819,13 @@
 void CRYPT_AESDecrypt(void* context,
                       uint8_t* dest,
                       const uint8_t* src,
-                      FX_DWORD len) {
+                      uint32_t len) {
   aes_decrypt_cbc(dest, src, len, (AESContext*)context);
 }
 void CRYPT_AESEncrypt(void* context,
                       uint8_t* dest,
                       const uint8_t* src,
-                      FX_DWORD len) {
+                      uint32_t len) {
   aes_encrypt_cbc(dest, src, len, (AESContext*)context);
 }
 #ifdef __cplusplus
diff --git a/core/fdrm/crypto/fx_crypt_sha.cpp b/core/fdrm/crypto/fx_crypt_sha.cpp
index 5f15589..28b3ce3 100644
--- a/core/fdrm/crypto/fx_crypt_sha.cpp
+++ b/core/fdrm/crypto/fx_crypt_sha.cpp
@@ -84,7 +84,7 @@
   s->blkused = 0;
   s->lenhi = s->lenlo = 0;
 }
-void CRYPT_SHA1Update(void* context, const uint8_t* data, FX_DWORD size) {
+void CRYPT_SHA1Update(void* context, const uint8_t* data, uint32_t size) {
   SHA_State* s = (SHA_State*)context;
   unsigned char* q = (unsigned char*)data;
   unsigned int wordblock[16];
@@ -147,7 +147,7 @@
   }
 }
 void CRYPT_SHA1Generate(const uint8_t* data,
-                        FX_DWORD size,
+                        uint32_t size,
                         uint8_t digest[20]) {
   SHA_State s;
   CRYPT_SHA1Start(&s);
@@ -155,14 +155,14 @@
   CRYPT_SHA1Finish(&s, digest);
 }
 typedef struct {
-  FX_DWORD total[2];
-  FX_DWORD state[8];
+  uint32_t total[2];
+  uint32_t state[8];
   uint8_t buffer[64];
 } sha256_context;
 #define GET_FX_DWORD(n, b, i)                                           \
   {                                                                     \
-    (n) = ((FX_DWORD)(b)[(i)] << 24) | ((FX_DWORD)(b)[(i) + 1] << 16) | \
-          ((FX_DWORD)(b)[(i) + 2] << 8) | ((FX_DWORD)(b)[(i) + 3]);     \
+    (n) = ((uint32_t)(b)[(i)] << 24) | ((uint32_t)(b)[(i) + 1] << 16) | \
+          ((uint32_t)(b)[(i) + 2] << 8) | ((uint32_t)(b)[(i) + 3]);     \
   }
 #define PUT_FX_DWORD(n, b, i)            \
   {                                      \
@@ -185,8 +185,8 @@
   ctx->state[7] = 0x5BE0CD19;
 }
 static void sha256_process(sha256_context* ctx, const uint8_t data[64]) {
-  FX_DWORD temp1, temp2, W[64];
-  FX_DWORD A, B, C, D, E, F, G, H;
+  uint32_t temp1, temp2, W[64];
+  uint32_t A, B, C, D, E, F, G, H;
   GET_FX_DWORD(W[0], data, 0);
   GET_FX_DWORD(W[1], data, 4);
   GET_FX_DWORD(W[2], data, 8);
@@ -300,9 +300,9 @@
   ctx->state[6] += G;
   ctx->state[7] += H;
 }
-void CRYPT_SHA256Update(void* context, const uint8_t* input, FX_DWORD length) {
+void CRYPT_SHA256Update(void* context, const uint8_t* input, uint32_t length) {
   sha256_context* ctx = (sha256_context*)context;
-  FX_DWORD left, fill;
+  uint32_t left, fill;
   if (!length) {
     return;
   }
@@ -335,8 +335,8 @@
     0,    0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
 void CRYPT_SHA256Finish(void* context, uint8_t digest[32]) {
   sha256_context* ctx = (sha256_context*)context;
-  FX_DWORD last, padn;
-  FX_DWORD high, low;
+  uint32_t last, padn;
+  uint32_t high, low;
   uint8_t msglen[8];
   high = (ctx->total[0] >> 29) | (ctx->total[1] << 3);
   low = (ctx->total[0] << 3);
@@ -356,7 +356,7 @@
   PUT_FX_DWORD(ctx->state[7], digest, 28);
 }
 void CRYPT_SHA256Generate(const uint8_t* data,
-                          FX_DWORD size,
+                          uint32_t size,
                           uint8_t digest[32]) {
   sha256_context ctx;
   CRYPT_SHA256Start(&ctx);
@@ -546,13 +546,13 @@
   ctx->state[6] += G;
   ctx->state[7] += H;
 }
-void CRYPT_SHA384Update(void* context, const uint8_t* input, FX_DWORD length) {
+void CRYPT_SHA384Update(void* context, const uint8_t* input, uint32_t length) {
   sha384_context* ctx = (sha384_context*)context;
-  FX_DWORD left, fill;
+  uint32_t left, fill;
   if (!length) {
     return;
   }
-  left = (FX_DWORD)ctx->total[0] & 0x7F;
+  left = (uint32_t)ctx->total[0] & 0x7F;
   fill = 128 - left;
   ctx->total[0] += length;
   if (ctx->total[0] < length) {
@@ -576,7 +576,7 @@
 }
 void CRYPT_SHA384Finish(void* context, uint8_t digest[48]) {
   sha384_context* ctx = (sha384_context*)context;
-  FX_DWORD last, padn;
+  uint32_t last, padn;
   uint8_t msglen[16];
   FXSYS_memset(msglen, 0, 16);
   uint64_t high, low;
@@ -584,7 +584,7 @@
   low = (ctx->total[0] << 3);
   PUT_FX_64DWORD(high, msglen, 0);
   PUT_FX_64DWORD(low, msglen, 8);
-  last = (FX_DWORD)ctx->total[0] & 0x7F;
+  last = (uint32_t)ctx->total[0] & 0x7F;
   padn = (last < 112) ? (112 - last) : (240 - last);
   CRYPT_SHA384Update(ctx, sha384_padding, padn);
   CRYPT_SHA384Update(ctx, msglen, 16);
@@ -596,7 +596,7 @@
   PUT_FX_64DWORD(ctx->state[5], digest, 40);
 }
 void CRYPT_SHA384Generate(const uint8_t* data,
-                          FX_DWORD size,
+                          uint32_t size,
                           uint8_t digest[64]) {
   sha384_context context;
   CRYPT_SHA384Start(&context);
@@ -618,12 +618,12 @@
   ctx->state[6] = FX_ato64i("1f83d9abfb41bd6b");
   ctx->state[7] = FX_ato64i("5be0cd19137e2179");
 }
-void CRYPT_SHA512Update(void* context, const uint8_t* data, FX_DWORD size) {
+void CRYPT_SHA512Update(void* context, const uint8_t* data, uint32_t size) {
   CRYPT_SHA384Update(context, data, size);
 }
 void CRYPT_SHA512Finish(void* context, uint8_t digest[64]) {
   sha384_context* ctx = (sha384_context*)context;
-  FX_DWORD last, padn;
+  uint32_t last, padn;
   uint8_t msglen[16];
   FXSYS_memset(msglen, 0, 16);
   uint64_t high, low;
@@ -631,7 +631,7 @@
   low = (ctx->total[0] << 3);
   PUT_FX_64DWORD(high, msglen, 0);
   PUT_FX_64DWORD(low, msglen, 8);
-  last = (FX_DWORD)ctx->total[0] & 0x7F;
+  last = (uint32_t)ctx->total[0] & 0x7F;
   padn = (last < 112) ? (112 - last) : (240 - last);
   CRYPT_SHA512Update(ctx, sha384_padding, padn);
   CRYPT_SHA512Update(ctx, msglen, 16);
@@ -645,7 +645,7 @@
   PUT_FX_64DWORD(ctx->state[7], digest, 56);
 }
 void CRYPT_SHA512Generate(const uint8_t* data,
-                          FX_DWORD size,
+                          uint32_t size,
                           uint8_t digest[64]) {
   sha384_context context;
   CRYPT_SHA512Start(&context);
diff --git a/core/fdrm/crypto/include/fx_crypt.h b/core/fdrm/crypto/include/fx_crypt.h
index 4563b7f..155def6 100644
--- a/core/fdrm/crypto/include/fx_crypt.h
+++ b/core/fdrm/crypto/include/fx_crypt.h
@@ -14,55 +14,55 @@
 #endif
 
 void CRYPT_ArcFourCryptBlock(uint8_t* data,
-                             FX_DWORD size,
+                             uint32_t size,
                              const uint8_t* key,
-                             FX_DWORD keylen);
-void CRYPT_ArcFourSetup(void* context, const uint8_t* key, FX_DWORD length);
-void CRYPT_ArcFourCrypt(void* context, uint8_t* data, FX_DWORD size);
+                             uint32_t keylen);
+void CRYPT_ArcFourSetup(void* context, const uint8_t* key, uint32_t length);
+void CRYPT_ArcFourCrypt(void* context, uint8_t* data, uint32_t size);
 void CRYPT_AESSetKey(void* context,
-                     FX_DWORD blocklen,
+                     uint32_t blocklen,
                      const uint8_t* key,
-                     FX_DWORD keylen,
+                     uint32_t keylen,
                      FX_BOOL bEncrypt);
 void CRYPT_AESSetIV(void* context, const uint8_t* iv);
 void CRYPT_AESDecrypt(void* context,
                       uint8_t* dest,
                       const uint8_t* src,
-                      FX_DWORD size);
+                      uint32_t size);
 void CRYPT_AESEncrypt(void* context,
                       uint8_t* dest,
                       const uint8_t* src,
-                      FX_DWORD size);
-void CRYPT_MD5Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[16]);
+                      uint32_t size);
+void CRYPT_MD5Generate(const uint8_t* data, uint32_t size, uint8_t digest[16]);
 void CRYPT_MD5Start(void* context);
-void CRYPT_MD5Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_MD5Update(void* context, const uint8_t* data, uint32_t size);
 void CRYPT_MD5Finish(void* context, uint8_t digest[16]);
-void CRYPT_SHA1Generate(const uint8_t* data, FX_DWORD size, uint8_t digest[20]);
+void CRYPT_SHA1Generate(const uint8_t* data, uint32_t size, uint8_t digest[20]);
 void CRYPT_SHA1Start(void* context);
-void CRYPT_SHA1Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA1Update(void* context, const uint8_t* data, uint32_t size);
 void CRYPT_SHA1Finish(void* context, uint8_t digest[20]);
 void CRYPT_SHA256Generate(const uint8_t* data,
-                          FX_DWORD size,
+                          uint32_t size,
                           uint8_t digest[32]);
 void CRYPT_SHA256Start(void* context);
-void CRYPT_SHA256Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA256Update(void* context, const uint8_t* data, uint32_t size);
 void CRYPT_SHA256Finish(void* context, uint8_t digest[32]);
 void CRYPT_SHA384Start(void* context);
-void CRYPT_SHA384Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA384Update(void* context, const uint8_t* data, uint32_t size);
 void CRYPT_SHA384Finish(void* context, uint8_t digest[48]);
 void CRYPT_SHA384Generate(const uint8_t* data,
-                          FX_DWORD size,
+                          uint32_t size,
                           uint8_t digest[48]);
 void CRYPT_SHA512Start(void* context);
-void CRYPT_SHA512Update(void* context, const uint8_t* data, FX_DWORD size);
+void CRYPT_SHA512Update(void* context, const uint8_t* data, uint32_t size);
 void CRYPT_SHA512Finish(void* context, uint8_t digest[64]);
 void CRYPT_SHA512Generate(const uint8_t* data,
-                          FX_DWORD size,
+                          uint32_t size,
                           uint8_t digest[64]);
 void CRYPT_SetPubKeyDecryptor(FX_BOOL (*func)(const uint8_t* pData,
-                                              FX_DWORD size,
+                                              uint32_t size,
                                               uint8_t* data_buf,
-                                              FX_DWORD& data_len));
+                                              uint32_t& data_len));
 
 #ifdef __cplusplus
 };
diff --git a/core/fpdfapi/fpdf_cmaps/cmap_int.h b/core/fpdfapi/fpdf_cmaps/cmap_int.h
index 9b8db21..685d6fe 100644
--- a/core/fpdfapi/fpdf_cmaps/cmap_int.h
+++ b/core/fpdfapi/fpdf_cmaps/cmap_int.h
@@ -26,7 +26,7 @@
                               int charset,
                               int coding,
                               const FXCMAP_CMap*& pMap);
-uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode);
-FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, uint16_t cid);
+uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, uint32_t charcode);
+uint32_t FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, uint16_t cid);
 
 #endif  // CORE_FPDFAPI_FPDF_CMAPS_CMAP_INT_H_
diff --git a/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp b/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp
index 4e0737d..3cd6106 100644
--- a/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp
+++ b/core/fpdfapi/fpdf_cmaps/fpdf_cmaps.cpp
@@ -45,7 +45,7 @@
 };
 extern "C" {
 static int compareDWordRange(const void* p1, const void* p2) {
-  FX_DWORD key = *(FX_DWORD*)p1;
+  uint32_t key = *(uint32_t*)p1;
   uint16_t hiword = (uint16_t)(key >> 16);
   uint16_t* element = (uint16_t*)p2;
   if (hiword < element[0]) {
@@ -66,8 +66,8 @@
 };
 extern "C" {
 static int compareDWordSingle(const void* p1, const void* p2) {
-  FX_DWORD key = *(FX_DWORD*)p1;
-  FX_DWORD value = ((*(uint16_t*)p2) << 16) | ((uint16_t*)p2)[1];
+  uint32_t key = *(uint32_t*)p1;
+  uint32_t value = ((*(uint16_t*)p2) << 16) | ((uint16_t*)p2)[1];
   if (key < value) {
     return -1;
   }
@@ -77,7 +77,7 @@
   return 0;
 }
 };
-uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, FX_DWORD charcode) {
+uint16_t FPDFAPI_CIDFromCharCode(const FXCMAP_CMap* pMap, uint32_t charcode) {
   if (charcode >> 16) {
     while (1) {
       if (pMap->m_DWordMapType == FXCMAP_CMap::Range) {
@@ -127,7 +127,7 @@
   }
   return 0;
 }
-FX_DWORD FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, uint16_t cid) {
+uint32_t FPDFAPI_CharCodeFromCID(const FXCMAP_CMap* pMap, uint16_t cid) {
   while (1) {
     if (pMap->m_WordMapType == FXCMAP_CMap::Single) {
       const uint16_t* pCur = pMap->m_pWordMap;
@@ -159,7 +159,7 @@
       const uint16_t* pEnd = pMap->m_pDWordMap + pMap->m_DWordCount * 4;
       while (pCur < pEnd) {
         if (cid >= pCur[3] && cid <= pCur[3] + pCur[2] - pCur[1]) {
-          return (((FX_DWORD)pCur[0] << 16) | pCur[1]) + cid - pCur[3];
+          return (((uint32_t)pCur[0] << 16) | pCur[1]) + cid - pCur[3];
         }
         pCur += 4;
       }
@@ -168,7 +168,7 @@
       const uint16_t* pEnd = pMap->m_pDWordMap + pMap->m_DWordCount * 3;
       while (pCur < pEnd) {
         if (pCur[2] == cid) {
-          return ((FX_DWORD)pCur[0] << 16) | pCur[1];
+          return ((uint32_t)pCur[0] << 16) | pCur[1];
         }
         pCur += 3;
       }
@@ -183,7 +183,7 @@
 
 void FPDFAPI_LoadCID2UnicodeMap(CIDSet charset,
                                 const uint16_t*& pMap,
-                                FX_DWORD& count) {
+                                uint32_t& count) {
   CPDF_FontGlobals* pFontGlobals =
       CPDF_ModuleMgr::Get()->GetPageModule()->GetFontGlobals();
   pMap = pFontGlobals->m_EmbeddedToUnicodes[charset].m_pMap;
diff --git a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
index 0ab34ea..5f53afd 100644
--- a/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
+++ b/core/fpdfapi/fpdf_edit/cpdf_pagecontentgenerator.cpp
@@ -91,7 +91,7 @@
   buf << "q " << pImageObj->m_Matrix << " cm ";
   if (!pImageObj->m_pImage->IsInline()) {
     CPDF_Stream* pStream = pImageObj->m_pImage->GetStream();
-    FX_DWORD dwSavedObjNum = pStream->GetObjNum();
+    uint32_t dwSavedObjNum = pStream->GetObjNum();
     CFX_ByteString name = RealizeResource(pStream, "XObject");
     if (dwSavedObjNum == 0) {
       if (pImageObj->m_pImage)
@@ -103,7 +103,7 @@
 }
 void CPDF_PageContentGenerator::ProcessForm(CFX_ByteTextBuf& buf,
                                             const uint8_t* data,
-                                            FX_DWORD size,
+                                            uint32_t size,
                                             CFX_Matrix& matrix) {
   if (!data || !size) {
     return;
diff --git a/core/fpdfapi/fpdf_edit/editint.h b/core/fpdfapi/fpdf_edit/editint.h
index eaf93d1..69a64b9 100644
--- a/core/fpdfapi/fpdf_edit/editint.h
+++ b/core/fpdfapi/fpdf_edit/editint.h
@@ -22,46 +22,46 @@
 
   FX_BOOL Start();
 
-  int32_t CompressIndirectObject(FX_DWORD dwObjNum, const CPDF_Object* pObj);
-  int32_t CompressIndirectObject(FX_DWORD dwObjNum,
+  int32_t CompressIndirectObject(uint32_t dwObjNum, const CPDF_Object* pObj);
+  int32_t CompressIndirectObject(uint32_t dwObjNum,
                                  const uint8_t* pBuffer,
-                                 FX_DWORD dwSize);
+                                 uint32_t dwSize);
 
   FX_FILESIZE End(CPDF_Creator* pCreator);
 
-  CFX_ArrayTemplate<FX_DWORD> m_ObjNumArray;
+  CFX_ArrayTemplate<uint32_t> m_ObjNumArray;
 
   CFX_ByteTextBuf m_Buffer;
-  FX_DWORD m_dwObjNum;
+  uint32_t m_dwObjNum;
   int32_t m_index;
 
  protected:
-  CFX_ArrayTemplate<FX_DWORD> m_OffsetArray;
+  CFX_ArrayTemplate<uint32_t> m_OffsetArray;
 };
 class CPDF_XRefStream {
  public:
   struct Index {
-    FX_DWORD objnum;
-    FX_DWORD count;
+    uint32_t objnum;
+    uint32_t count;
   };
 
   CPDF_XRefStream();
 
   FX_BOOL Start();
-  int32_t CompressIndirectObject(FX_DWORD dwObjNum,
+  int32_t CompressIndirectObject(uint32_t dwObjNum,
                                  const CPDF_Object* pObj,
                                  CPDF_Creator* pCreator);
-  int32_t CompressIndirectObject(FX_DWORD dwObjNum,
+  int32_t CompressIndirectObject(uint32_t dwObjNum,
                                  const uint8_t* pBuffer,
-                                 FX_DWORD dwSize,
+                                 uint32_t dwSize,
                                  CPDF_Creator* pCreator);
   FX_BOOL End(CPDF_Creator* pCreator, FX_BOOL bEOF = FALSE);
-  void AddObjectNumberToIndexArray(FX_DWORD objnum);
+  void AddObjectNumberToIndexArray(uint32_t objnum);
   FX_BOOL EndXRefStream(CPDF_Creator* pCreator);
 
   std::vector<Index> m_IndexArray;
   FX_FILESIZE m_PrevOffset;
-  FX_DWORD m_dwTempObjNum;
+  uint32_t m_dwTempObjNum;
 
  protected:
   int32_t EndObjectStream(CPDF_Creator* pCreator, FX_BOOL bEOF = TRUE);
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
index f774d01..7dc9060 100644
--- a/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
+++ b/core/fpdfapi/fpdf_edit/fpdf_edit_create.cpp
@@ -95,7 +95,7 @@
       }
       offset += 1;
       const CPDF_Array* p = pObj->AsArray();
-      for (FX_DWORD i = 0; i < p->GetCount(); i++) {
+      for (uint32_t i = 0; i < p->GetCount(); i++) {
         CPDF_Object* pElement = p->GetElement(i);
         if (pElement->GetObjNum()) {
           if (pFile->AppendString(" ") < 0) {
@@ -278,7 +278,7 @@
 }
 
 int32_t PDF_CreatorWriteEncrypt(const CPDF_Dictionary* pEncryptDict,
-                                FX_DWORD dwObjNum,
+                                uint32_t dwObjNum,
                                 CFX_FileBufferArchive* pFile) {
   if (!pEncryptDict) {
     return 0;
@@ -303,9 +303,9 @@
   return offset;
 }
 
-std::vector<uint8_t> PDF_GenerateFileID(FX_DWORD dwSeed1, FX_DWORD dwSeed2) {
-  std::vector<uint8_t> buffer(sizeof(FX_DWORD) * 4);
-  FX_DWORD* pBuffer = reinterpret_cast<FX_DWORD*>(buffer.data());
+std::vector<uint8_t> PDF_GenerateFileID(uint32_t dwSeed1, uint32_t dwSeed2) {
+  std::vector<uint8_t> buffer(sizeof(uint32_t) * 4);
+  uint32_t* pBuffer = reinterpret_cast<uint32_t*>(buffer.data());
   void* pContext = FX_Random_MT_Start(dwSeed1);
   for (int i = 0; i < 2; ++i)
     *pBuffer++ = FX_Random_MT_Generate(pContext);
@@ -338,7 +338,7 @@
   buffer.AppendByte(0);
 }
 
-void AppendIndex2(CFX_ByteTextBuf& buffer, FX_DWORD objnum, int32_t index) {
+void AppendIndex2(CFX_ByteTextBuf& buffer, uint32_t objnum, int32_t index) {
   buffer.AppendByte(2);
   buffer.AppendByte(FX_GETBYTEOFFSET24(objnum));
   buffer.AppendByte(FX_GETBYTEOFFSET16(objnum));
@@ -348,11 +348,11 @@
   buffer.AppendByte(FX_GETBYTEOFFSET0(index));
 }
 
-bool IsXRefNeedEnd(CPDF_XRefStream* pXRef, FX_DWORD flag) {
+bool IsXRefNeedEnd(CPDF_XRefStream* pXRef, uint32_t flag) {
   if (!(flag & FPDFCREATE_INCREMENTAL))
     return false;
 
-  FX_DWORD iCount = 0;
+  uint32_t iCount = 0;
   for (const auto& pair : pXRef->m_IndexArray)
     iCount += pair.count;
 
@@ -391,12 +391,12 @@
   ~CPDF_FlateEncoder();
   FX_BOOL Initialize(CPDF_Stream* pStream, FX_BOOL bFlateEncode);
   FX_BOOL Initialize(const uint8_t* pBuffer,
-                     FX_DWORD size,
+                     uint32_t size,
                      FX_BOOL bFlateEncode,
                      FX_BOOL bXRefStream = FALSE);
   void CloneDict();
   uint8_t* m_pData;
-  FX_DWORD m_dwSize;
+  uint32_t m_dwSize;
   CPDF_Dictionary* m_pDict;
   FX_BOOL m_bCloned;
   FX_BOOL m_bNewData;
@@ -450,7 +450,7 @@
   return TRUE;
 }
 FX_BOOL CPDF_FlateEncoder::Initialize(const uint8_t* pBuffer,
-                                      FX_DWORD size,
+                                      uint32_t size,
                                       FX_BOOL bFlateEncode,
                                       FX_BOOL bXRefStream) {
   if (!bFlateEncode) {
@@ -481,9 +481,9 @@
   FX_BOOL Initialize(IPDF_CryptoHandler* pHandler,
                      int objnum,
                      uint8_t* src_data,
-                     FX_DWORD src_size);
+                     uint32_t src_size);
   uint8_t* m_pData;
-  FX_DWORD m_dwSize;
+  uint32_t m_dwSize;
   FX_BOOL m_bNewBuf;
 };
 CPDF_Encryptor::CPDF_Encryptor() {
@@ -494,7 +494,7 @@
 FX_BOOL CPDF_Encryptor::Initialize(IPDF_CryptoHandler* pHandler,
                                    int objnum,
                                    uint8_t* src_data,
-                                   FX_DWORD src_size) {
+                                   uint32_t src_size) {
   if (src_size == 0) {
     return TRUE;
   }
@@ -527,16 +527,16 @@
   m_index = 0;
   return TRUE;
 }
-int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum,
+int32_t CPDF_ObjectStream::CompressIndirectObject(uint32_t dwObjNum,
                                                   const CPDF_Object* pObj) {
   m_ObjNumArray.Add(dwObjNum);
   m_OffsetArray.Add(m_Buffer.GetLength());
   m_Buffer << pObj;
   return 1;
 }
-int32_t CPDF_ObjectStream::CompressIndirectObject(FX_DWORD dwObjNum,
+int32_t CPDF_ObjectStream::CompressIndirectObject(uint32_t dwObjNum,
                                                   const uint8_t* pBuffer,
-                                                  FX_DWORD dwSize) {
+                                                  uint32_t dwSize) {
   m_ObjNumArray.Add(dwObjNum);
   m_OffsetArray.Add(m_Buffer.GetLength());
   m_Buffer.AppendBlock(pBuffer, dwSize);
@@ -569,14 +569,14 @@
     return -1;
   }
   offset += len;
-  if ((len = pFile->AppendDWord((FX_DWORD)iCount)) < 0) {
+  if ((len = pFile->AppendDWord((uint32_t)iCount)) < 0) {
     return -1;
   }
   offset += len;
   if (pFile->AppendString("/First ") < 0) {
     return -1;
   }
-  if ((len = pFile->AppendDWord((FX_DWORD)tempBuffer.GetLength())) < 0) {
+  if ((len = pFile->AppendDWord((uint32_t)tempBuffer.GetLength())) < 0) {
     return -1;
   }
   if (pFile->AppendString("/Length ") < 0) {
@@ -585,7 +585,7 @@
   offset += len + 15;
   if (!pCreator->m_bCompress && !pHandler) {
     if ((len = pFile->AppendDWord(
-             (FX_DWORD)(tempBuffer.GetLength() + m_Buffer.GetLength()))) < 0) {
+             (uint32_t)(tempBuffer.GetLength() + m_Buffer.GetLength()))) < 0) {
       return -1;
     }
     offset += len;
@@ -640,7 +640,7 @@
   m_iSeg = 0;
   return TRUE;
 }
-int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum,
+int32_t CPDF_XRefStream::CompressIndirectObject(uint32_t dwObjNum,
                                                 const CPDF_Object* pObj,
                                                 CPDF_Creator* pCreator) {
   if (!pCreator) {
@@ -653,9 +653,9 @@
   }
   return EndObjectStream(pCreator);
 }
-int32_t CPDF_XRefStream::CompressIndirectObject(FX_DWORD dwObjNum,
+int32_t CPDF_XRefStream::CompressIndirectObject(uint32_t dwObjNum,
                                                 const uint8_t* pBuffer,
-                                                FX_DWORD dwSize,
+                                                uint32_t dwSize,
                                                 CPDF_Creator* pCreator) {
   if (!pCreator) {
     return 0;
@@ -676,7 +676,7 @@
       return -1;
     }
   }
-  FX_DWORD& dwObjStmNum = m_ObjStream.m_dwObjNum;
+  uint32_t& dwObjStmNum = m_ObjStream.m_dwObjNum;
   if (!dwObjStmNum) {
     dwObjStmNum = ++pCreator->m_dwLastObjNum;
   }
@@ -687,7 +687,7 @@
       AppendIndex0(m_Buffer, true);
       m_dwTempObjNum++;
     }
-    FX_DWORD end_num = m_IndexArray.back().objnum + m_IndexArray.back().count;
+    uint32_t end_num = m_IndexArray.back().objnum + m_IndexArray.back().count;
     int index = 0;
     for (; m_dwTempObjNum < end_num; m_dwTempObjNum++) {
       FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(m_dwTempObjNum);
@@ -714,7 +714,7 @@
   }
   for (auto it = m_IndexArray.begin() + m_iSeg; it != m_IndexArray.end();
        ++it) {
-    for (FX_DWORD m = it->objnum; m < it->objnum + it->count; ++m) {
+    for (uint32_t m = it->objnum; m < it->objnum + it->count; ++m) {
       if (m_ObjStream.m_index >= iSize ||
           m != m_ObjStream.m_ObjNumArray.ElementAt(it - m_IndexArray.begin())) {
         AppendIndex1(m_Buffer, pCreator->m_ObjectOffset[m]);
@@ -737,7 +737,7 @@
 FX_BOOL CPDF_XRefStream::GenerateXRefStream(CPDF_Creator* pCreator,
                                             FX_BOOL bEOF) {
   FX_FILESIZE offset_tmp = pCreator->m_Offset;
-  FX_DWORD objnum = ++pCreator->m_dwLastObjNum;
+  uint32_t objnum = ++pCreator->m_dwLastObjNum;
   CFX_FileBufferArchive* pFile = &pCreator->m_File;
   FX_BOOL bIncremental = (pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
   if (bIncremental) {
@@ -846,7 +846,7 @@
     }
     offset += len;
     if (pCreator->m_pEncryptDict) {
-      FX_DWORD dwEncryptObjNum = pCreator->m_pEncryptDict->GetObjNum();
+      uint32_t dwEncryptObjNum = pCreator->m_pEncryptDict->GetObjNum();
       if (dwEncryptObjNum == 0) {
         dwEncryptObjNum = pCreator->m_dwEnryptObjNum;
       }
@@ -880,7 +880,7 @@
 FX_BOOL CPDF_XRefStream::EndXRefStream(CPDF_Creator* pCreator) {
   if (!(pCreator->m_dwFlags & FPDFCREATE_INCREMENTAL)) {
     AppendIndex0(m_Buffer, true);
-    for (FX_DWORD i = 1; i < pCreator->m_dwLastObjNum + 1; i++) {
+    for (uint32_t i = 1; i < pCreator->m_dwLastObjNum + 1; i++) {
       FX_FILESIZE* offset = pCreator->m_ObjectOffset.GetPtrAt(i);
       if (offset) {
         AppendIndex1(m_Buffer, *offset);
@@ -890,18 +890,18 @@
     }
   } else {
     for (const auto& pair : m_IndexArray) {
-      for (FX_DWORD j = pair.objnum; j < pair.objnum + pair.count; ++j)
+      for (uint32_t j = pair.objnum; j < pair.objnum + pair.count; ++j)
         AppendIndex1(m_Buffer, pCreator->m_ObjectOffset[j]);
     }
   }
   return GenerateXRefStream(pCreator, FALSE);
 }
-void CPDF_XRefStream::AddObjectNumberToIndexArray(FX_DWORD objnum) {
+void CPDF_XRefStream::AddObjectNumberToIndexArray(uint32_t objnum) {
   if (m_IndexArray.empty()) {
     m_IndexArray.push_back({objnum, 1});
     return;
   }
-  FX_DWORD next_objnum = m_IndexArray.back().objnum + m_IndexArray.back().count;
+  uint32_t next_objnum = m_IndexArray.back().objnum + m_IndexArray.back().count;
   if (objnum == next_objnum)
     m_IndexArray.back().count += 1;
   else
@@ -949,7 +949,7 @@
   if (!m_pXRefStream)
     return 1;
 
-  FX_DWORD objnum = pObj->GetObjNum();
+  uint32_t objnum = pObj->GetObjNum();
   if (m_pParser && m_pParser->GetObjectGenNum(objnum) > 0)
     return 1;
 
@@ -983,9 +983,9 @@
     return -1;
   return 0;
 }
-int32_t CPDF_Creator::WriteIndirectObjectToStream(FX_DWORD objnum,
+int32_t CPDF_Creator::WriteIndirectObjectToStream(uint32_t objnum,
                                                   const uint8_t* pBuffer,
-                                                  FX_DWORD dwSize) {
+                                                  uint32_t dwSize) {
   if (!m_pXRefStream) {
     return 1;
   }
@@ -1006,7 +1006,7 @@
   }
   return 0;
 }
-int32_t CPDF_Creator::AppendObjectNumberToXRef(FX_DWORD objnum) {
+int32_t CPDF_Creator::AppendObjectNumberToXRef(uint32_t objnum) {
   if (!m_pXRefStream) {
     return 1;
   }
@@ -1023,7 +1023,7 @@
   return 0;
 }
 int32_t CPDF_Creator::WriteStream(const CPDF_Object* pStream,
-                                  FX_DWORD objnum,
+                                  uint32_t objnum,
                                   IPDF_CryptoHandler* pCrypto) {
   CPDF_FlateEncoder encoder;
   encoder.Initialize(const_cast<CPDF_Stream*>(pStream->AsStream()),
@@ -1033,7 +1033,7 @@
                             encoder.m_dwSize)) {
     return -1;
   }
-  if ((FX_DWORD)encoder.m_pDict->GetIntegerBy("Length") != encryptor.m_dwSize) {
+  if ((uint32_t)encoder.m_pDict->GetIntegerBy("Length") != encryptor.m_dwSize) {
     encoder.CloneDict();
     encoder.m_pDict->SetAtInteger("Length", encryptor.m_dwSize);
   }
@@ -1055,7 +1055,7 @@
   m_Offset += len;
   return 1;
 }
-int32_t CPDF_Creator::WriteIndirectObj(FX_DWORD objnum,
+int32_t CPDF_Creator::WriteIndirectObj(uint32_t objnum,
                                        const CPDF_Object* pObj) {
   int32_t len = m_File.AppendDWord(objnum);
   if (len < 0)
@@ -1091,7 +1091,7 @@
   }
   return WriteIndirectObj(pObj->GetObjNum(), pObj);
 }
-int32_t CPDF_Creator::WriteDirectObj(FX_DWORD objnum,
+int32_t CPDF_Creator::WriteDirectObj(uint32_t objnum,
                                      const CPDF_Object* pObj,
                                      FX_BOOL bEncrypt) {
   int32_t len = 0;
@@ -1149,7 +1149,7 @@
       CPDF_Encryptor encryptor;
       IPDF_CryptoHandler* pHandler = m_pCryptoHandler;
       encryptor.Initialize(pHandler, objnum, encoder.m_pData, encoder.m_dwSize);
-      if ((FX_DWORD)encoder.m_pDict->GetIntegerBy("Length") !=
+      if ((uint32_t)encoder.m_pDict->GetIntegerBy("Length") !=
           encryptor.m_dwSize) {
         encoder.CloneDict();
         encoder.m_pDict->SetAtInteger("Length", encryptor.m_dwSize);
@@ -1198,7 +1198,7 @@
       }
       m_Offset += 1;
       const CPDF_Array* p = pObj->AsArray();
-      for (FX_DWORD i = 0; i < p->GetCount(); i++) {
+      for (uint32_t i = 0; i < p->GetCount(); i++) {
         CPDF_Object* pElement = p->GetElement(i);
         if (pElement->GetObjNum()) {
           if (m_File.AppendString(" ") < 0) {
@@ -1273,7 +1273,7 @@
   }
   return 1;
 }
-int32_t CPDF_Creator::WriteOldIndirectObject(FX_DWORD objnum) {
+int32_t CPDF_Creator::WriteOldIndirectObject(uint32_t objnum) {
   if (m_pParser->IsObjectFreeOrNull(objnum))
     return 0;
 
@@ -1297,7 +1297,7 @@
     }
   } else {
     uint8_t* pBuffer;
-    FX_DWORD size;
+    uint32_t size;
     m_pParser->GetIndirectBinary(objnum, pBuffer, size);
     if (!pBuffer) {
       return 0;
@@ -1340,11 +1340,11 @@
   return 1;
 }
 int32_t CPDF_Creator::WriteOldObjs(IFX_Pause* pPause) {
-  FX_DWORD nLastObjNum = m_pParser->GetLastObjNum();
+  uint32_t nLastObjNum = m_pParser->GetLastObjNum();
   if (!m_pParser->IsValidObjectNumber(nLastObjNum))
     return 0;
 
-  FX_DWORD objnum = (FX_DWORD)(uintptr_t)m_Pos;
+  uint32_t objnum = (uint32_t)(uintptr_t)m_Pos;
   for (; objnum <= nLastObjNum; ++objnum) {
     int32_t iRet = WriteOldIndirectObject(objnum);
     if (iRet < 0)
@@ -1364,7 +1364,7 @@
   int32_t iCount = m_NewObjNumArray.GetSize();
   int32_t index = (int32_t)(uintptr_t)m_Pos;
   while (index < iCount) {
-    FX_DWORD objnum = m_NewObjNumArray.ElementAt(index);
+    uint32_t objnum = m_NewObjNumArray.ElementAt(index);
     auto it = m_pDocument->m_IndirectObjs.find(objnum);
     if (it == m_pDocument->m_IndirectObjs.end()) {
       ++index;
@@ -1386,9 +1386,9 @@
   if (!m_pParser) {
     return;
   }
-  FX_DWORD j = 0;
-  FX_DWORD dwStart = 0;
-  FX_DWORD dwEnd = m_pParser->GetLastObjNum();
+  uint32_t j = 0;
+  uint32_t dwStart = 0;
+  uint32_t dwEnd = m_pParser->GetLastObjNum();
   while (dwStart <= dwEnd) {
     while (dwStart <= dwEnd && m_pParser->IsObjectFreeOrNull(dwStart))
       dwStart++;
@@ -1408,7 +1408,7 @@
   FX_BOOL bIncremental = (m_dwFlags & FPDFCREATE_INCREMENTAL) != 0;
   FX_BOOL bNoOriginal = (m_dwFlags & FPDFCREATE_NO_ORIGINAL) != 0;
   for (const auto& pair : m_pDocument->m_IndirectObjs) {
-    const FX_DWORD objnum = pair.first;
+    const uint32_t objnum = pair.first;
     const CPDF_Object* pObj = pair.second;
     if (pObj->GetObjNum() == -1)
       continue;
@@ -1427,7 +1427,7 @@
     return;
   }
   int32_t i = 0;
-  FX_DWORD dwStartObjNum = 0;
+  uint32_t dwStartObjNum = 0;
   FX_BOOL bCrossRefValid = m_pParser && m_pParser->GetLastXRefOffset() > 0;
   while (i < iCount) {
     dwStartObjNum = m_NewObjNumArray.ElementAt(i);
@@ -1440,11 +1440,11 @@
   if (i >= iCount) {
     return;
   }
-  FX_DWORD dwLastObjNum = dwStartObjNum;
+  uint32_t dwLastObjNum = dwStartObjNum;
   i++;
   FX_BOOL bNewStart = FALSE;
   for (; i < iCount; i++) {
-    FX_DWORD dwCurObjNum = m_NewObjNumArray.ElementAt(i);
+    uint32_t dwCurObjNum = m_NewObjNumArray.ElementAt(i);
     bool bExist = m_pParser && m_pParser->IsValidObjectNumber(dwCurObjNum) &&
                   m_ObjectOffset.GetPtrAt(dwCurObjNum);
     if (bExist || dwCurObjNum - dwLastObjNum > 1) {
@@ -1460,12 +1460,12 @@
   }
   m_ObjectOffset.Add(dwStartObjNum, dwLastObjNum - dwStartObjNum + 1);
 }
-void CPDF_Creator::AppendNewObjNum(FX_DWORD objbum) {
+void CPDF_Creator::AppendNewObjNum(uint32_t objbum) {
   int32_t iStart = 0, iFind = 0;
   int32_t iEnd = m_NewObjNumArray.GetUpperBound();
   while (iStart <= iEnd) {
     int32_t iMid = (iStart + iEnd) / 2;
-    FX_DWORD dwMid = m_NewObjNumArray.ElementAt(iMid);
+    uint32_t dwMid = m_NewObjNumArray.ElementAt(iMid);
     if (objbum < dwMid) {
       iEnd = iMid - 1;
     } else {
@@ -1473,7 +1473,7 @@
         iFind = iMid + 1;
         break;
       }
-      FX_DWORD dwNext = m_NewObjNumArray.ElementAt(iMid + 1);
+      uint32_t dwNext = m_NewObjNumArray.ElementAt(iMid + 1);
       if (objbum < dwNext) {
         iFind = iMid + 1;
         break;
@@ -1538,9 +1538,9 @@
     if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 && m_Pos) {
       IFX_FileRead* pSrcFile = m_pParser->GetFileAccess();
       uint8_t buffer[4096];
-      FX_DWORD src_size = (FX_DWORD)(uintptr_t)m_Pos;
+      uint32_t src_size = (uint32_t)(uintptr_t)m_Pos;
       while (src_size) {
-        FX_DWORD block_size = src_size > 4096 ? 4096 : src_size;
+        uint32_t block_size = src_size > 4096 ? 4096 : src_size;
         if (!pSrcFile->ReadBlock(buffer, m_Offset - src_size, block_size)) {
           return -1;
         }
@@ -1557,9 +1557,9 @@
     if ((m_dwFlags & FPDFCREATE_NO_ORIGINAL) == 0 &&
         m_pParser->GetLastXRefOffset() == 0) {
       InitOldObjNumOffsets();
-      FX_DWORD dwEnd = m_pParser->GetLastObjNum();
+      uint32_t dwEnd = m_pParser->GetLastObjNum();
       bool bObjStm = (m_dwFlags & FPDFCREATE_OBJECTSTREAM) != 0;
-      for (FX_DWORD objnum = 0; objnum <= dwEnd; objnum++) {
+      for (uint32_t objnum = 0; objnum <= dwEnd; objnum++) {
         if (m_pParser->IsObjectFreeOrNull(objnum))
           continue;
 
@@ -1627,7 +1627,7 @@
 }
 int32_t CPDF_Creator::WriteDoc_Stage3(IFX_Pause* pPause) {
   FXSYS_assert(m_iStage >= 80 || m_iStage < 90);
-  FX_DWORD dwLastObjNum = m_dwLastObjNum;
+  uint32_t dwLastObjNum = m_dwLastObjNum;
   if (m_iStage == 80) {
     m_XrefStart = m_Offset;
     if (m_dwFlags & FPDFCREATE_OBJECTSTREAM) {
@@ -1660,7 +1660,7 @@
   }
   if (m_iStage == 81) {
     CFX_ByteString str;
-    FX_DWORD i = (FX_DWORD)(uintptr_t)m_Pos, j;
+    uint32_t i = (uint32_t)(uintptr_t)m_Pos, j;
     while (i <= dwLastObjNum) {
       while (i <= dwLastObjNum && !m_ObjectOffset.GetPtrAt(i)) {
         i++;
@@ -1702,12 +1702,12 @@
     int32_t i = (int32_t)(uintptr_t)m_Pos;
     while (i < iCount) {
       int32_t j = i;
-      FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
+      uint32_t objnum = m_NewObjNumArray.ElementAt(i);
       while (j < iCount) {
         if (++j == iCount) {
           break;
         }
-        FX_DWORD dwCurrent = m_NewObjNumArray.ElementAt(j);
+        uint32_t dwCurrent = m_NewObjNumArray.ElementAt(j);
         if (dwCurrent - objnum > 1) {
           break;
         }
@@ -1817,7 +1817,7 @@
       if (m_File.AppendString("/Encrypt") < 0) {
         return -1;
       }
-      FX_DWORD dwObjNum = m_pEncryptDict->GetObjNum();
+      uint32_t dwObjNum = m_pEncryptDict->GetObjNum();
       if (dwObjNum == 0) {
         dwObjNum = m_pDocument->GetLastObjNum() + 1;
       }
@@ -1870,7 +1870,7 @@
       }
       if ((m_dwFlags & FPDFCREATE_INCREMENTAL) != 0 && m_pParser &&
           m_pParser->GetLastXRefOffset() == 0) {
-        FX_DWORD i = 0;
+        uint32_t i = 0;
         for (i = 0; i < m_dwLastObjNum; i++) {
           if (!m_ObjectOffset.GetPtrAt(i)) {
             continue;
@@ -1902,7 +1902,7 @@
         int count = m_NewObjNumArray.GetSize();
         int32_t i = 0;
         for (i = 0; i < count; i++) {
-          FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
+          uint32_t objnum = m_NewObjNumArray.ElementAt(i);
           if (m_File.AppendDWord(objnum) < 0) {
             return -1;
           }
@@ -1920,7 +1920,7 @@
           return -1;
         }
         for (i = 0; i < count; i++) {
-          FX_DWORD objnum = m_NewObjNumArray.ElementAt(i);
+          uint32_t objnum = m_NewObjNumArray.ElementAt(i);
           FX_FILESIZE offset = m_ObjectOffset[objnum];
           OutputIndex(&m_File, offset);
         }
@@ -1956,12 +1956,12 @@
   }
 }
 
-bool CPDF_Creator::Create(IFX_StreamWrite* pFile, FX_DWORD flags) {
+bool CPDF_Creator::Create(IFX_StreamWrite* pFile, uint32_t flags) {
   m_File.AttachFile(pFile);
   return Create(flags);
 }
 
-bool CPDF_Creator::Create(FX_DWORD flags) {
+bool CPDF_Creator::Create(uint32_t flags) {
   m_dwFlags = flags;
   m_iStage = 0;
   m_Offset = 0;
@@ -1984,7 +1984,7 @@
       m_pIDArray->Add(pID1->Clone());
     } else {
       std::vector<uint8_t> buffer =
-          PDF_GenerateFileID((FX_DWORD)(uintptr_t) this, m_dwLastObjNum);
+          PDF_GenerateFileID((uint32_t)(uintptr_t) this, m_dwLastObjNum);
       CFX_ByteStringC bsBuffer(buffer.data(), buffer.size());
       m_pIDArray->Add(new CPDF_String(bsBuffer, TRUE), m_pDocument);
     }
@@ -1999,7 +1999,7 @@
       return;
     }
     std::vector<uint8_t> buffer =
-        PDF_GenerateFileID((FX_DWORD)(uintptr_t) this, m_dwLastObjNum);
+        PDF_GenerateFileID((uint32_t)(uintptr_t) this, m_dwLastObjNum);
     CFX_ByteStringC bsBuffer(buffer.data(), buffer.size());
     m_pIDArray->Add(new CPDF_String(bsBuffer, TRUE), m_pDocument);
     return;
@@ -2009,7 +2009,7 @@
     if (m_pEncryptDict->GetStringBy("Filter") == "Standard") {
       CPDF_StandardSecurityHandler handler;
       CFX_ByteString user_pass = m_pParser->GetPassword();
-      FX_DWORD flag = PDF_ENCRYPT_CONTENT;
+      uint32_t flag = PDF_ENCRYPT_CONTENT;
       handler.OnCreate(m_pEncryptDict, m_pIDArray, (const uint8_t*)user_pass,
                        user_pass.GetLength(), flag);
       if (m_bNewCrypto) {
diff --git a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
index 8e1072a..0f75cb0 100644
--- a/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
+++ b/core/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp
@@ -446,7 +446,7 @@
   return uHashCode;
 }
 struct FX_LANG2CS {
-  FX_DWORD uLang;
+  uint32_t uLang;
   int uCharset;
 } * FX_LPLANG2CS;
 static const FX_LANG2CS gs_FXLang2CharsetTable[] = {
@@ -501,11 +501,11 @@
   free(pBuffer);
 }
 FX_BOOL IsHasCharSet(CFArrayRef languages,
-                     const CFX_ArrayTemplate<FX_DWORD>& charSets) {
+                     const CFX_ArrayTemplate<uint32_t>& charSets) {
   int iCount = charSets.GetSize();
   for (int i = 0; i < CFArrayGetCount(languages); ++i) {
     CFStringRef language = (CFStringRef)CFArrayGetValueAtIndex(languages, i);
-    FX_DWORD CharSet = FX_GetCharsetFromLang(
+    uint32_t CharSet = FX_GetCharsetFromLang(
         CFStringGetCStringPtr(language, kCFStringEncodingMacRoman), -1);
     for (int j = 0; j < iCount; ++j) {
       if (CharSet == charSets[j]) {
@@ -572,7 +572,7 @@
     CFRelease(descriptor);
     return NULL;
   }
-  CFX_ArrayTemplate<FX_DWORD> charSets;
+  CFX_ArrayTemplate<uint32_t> charSets;
   charSets.Add(FXFONT_CHINESEBIG5_CHARSET);
   charSets.Add(FXFONT_GB2312_CHARSET);
   charSets.Add(FXFONT_HANGEUL_CHARSET);
@@ -1008,7 +1008,7 @@
   } else {
     static const FX_CHAR stem_chars[] = {'i', 'I', '!', '1'};
     const size_t count = sizeof(stem_chars) / sizeof(stem_chars[0]);
-    FX_DWORD glyph = pEncoding->GlyphFromCharCode(stem_chars[0]);
+    uint32_t glyph = pEncoding->GlyphFromCharCode(stem_chars[0]);
     nStemV = pFont->GetGlyphWidth(glyph);
     for (size_t i = 1; i < count; i++) {
       glyph = pEncoding->GlyphFromCharCode(stem_chars[i]);
@@ -1076,7 +1076,7 @@
 static int InsertNewPage(CPDF_Document* pDoc,
                          int iPage,
                          CPDF_Dictionary* pPageDict,
-                         CFX_ArrayTemplate<FX_DWORD>& pageList) {
+                         CFX_ArrayTemplate<uint32_t>& pageList) {
   CPDF_Dictionary* pRoot = pDoc->GetRoot();
   if (!pRoot) {
     return -1;
@@ -1111,7 +1111,7 @@
 CPDF_Dictionary* CPDF_Document::CreateNewPage(int iPage) {
   CPDF_Dictionary* pDict = new CPDF_Dictionary;
   pDict->SetAtName("Type", "Page");
-  FX_DWORD dwObjNum = AddIndirectObject(pDict);
+  uint32_t dwObjNum = AddIndirectObject(pDict);
   if (InsertNewPage(this, iPage, pDict, m_PageList) < 0) {
     ReleaseIndirectObject(dwObjNum);
     return NULL;
diff --git a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
index ad776a2..d6a1c10 100644
--- a/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
+++ b/core/fpdfapi/fpdf_edit/include/cpdf_creator.h
@@ -30,7 +30,7 @@
   ~CPDF_Creator();
 
   void RemoveSecurity();
-  bool Create(IFX_StreamWrite* pFile, FX_DWORD flags = 0);
+  bool Create(IFX_StreamWrite* pFile, uint32_t flags = 0);
   int32_t Continue(IFX_Pause* pPause = NULL);
   FX_BOOL SetFileVersion(int32_t fileVersion = 17);
 
@@ -38,7 +38,7 @@
   friend class CPDF_ObjectStream;
   friend class CPDF_XRefStream;
 
-  bool Create(FX_DWORD flags);
+  bool Create(uint32_t flags);
   void ResetStandardSecurity();
   void Clear();
 
@@ -46,29 +46,29 @@
   void InitNewObjNumOffsets();
   void InitID(FX_BOOL bDefault = TRUE);
 
-  void AppendNewObjNum(FX_DWORD objbum);
-  int32_t AppendObjectNumberToXRef(FX_DWORD objnum);
+  void AppendNewObjNum(uint32_t objbum);
+  int32_t AppendObjectNumberToXRef(uint32_t objnum);
 
   int32_t WriteDoc_Stage1(IFX_Pause* pPause);
   int32_t WriteDoc_Stage2(IFX_Pause* pPause);
   int32_t WriteDoc_Stage3(IFX_Pause* pPause);
   int32_t WriteDoc_Stage4(IFX_Pause* pPause);
 
-  int32_t WriteOldIndirectObject(FX_DWORD objnum);
+  int32_t WriteOldIndirectObject(uint32_t objnum);
   int32_t WriteOldObjs(IFX_Pause* pPause);
   int32_t WriteNewObjs(FX_BOOL bIncremental, IFX_Pause* pPause);
   int32_t WriteIndirectObj(const CPDF_Object* pObj);
-  int32_t WriteDirectObj(FX_DWORD objnum,
+  int32_t WriteDirectObj(uint32_t objnum,
                          const CPDF_Object* pObj,
                          FX_BOOL bEncrypt = TRUE);
   int32_t WriteIndirectObjectToStream(const CPDF_Object* pObj);
-  int32_t WriteIndirectObj(FX_DWORD objnum, const CPDF_Object* pObj);
-  int32_t WriteIndirectObjectToStream(FX_DWORD objnum,
+  int32_t WriteIndirectObj(uint32_t objnum, const CPDF_Object* pObj);
+  int32_t WriteIndirectObjectToStream(uint32_t objnum,
                                       const uint8_t* pBuffer,
-                                      FX_DWORD dwSize);
+                                      uint32_t dwSize);
 
   int32_t WriteStream(const CPDF_Object* pStream,
-                      FX_DWORD objnum,
+                      uint32_t objnum,
                       IPDF_CryptoHandler* pCrypto);
 
   CPDF_Document* m_pDocument;
@@ -76,7 +76,7 @@
   FX_BOOL m_bCompress;
   FX_BOOL m_bSecurityChanged;
   CPDF_Dictionary* m_pEncryptDict;
-  FX_DWORD m_dwEnryptObjNum;
+  uint32_t m_dwEnryptObjNum;
   FX_BOOL m_bEncryptCloned;
   FX_BOOL m_bStandardSecurity;
   IPDF_CryptoHandler* m_pCryptoHandler;
@@ -85,15 +85,15 @@
   CPDF_Object* m_pMetadata;
   CPDF_XRefStream* m_pXRefStream;
   int32_t m_ObjectStreamSize;
-  FX_DWORD m_dwLastObjNum;
+  uint32_t m_dwLastObjNum;
   CFX_FileBufferArchive m_File;
   FX_FILESIZE m_Offset;
   int32_t m_iStage;
-  FX_DWORD m_dwFlags;
+  uint32_t m_dwFlags;
   FX_POSITION m_Pos;
   FX_FILESIZE m_XrefStart;
   CFX_FileSizeListArray m_ObjectOffset;
-  CFX_ArrayTemplate<FX_DWORD> m_NewObjNumArray;
+  CFX_ArrayTemplate<uint32_t> m_NewObjNumArray;
   CPDF_Array* m_pIDArray;
   int32_t m_FileVersion;
 };
diff --git a/core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h b/core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h
index 53446c3..564a9ff 100644
--- a/core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h
+++ b/core/fpdfapi/fpdf_edit/include/cpdf_pagecontentgenerator.h
@@ -29,7 +29,7 @@
   void ProcessImage(CFX_ByteTextBuf& buf, CPDF_ImageObject* pImageObj);
   void ProcessForm(CFX_ByteTextBuf& buf,
                    const uint8_t* data,
-                   FX_DWORD size,
+                   uint32_t size,
                    CFX_Matrix& matrix);
   CFX_ByteString RealizeResource(CPDF_Object* pResourceObj,
                                  const FX_CHAR* szType);
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
index 956046c..9dd045e 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
@@ -124,7 +124,7 @@
 
 FX_WCHAR EmbeddedUnicodeFromCharcode(const FXCMAP_CMap* pEmbedMap,
                                      CIDSet charset,
-                                     FX_DWORD charcode) {
+                                     uint32_t charcode) {
   if (!IsValidEmbeddedCharcodeFromUnicodeCharset(charset))
     return 0;
 
@@ -143,7 +143,7 @@
   return 0;
 }
 
-FX_DWORD EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap,
+uint32_t EmbeddedCharcodeFromUnicode(const FXCMAP_CMap* pEmbedMap,
                                      CIDSet charset,
                                      FX_WCHAR unicode) {
   if (!IsValidEmbeddedCharcodeFromUnicodeCharset(charset))
@@ -158,7 +158,7 @@
   int nCodes = pFontGlobals->m_EmbeddedToUnicodes[charset].m_Count;
   for (int i = 0; i < nCodes; ++i) {
     if (pCodes[i] == unicode) {
-      FX_DWORD CharCode = FPDFAPI_CharCodeFromCID(pEmbedMap, i);
+      uint32_t CharCode = FPDFAPI_CharCodeFromCID(pEmbedMap, i);
       if (CharCode != 0) {
         return CharCode;
       }
@@ -234,7 +234,7 @@
   return this;
 }
 
-uint16_t CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const {
+uint16_t CPDF_CIDFont::CIDFromCharCode(uint32_t charcode) const {
   if (!m_pCMap) {
     return (uint16_t)charcode;
   }
@@ -245,7 +245,7 @@
   return m_pCMap ? m_pCMap->IsVertWriting() : FALSE;
 }
 
-CFX_WideString CPDF_CIDFont::UnicodeFromCharCode(FX_DWORD charcode) const {
+CFX_WideString CPDF_CIDFont::UnicodeFromCharCode(uint32_t charcode) const {
   CFX_WideString str = CPDF_Font::UnicodeFromCharCode(charcode);
   if (!str.IsEmpty())
     return str;
@@ -255,7 +255,7 @@
   return ret;
 }
 
-FX_WCHAR CPDF_CIDFont::GetUnicodeFromCharCode(FX_DWORD charcode) const {
+FX_WCHAR CPDF_CIDFont::GetUnicodeFromCharCode(uint32_t charcode) const {
   switch (m_pCMap->m_Coding) {
     case CIDCODING_UCS2:
     case CIDCODING_UTF16:
@@ -293,8 +293,8 @@
   return m_pCID2UnicodeMap->UnicodeFromCID(CIDFromCharCode(charcode));
 }
 
-FX_DWORD CPDF_CIDFont::CharCodeFromUnicode(FX_WCHAR unicode) const {
-  FX_DWORD charcode = CPDF_Font::CharCodeFromUnicode(unicode);
+uint32_t CPDF_CIDFont::CharCodeFromUnicode(FX_WCHAR unicode) const {
+  uint32_t charcode = CPDF_Font::CharCodeFromUnicode(unicode);
   if (charcode)
     return charcode;
   switch (m_pCMap->m_Coding) {
@@ -307,7 +307,7 @@
       if (!m_pCID2UnicodeMap || !m_pCID2UnicodeMap->IsLoaded()) {
         return 0;
       }
-      FX_DWORD CID = 0;
+      uint32_t CID = 0;
       while (CID < 65536) {
         FX_WCHAR this_unicode =
             m_pCID2UnicodeMap->UnicodeFromCID((uint16_t)CID);
@@ -321,7 +321,7 @@
   }
 
   if (unicode < 0x80) {
-    return static_cast<FX_DWORD>(unicode);
+    return static_cast<uint32_t>(unicode);
   }
   if (m_pCMap->m_Coding == CIDCODING_CID) {
     return 0;
@@ -466,7 +466,7 @@
   return TRUE;
 }
 
-FX_RECT CPDF_CIDFont::GetCharBBox(FX_DWORD charcode, int level) {
+FX_RECT CPDF_CIDFont::GetCharBBox(uint32_t charcode, int level) {
   if (charcode < 256 && m_CharBBox[charcode].right != FX_SMALL_RECT::kInvalid)
     return FX_RECT(m_CharBBox[charcode]);
 
@@ -538,13 +538,13 @@
 
   return rect;
 }
-int CPDF_CIDFont::GetCharWidthF(FX_DWORD charcode, int level) {
+int CPDF_CIDFont::GetCharWidthF(uint32_t charcode, int level) {
   if (m_pAnsiWidths && charcode < 0x80) {
     return m_pAnsiWidths[charcode];
   }
   uint16_t cid = CIDFromCharCode(charcode);
   int size = m_WidthList.GetSize();
-  FX_DWORD* list = m_WidthList.GetData();
+  uint32_t* list = m_WidthList.GetData();
   for (int i = 0; i < size; i += 3) {
     if (cid >= list[i] && cid <= list[i + 1]) {
       return (int)list[i + 2];
@@ -553,31 +553,31 @@
   return m_DefaultWidth;
 }
 short CPDF_CIDFont::GetVertWidth(uint16_t CID) const {
-  FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
+  uint32_t vertsize = m_VertMetrics.GetSize() / 5;
   if (vertsize == 0) {
     return m_DefaultW1;
   }
-  const FX_DWORD* pTable = m_VertMetrics.GetData();
-  for (FX_DWORD i = 0; i < vertsize; i++)
+  const uint32_t* pTable = m_VertMetrics.GetData();
+  for (uint32_t i = 0; i < vertsize; i++)
     if (pTable[i * 5] <= CID && pTable[i * 5 + 1] >= CID) {
       return (short)(int)pTable[i * 5 + 2];
     }
   return m_DefaultW1;
 }
 void CPDF_CIDFont::GetVertOrigin(uint16_t CID, short& vx, short& vy) const {
-  FX_DWORD vertsize = m_VertMetrics.GetSize() / 5;
+  uint32_t vertsize = m_VertMetrics.GetSize() / 5;
   if (vertsize) {
-    const FX_DWORD* pTable = m_VertMetrics.GetData();
-    for (FX_DWORD i = 0; i < vertsize; i++)
+    const uint32_t* pTable = m_VertMetrics.GetData();
+    for (uint32_t i = 0; i < vertsize; i++)
       if (pTable[i * 5] <= CID && pTable[i * 5 + 1] >= CID) {
         vx = (short)(int)pTable[i * 5 + 3];
         vy = (short)(int)pTable[i * 5 + 4];
         return;
       }
   }
-  FX_DWORD dwWidth = m_DefaultWidth;
+  uint32_t dwWidth = m_DefaultWidth;
   int size = m_WidthList.GetSize();
-  const FX_DWORD* list = m_WidthList.GetData();
+  const uint32_t* list = m_WidthList.GetData();
   for (int i = 0; i < size; i += 3) {
     if (CID >= list[i] && CID <= list[i + 1]) {
       dwWidth = (uint16_t)list[i + 2];
@@ -587,7 +587,7 @@
   vx = (short)dwWidth / 2;
   vy = (short)m_DefaultVY;
 }
-int CPDF_CIDFont::GetGlyphIndex(FX_DWORD unicode, FX_BOOL* pVertGlyph) {
+int CPDF_CIDFont::GetGlyphIndex(uint32_t unicode, FX_BOOL* pVertGlyph) {
   if (pVertGlyph) {
     *pVertGlyph = FALSE;
   }
@@ -637,7 +637,7 @@
   }
   return index;
 }
-int CPDF_CIDFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph) {
+int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, FX_BOOL* pVertGlyph) {
   if (pVertGlyph) {
     *pVertGlyph = FALSE;
   }
@@ -695,7 +695,7 @@
         if (bMSUnicode) {
           index = FXFT_Get_Char_Index(face, unicode);
         } else if (bMacRoman) {
-          FX_DWORD maccode =
+          uint32_t maccode =
               FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, unicode);
           index = !maccode ? FXFT_Get_Name_Index(face, (char*)name)
                            : FXFT_Get_Char_Index(face, maccode);
@@ -726,7 +726,7 @@
     if (err != 0) {
       int i;
       for (i = 0; i < FXFT_Get_Face_CharmapCount(face); i++) {
-        FX_DWORD ret = FT_CharCodeFromUnicode(
+        uint32_t ret = FT_CharCodeFromUnicode(
             FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i]),
             (FX_WCHAR)charcode);
         if (ret == 0) {
@@ -776,25 +776,25 @@
       return GetGlyphIndex(charcode, pVertGlyph);
     }
   }
-  FX_DWORD byte_pos = cid * 2;
+  uint32_t byte_pos = cid * 2;
   if (byte_pos + 2 > m_pCIDToGIDMap->GetSize())
     return -1;
 
   const uint8_t* pdata = m_pCIDToGIDMap->GetData() + byte_pos;
   return pdata[0] * 256 + pdata[1];
 }
-FX_DWORD CPDF_CIDFont::GetNextChar(const FX_CHAR* pString,
+uint32_t CPDF_CIDFont::GetNextChar(const FX_CHAR* pString,
                                    int nStrLen,
                                    int& offset) const {
   return m_pCMap->GetNextChar(pString, nStrLen, offset);
 }
-int CPDF_CIDFont::GetCharSize(FX_DWORD charcode) const {
+int CPDF_CIDFont::GetCharSize(uint32_t charcode) const {
   return m_pCMap->GetCharSize(charcode);
 }
 int CPDF_CIDFont::CountChar(const FX_CHAR* pString, int size) const {
   return m_pCMap->CountChar(pString, size);
 }
-int CPDF_CIDFont::AppendChar(FX_CHAR* str, FX_DWORD charcode) const {
+int CPDF_CIDFont::AppendChar(FX_CHAR* str, uint32_t charcode) const {
   return m_pCMap->AppendChar(str, charcode);
 }
 FX_BOOL CPDF_CIDFont::IsUnicodeCompatible() const {
@@ -804,7 +804,7 @@
   }
   return TRUE;
 }
-FX_BOOL CPDF_CIDFont::IsFontStyleFromCharCode(FX_DWORD charcode) const {
+FX_BOOL CPDF_CIDFont::IsFontStyleFromCharCode(uint32_t charcode) const {
   return TRUE;
 }
 void CPDF_CIDFont::LoadSubstFont() {
@@ -812,14 +812,14 @@
                    g_CharsetCPs[m_Charset], IsVertWriting());
 }
 void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
-                                    CFX_ArrayTemplate<FX_DWORD>& result,
+                                    CFX_ArrayTemplate<uint32_t>& result,
                                     int nElements) {
   int width_status = 0;
   int iCurElement = 0;
   int first_code = 0;
   int last_code = 0;
-  FX_DWORD count = pArray->GetCount();
-  for (FX_DWORD i = 0; i < count; i++) {
+  uint32_t count = pArray->GetCount();
+  for (uint32_t i = 0; i < count; i++) {
     CPDF_Object* pObj = pArray->GetElementValue(i);
     if (!pObj)
       continue;
@@ -828,8 +828,8 @@
       if (width_status != 1)
         return;
 
-      FX_DWORD count = pArray->GetCount();
-      for (FX_DWORD j = 0; j < count; j += nElements) {
+      uint32_t count = pArray->GetCount();
+      for (uint32_t j = 0; j < count; j += nElements) {
         result.Add(first_code);
         result.Add(first_code);
         for (int k = 0; k < nElements; k++) {
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.h b/core/fpdfapi/fpdf_font/cpdf_cidfont.h
index 6405d2c..9beb7cb 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.h
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.h
@@ -38,35 +38,35 @@
   bool IsCIDFont() const override;
   const CPDF_CIDFont* AsCIDFont() const override;
   CPDF_CIDFont* AsCIDFont() override;
-  int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override;
-  int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
-  FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override;
-  FX_DWORD GetNextChar(const FX_CHAR* pString,
+  int GlyphFromCharCode(uint32_t charcode, FX_BOOL* pVertGlyph = NULL) override;
+  int GetCharWidthF(uint32_t charcode, int level = 0) override;
+  FX_RECT GetCharBBox(uint32_t charcode, int level = 0) override;
+  uint32_t GetNextChar(const FX_CHAR* pString,
                        int nStrLen,
                        int& offset) const override;
   int CountChar(const FX_CHAR* pString, int size) const override;
-  int AppendChar(FX_CHAR* str, FX_DWORD charcode) const override;
-  int GetCharSize(FX_DWORD charcode) const override;
+  int AppendChar(FX_CHAR* str, uint32_t charcode) const override;
+  int GetCharSize(uint32_t charcode) const override;
   FX_BOOL IsVertWriting() const override;
   FX_BOOL IsUnicodeCompatible() const override;
   FX_BOOL Load() override;
-  CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override;
-  FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override;
+  CFX_WideString UnicodeFromCharCode(uint32_t charcode) const override;
+  uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const override;
 
   FX_BOOL LoadGB2312();
-  uint16_t CIDFromCharCode(FX_DWORD charcode) const;
+  uint16_t CIDFromCharCode(uint32_t charcode) const;
   const uint8_t* GetCIDTransform(uint16_t CID) const;
   short GetVertWidth(uint16_t CID) const;
   void GetVertOrigin(uint16_t CID, short& vx, short& vy) const;
-  virtual FX_BOOL IsFontStyleFromCharCode(FX_DWORD charcode) const;
+  virtual FX_BOOL IsFontStyleFromCharCode(uint32_t charcode) const;
 
  protected:
-  int GetGlyphIndex(FX_DWORD unicodeb, FX_BOOL* pVertGlyph);
+  int GetGlyphIndex(uint32_t unicodeb, FX_BOOL* pVertGlyph);
   void LoadMetricsArray(CPDF_Array* pArray,
-                        CFX_ArrayTemplate<FX_DWORD>& result,
+                        CFX_ArrayTemplate<uint32_t>& result,
                         int nElements);
   void LoadSubstFont();
-  FX_WCHAR GetUnicodeFromCharCode(FX_DWORD charcode) const;
+  FX_WCHAR GetUnicodeFromCharCode(uint32_t charcode) const;
 
   CPDF_CMap* m_pCMap;
   CPDF_CMap* m_pAllocatedCMap;
@@ -78,10 +78,10 @@
   uint16_t m_DefaultWidth;
   uint16_t* m_pAnsiWidths;
   FX_SMALL_RECT m_CharBBox[256];
-  CFX_ArrayTemplate<FX_DWORD> m_WidthList;
+  CFX_ArrayTemplate<uint32_t> m_WidthList;
   short m_DefaultVY;
   short m_DefaultW1;
-  CFX_ArrayTemplate<FX_DWORD> m_VertMetrics;
+  CFX_ArrayTemplate<uint32_t> m_VertMetrics;
   FX_BOOL m_bAdobeCourierStd;
   CFX_CTTGSUBTable* m_pTTGSUBTable;
 };
diff --git a/core/fpdfapi/fpdf_font/cpdf_font.cpp b/core/fpdfapi/fpdf_font/cpdf_font.cpp
index bb63966..c52ce8f 100644
--- a/core/fpdfapi/fpdf_font/cpdf_font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_font.cpp
@@ -121,16 +121,16 @@
   return size;
 }
 
-int CPDF_Font::GetCharSize(FX_DWORD charcode) const {
+int CPDF_Font::GetCharSize(uint32_t charcode) const {
   return 1;
 }
 
-int CPDF_Font::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph) {
+int CPDF_Font::GlyphFromCharCode(uint32_t charcode, FX_BOOL* pVertGlyph) {
   ASSERT(false);
   return 0;
 }
 
-int CPDF_Font::GlyphFromCharCodeExt(FX_DWORD charcode) {
+int CPDF_Font::GlyphFromCharCodeExt(uint32_t charcode) {
   return GlyphFromCharCode(charcode);
 }
 
@@ -145,12 +145,12 @@
   return bVertWriting;
 }
 
-int CPDF_Font::AppendChar(FX_CHAR* buf, FX_DWORD charcode) const {
+int CPDF_Font::AppendChar(FX_CHAR* buf, uint32_t charcode) const {
   *buf = (FX_CHAR)charcode;
   return 1;
 }
 
-void CPDF_Font::AppendChar(CFX_ByteString& str, FX_DWORD charcode) const {
+void CPDF_Font::AppendChar(CFX_ByteString& str, uint32_t charcode) const {
   char buf[4];
   int len = AppendChar(buf, charcode);
   if (len == 1) {
@@ -160,7 +160,7 @@
   }
 }
 
-CFX_WideString CPDF_Font::UnicodeFromCharCode(FX_DWORD charcode) const {
+CFX_WideString CPDF_Font::UnicodeFromCharCode(uint32_t charcode) const {
   if (!m_bToUnicodeLoaded)
     ((CPDF_Font*)this)->LoadUnicodeMap();
 
@@ -169,7 +169,7 @@
   return CFX_WideString();
 }
 
-FX_DWORD CPDF_Font::CharCodeFromUnicode(FX_WCHAR unicode) const {
+uint32_t CPDF_Font::CharCodeFromUnicode(FX_WCHAR unicode) const {
   if (!m_bToUnicodeLoaded)
     ((CPDF_Font*)this)->LoadUnicodeMap();
 
@@ -237,7 +237,7 @@
     return;
 
   const uint8_t* pFontData = m_pFontFile->GetData();
-  FX_DWORD dwFontSize = m_pFontFile->GetSize();
+  uint32_t dwFontSize = m_pFontFile->GetSize();
   if (!m_Font.LoadEmbedded(pFontData, dwFontSize)) {
     m_pDocument->GetPageData()->ReleaseFontFileStreamAcc(
         const_cast<CPDF_Stream*>(m_pFontFile->GetStream()->AsStream()));
@@ -305,7 +305,7 @@
   int offset = 0;
   int width = 0;
   while (offset < size) {
-    FX_DWORD charcode = GetNextChar(pString, size, offset);
+    uint32_t charcode = GetNextChar(pString, size, offset);
     width += GetCharWidthF(charcode);
   }
   return width;
@@ -387,14 +387,14 @@
   return pFont;
 }
 
-FX_DWORD CPDF_Font::GetNextChar(const FX_CHAR* pString,
+uint32_t CPDF_Font::GetNextChar(const FX_CHAR* pString,
                                 int nStrLen,
                                 int& offset) const {
   if (offset < 0 || nStrLen < 1) {
     return 0;
   }
   uint8_t ch = offset < nStrLen ? pString[offset++] : pString[nStrLen - 1];
-  return static_cast<FX_DWORD>(ch);
+  return static_cast<uint32_t>(ch);
 }
 
 void CPDF_Font::LoadPDFEncoding(CPDF_Object* pEncoding,
@@ -450,8 +450,8 @@
     return;
   }
   pCharNames = new CFX_ByteString[256];
-  FX_DWORD cur_code = 0;
-  for (FX_DWORD i = 0; i < pDiffs->GetCount(); i++) {
+  uint32_t cur_code = 0;
+  for (uint32_t i = 0; i < pDiffs->GetCount(); i++) {
     CPDF_Object* pElement = pDiffs->GetElementValue(i);
     if (!pElement)
       continue;
diff --git a/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp b/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp
index 64e11e0..3fc16a2 100644
--- a/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp
@@ -1631,8 +1631,8 @@
     "a182",  NULL,   "a201", "a183", "a184", "a197", "a185", "a194", "a198",
     "a186",  "a195", "a187", "a188", "a189", "a190", "a191", NULL};
 
-FX_DWORD PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) {
-  for (FX_DWORD i = 0; i < 256; i++)
+uint32_t PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) {
+  for (uint32_t i = 0; i < 256; i++)
     if (pCodes[i] == unicode)
       return i;
   return 0;
@@ -1713,7 +1713,7 @@
   return pDict;
 }
 
-FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) {
+uint32_t FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) {
   switch (encoding) {
     case FXFT_ENCODING_UNICODE:
       return unicode;
@@ -1796,7 +1796,7 @@
   return nullptr;
 }
 
-FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) {
+FX_WCHAR FT_UnicodeFromCharCode(int encoding, uint32_t charcode) {
   switch (encoding) {
     case FXFT_ENCODING_UNICODE:
       return (uint16_t)charcode;
diff --git a/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp b/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp
index d7057e1..baac366 100644
--- a/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_simplefont.cpp
@@ -22,7 +22,7 @@
   delete[] m_pCharNames;
 }
 
-int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph) {
+int CPDF_SimpleFont::GlyphFromCharCode(uint32_t charcode, FX_BOOL* pVertGlyph) {
   if (pVertGlyph) {
     *pVertGlyph = FALSE;
   }
@@ -82,7 +82,7 @@
   }
 }
 
-int CPDF_SimpleFont::GetCharWidthF(FX_DWORD charcode, int level) {
+int CPDF_SimpleFont::GetCharWidthF(uint32_t charcode, int level) {
   if (charcode > 0xff) {
     charcode = 0;
   }
@@ -95,7 +95,7 @@
   return (int16_t)m_CharWidth[charcode];
 }
 
-FX_RECT CPDF_SimpleFont::GetCharBBox(FX_DWORD charcode, int level) {
+FX_RECT CPDF_SimpleFont::GetCharBBox(uint32_t charcode, int level) {
   if (charcode > 0xff)
     charcode = 0;
 
@@ -204,7 +204,7 @@
          m_BaseEncoding != PDFFONT_ENCODING_ZAPFDINGBATS;
 }
 
-CFX_WideString CPDF_SimpleFont::UnicodeFromCharCode(FX_DWORD charcode) const {
+CFX_WideString CPDF_SimpleFont::UnicodeFromCharCode(uint32_t charcode) const {
   CFX_WideString unicode = CPDF_Font::UnicodeFromCharCode(charcode);
   if (!unicode.IsEmpty())
     return unicode;
@@ -214,8 +214,8 @@
   return ret;
 }
 
-FX_DWORD CPDF_SimpleFont::CharCodeFromUnicode(FX_WCHAR unicode) const {
-  FX_DWORD ret = CPDF_Font::CharCodeFromUnicode(unicode);
+uint32_t CPDF_SimpleFont::CharCodeFromUnicode(FX_WCHAR unicode) const {
+  uint32_t ret = CPDF_Font::CharCodeFromUnicode(unicode);
   if (ret)
     return ret;
   return m_Encoding.CharCodeFromUnicode(unicode);
diff --git a/core/fpdfapi/fpdf_font/cpdf_simplefont.h b/core/fpdfapi/fpdf_font/cpdf_simplefont.h
index 19d6816..7b07c99 100644
--- a/core/fpdfapi/fpdf_font/cpdf_simplefont.h
+++ b/core/fpdfapi/fpdf_font/cpdf_simplefont.h
@@ -18,12 +18,12 @@
   virtual ~CPDF_SimpleFont();
 
   // CPDF_Font:
-  int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
-  FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override;
-  int GlyphFromCharCode(FX_DWORD charcode, FX_BOOL* pVertGlyph = NULL) override;
+  int GetCharWidthF(uint32_t charcode, int level = 0) override;
+  FX_RECT GetCharBBox(uint32_t charcode, int level = 0) override;
+  int GlyphFromCharCode(uint32_t charcode, FX_BOOL* pVertGlyph = NULL) override;
   FX_BOOL IsUnicodeCompatible() const override;
-  CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const override;
-  FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const override;
+  CFX_WideString UnicodeFromCharCode(uint32_t charcode) const override;
+  uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const override;
 
   CPDF_FontEncoding* GetEncoding() { return &m_Encoding; }
 
diff --git a/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp b/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp
index 13e0318..032fa00 100644
--- a/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_truetypefont.cpp
@@ -112,7 +112,7 @@
           m_GlyphIndex[charcode] = FXFT_Get_Char_Index(
               m_Font.GetFace(), m_Encoding.m_Unicodes[charcode]);
         } else if (bMacRoman) {
-          FX_DWORD maccode = FT_CharCodeFromUnicode(
+          uint32_t maccode = FT_CharCodeFromUnicode(
               FXFT_ENCODING_APPLE_ROMAN, m_Encoding.m_Unicodes[charcode]);
           if (!maccode) {
             m_GlyphIndex[charcode] =
diff --git a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
index 5a6ee34..b2f3ec8 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_type1font.cpp
@@ -102,7 +102,7 @@
   return LoadCommon();
 }
 
-int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode) {
+int CPDF_Type1Font::GlyphFromCharCodeExt(uint32_t charcode) {
   if (charcode > 0xff) {
     return -1;
   }
diff --git a/core/fpdfapi/fpdf_font/cpdf_type1font.h b/core/fpdfapi/fpdf_font/cpdf_type1font.h
index da82cd4..188b766 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type1font.h
+++ b/core/fpdfapi/fpdf_font/cpdf_type1font.h
@@ -18,7 +18,7 @@
   bool IsType1Font() const override;
   const CPDF_Type1Font* AsType1Font() const override;
   CPDF_Type1Font* AsType1Font() override;
-  int GlyphFromCharCodeExt(FX_DWORD charcode) override;
+  int GlyphFromCharCodeExt(uint32_t charcode) override;
 
   int GetBase14Font() const { return m_Base14Font; }
 
diff --git a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
index 91a03a9..8591b87 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_type3font.cpp
@@ -57,14 +57,14 @@
   int StartChar = m_pFontDict->GetIntegerBy("FirstChar");
   CPDF_Array* pWidthArray = m_pFontDict->GetArrayBy("Widths");
   if (pWidthArray && (StartChar >= 0 && StartChar < 256)) {
-    FX_DWORD count = pWidthArray->GetCount();
+    uint32_t count = pWidthArray->GetCount();
     if (count > 256) {
       count = 256;
     }
     if (StartChar + count > 256) {
       count = 256 - StartChar;
     }
-    for (FX_DWORD i = 0; i < count; i++) {
+    for (uint32_t i = 0; i < count; i++) {
       m_CharWidthL[StartChar + i] =
           FXSYS_round(pWidthArray->GetNumberAt(i) * xscale * 1000);
     }
@@ -89,7 +89,7 @@
   CheckFontMetrics();
 }
 
-CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level) {
+CPDF_Type3Char* CPDF_Type3Font::LoadChar(uint32_t charcode, int level) {
   if (level >= _FPDF_MAX_TYPE3_FORM_LEVEL_)
     return nullptr;
 
@@ -145,7 +145,7 @@
   return pCachedChar;
 }
 
-int CPDF_Type3Font::GetCharWidthF(FX_DWORD charcode, int level) {
+int CPDF_Type3Font::GetCharWidthF(uint32_t charcode, int level) {
   if (charcode >= FX_ArraySize(m_CharWidthL))
     charcode = 0;
 
@@ -156,7 +156,7 @@
   return pChar ? pChar->m_Width : 0;
 }
 
-FX_RECT CPDF_Type3Font::GetCharBBox(FX_DWORD charcode, int level) {
+FX_RECT CPDF_Type3Font::GetCharBBox(uint32_t charcode, int level) {
   const CPDF_Type3Char* pChar = LoadChar(charcode, level);
   return pChar ? pChar->m_BBox : FX_RECT();
 }
diff --git a/core/fpdfapi/fpdf_font/cpdf_type3font.h b/core/fpdfapi/fpdf_font/cpdf_type3font.h
index 5545569..70992c9 100644
--- a/core/fpdfapi/fpdf_font/cpdf_type3font.h
+++ b/core/fpdfapi/fpdf_font/cpdf_type3font.h
@@ -25,13 +25,13 @@
   bool IsType3Font() const override;
   const CPDF_Type3Font* AsType3Font() const override;
   CPDF_Type3Font* AsType3Font() override;
-  int GetCharWidthF(FX_DWORD charcode, int level = 0) override;
-  FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) override;
+  int GetCharWidthF(uint32_t charcode, int level = 0) override;
+  FX_RECT GetCharBBox(uint32_t charcode, int level = 0) override;
 
   void SetPageResources(CPDF_Dictionary* pResources) {
     m_pPageResources = pResources;
   }
-  CPDF_Type3Char* LoadChar(FX_DWORD charcode, int level = 0);
+  CPDF_Type3Char* LoadChar(uint32_t charcode, int level = 0);
   void CheckType3FontMetrics();
 
   CFX_Matrix& GetFontMatrix() { return m_FontMatrix; }
@@ -50,7 +50,7 @@
   CPDF_Dictionary* m_pCharProcs;
   CPDF_Dictionary* m_pPageResources;
   CPDF_Dictionary* m_pFontResources;
-  std::map<FX_DWORD, CPDF_Type3Char*> m_CacheMap;
+  std::map<uint32_t, CPDF_Type3Char*> m_CacheMap;
 };
 
 #endif  // CORE_FPDFAPI_FPDF_FONT_CPDF_TYPE3FONT_H_
diff --git a/core/fpdfapi/fpdf_font/font_int.h b/core/fpdfapi/fpdf_font/font_int.h
index b9b5b53..3ee4068 100644
--- a/core/fpdfapi/fpdf_font/font_int.h
+++ b/core/fpdfapi/fpdf_font/font_int.h
@@ -98,7 +98,7 @@
   friend class fpdf_font_cid_CMap_GetCode_Test;
   friend class fpdf_font_cid_CMap_GetCodeRange_Test;
 
-  static FX_DWORD CMap_GetCode(const CFX_ByteStringC& word);
+  static uint32_t CMap_GetCode(const CFX_ByteStringC& word);
   static bool CMap_GetCodeRange(CMap_CodeRange& range,
                                 const CFX_ByteStringC& first,
                                 const CFX_ByteStringC& second);
@@ -106,7 +106,7 @@
   CPDF_CMap* m_pCMap;
   int m_Status;
   int m_CodeSeq;
-  FX_DWORD m_CodePoints[4];
+  uint32_t m_CodePoints[4];
   CFX_ArrayTemplate<CMap_CodeRange> m_CodeRanges;
   CFX_ByteString m_Registry, m_Ordering, m_Supplement;
   CFX_ByteString m_LastWord;
@@ -136,16 +136,16 @@
   FX_BOOL LoadPredefined(CPDF_CMapManager* pMgr,
                          const FX_CHAR* name,
                          FX_BOOL bPromptCJK);
-  FX_BOOL LoadEmbedded(const uint8_t* pData, FX_DWORD dwSize);
+  FX_BOOL LoadEmbedded(const uint8_t* pData, uint32_t dwSize);
   void Release();
   FX_BOOL IsLoaded() const { return m_bLoaded; }
   FX_BOOL IsVertWriting() const { return m_bVertical; }
-  uint16_t CIDFromCharCode(FX_DWORD charcode) const;
-  FX_DWORD CharCodeFromCID(uint16_t CID) const;
-  int GetCharSize(FX_DWORD charcode) const;
-  FX_DWORD GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const;
+  uint16_t CIDFromCharCode(uint32_t charcode) const;
+  uint32_t CharCodeFromCID(uint16_t CID) const;
+  int GetCharSize(uint32_t charcode) const;
+  uint32_t GetNextChar(const FX_CHAR* pString, int nStrLen, int& offset) const;
   int CountChar(const FX_CHAR* pString, int size) const;
-  int AppendChar(FX_CHAR* str, FX_DWORD charcode) const;
+  int AppendChar(FX_CHAR* str, uint32_t charcode) const;
 
  protected:
   ~CPDF_CMap();
@@ -179,17 +179,17 @@
  protected:
   CIDSet m_Charset;
   const uint16_t* m_pEmbeddedMap;
-  FX_DWORD m_EmbeddedCount;
+  uint32_t m_EmbeddedCount;
 };
 
 class CPDF_ToUnicodeMap {
  public:
   void Load(CPDF_Stream* pStream);
-  CFX_WideString Lookup(FX_DWORD charcode);
-  FX_DWORD ReverseLookup(FX_WCHAR unicode);
+  CFX_WideString Lookup(uint32_t charcode);
+  uint32_t ReverseLookup(FX_WCHAR unicode);
 
  protected:
-  std::map<FX_DWORD, FX_DWORD> m_Map;
+  std::map<uint32_t, uint32_t> m_Map;
   CPDF_CID2UnicodeMap* m_pBaseMap;
   CFX_WideTextBuf m_MultiCharBuf;
 
@@ -197,12 +197,12 @@
   friend class fpdf_font_StringToCode_Test;
   friend class fpdf_font_StringToWideString_Test;
 
-  static FX_DWORD StringToCode(const CFX_ByteStringC& str);
+  static uint32_t StringToCode(const CFX_ByteStringC& str);
   static CFX_WideString StringToWideString(const CFX_ByteStringC& str);
 };
 
 void FPDFAPI_LoadCID2UnicodeMap(CIDSet charset,
                                 const uint16_t*& pMap,
-                                FX_DWORD& count);
+                                uint32_t& count);
 
 #endif  // CORE_FPDFAPI_FPDF_FONT_FONT_INT_H_
diff --git a/core/fpdfapi/fpdf_font/fpdf_font.cpp b/core/fpdfapi/fpdf_font/fpdf_font.cpp
index c0c6f52..b0659b4 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -90,25 +90,24 @@
   return (m * 1000 + upm / 2) / upm;
 }
 
-
-CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode) {
+CFX_WideString CPDF_ToUnicodeMap::Lookup(uint32_t charcode) {
   auto it = m_Map.find(charcode);
   if (it != m_Map.end()) {
-    FX_DWORD value = it->second;
+    uint32_t value = it->second;
     FX_WCHAR unicode = (FX_WCHAR)(value & 0xffff);
     if (unicode != 0xffff) {
       return unicode;
     }
     const FX_WCHAR* buf = m_MultiCharBuf.GetBuffer();
-    FX_DWORD buf_len = m_MultiCharBuf.GetLength();
+    uint32_t buf_len = m_MultiCharBuf.GetLength();
     if (!buf || buf_len == 0) {
       return CFX_WideString();
     }
-    FX_DWORD index = value >> 16;
+    uint32_t index = value >> 16;
     if (index >= buf_len) {
       return CFX_WideString();
     }
-    FX_DWORD len = buf[index];
+    uint32_t len = buf[index];
     if (index + len < index || index + len >= buf_len) {
       return CFX_WideString();
     }
@@ -120,7 +119,7 @@
   return CFX_WideString();
 }
 
-FX_DWORD CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode) {
+uint32_t CPDF_ToUnicodeMap::ReverseLookup(FX_WCHAR unicode) {
   for (const auto& pair : m_Map) {
     if (pair.second == unicode)
       return pair.first;
@@ -129,7 +128,7 @@
 }
 
 // Static.
-FX_DWORD CPDF_ToUnicodeMap::StringToCode(const CFX_ByteStringC& str) {
+uint32_t CPDF_ToUnicodeMap::StringToCode(const CFX_ByteStringC& str) {
   const FX_CHAR* buf = str.GetCStr();
   int len = str.GetLength();
   if (len == 0)
@@ -209,7 +208,7 @@
         if (word.IsEmpty() || word == "endbfchar") {
           break;
         }
-        FX_DWORD srccode = StringToCode(word);
+        uint32_t srccode = StringToCode(word);
         word = parser.GetWord();
         CFX_WideString destcode = StringToWideString(word);
         int len = destcode.GetLength();
@@ -232,15 +231,15 @@
           break;
         }
         high = parser.GetWord();
-        FX_DWORD lowcode = StringToCode(low);
-        FX_DWORD highcode =
+        uint32_t lowcode = StringToCode(low);
+        uint32_t highcode =
             (lowcode & 0xffffff00) | (StringToCode(high) & 0xff);
-        if (highcode == (FX_DWORD)-1) {
+        if (highcode == (uint32_t)-1) {
           break;
         }
         CFX_ByteString start = parser.GetWord();
         if (start == "[") {
-          for (FX_DWORD code = lowcode; code <= highcode; code++) {
+          for (uint32_t code = lowcode; code <= highcode; code++) {
             CFX_ByteString dest = parser.GetWord();
             CFX_WideString destcode = StringToWideString(dest);
             int len = destcode.GetLength();
@@ -259,14 +258,14 @@
         } else {
           CFX_WideString destcode = StringToWideString(start);
           int len = destcode.GetLength();
-          FX_DWORD value = 0;
+          uint32_t value = 0;
           if (len == 1) {
             value = StringToCode(start);
-            for (FX_DWORD code = lowcode; code <= highcode; code++) {
+            for (uint32_t code = lowcode; code <= highcode; code++) {
               m_Map[code] = value++;
             }
           } else {
-            for (FX_DWORD code = lowcode; code <= highcode; code++) {
+            for (uint32_t code = lowcode; code <= highcode; code++) {
               CFX_WideString retcode;
               if (code == lowcode) {
                 retcode = destcode;
diff --git a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 95452a7..2552a3c 100644
--- a/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -195,15 +195,15 @@
 }
 
 int CompareDWORD(const void* data1, const void* data2) {
-  return (*(FX_DWORD*)data1) - (*(FX_DWORD*)data2);
+  return (*(uint32_t*)data1) - (*(uint32_t*)data2);
 }
 
 int CompareCID(const void* key, const void* element) {
-  if ((*(FX_DWORD*)key) < (*(FX_DWORD*)element)) {
+  if ((*(uint32_t*)key) < (*(uint32_t*)element)) {
     return -1;
   }
-  if ((*(FX_DWORD*)key) >
-      (*(FX_DWORD*)element) + ((FX_DWORD*)element)[1] / 65536) {
+  if ((*(uint32_t*)key) >
+      (*(uint32_t*)element) + ((uint32_t*)element)[1] / 65536) {
     return 1;
   }
   return 0;
@@ -237,7 +237,7 @@
   return 0;
 }
 
-int GetCharSizeImpl(FX_DWORD charcode,
+int GetCharSizeImpl(uint32_t charcode,
                     CMap_CodeRange* pRanges,
                     int iRangesSize) {
   if (!iRangesSize)
@@ -379,7 +379,7 @@
   } else if (m_Status == 1 || m_Status == 2) {
     m_CodePoints[m_CodeSeq] = CMap_GetCode(word);
     m_CodeSeq++;
-    FX_DWORD StartCode, EndCode;
+    uint32_t StartCode, EndCode;
     uint16_t StartCID;
     if (m_Status == 1) {
       if (m_CodeSeq < 2) {
@@ -396,11 +396,11 @@
       StartCID = (uint16_t)m_CodePoints[2];
     }
     if (EndCode < 0x10000) {
-      for (FX_DWORD code = StartCode; code <= EndCode; code++) {
+      for (uint32_t code = StartCode; code <= EndCode; code++) {
         m_pCMap->m_pMapping[code] = (uint16_t)(StartCID + code - StartCode);
       }
     } else {
-      FX_DWORD buf[2];
+      uint32_t buf[2];
       buf[0] = StartCode;
       buf[1] = ((EndCode - StartCode) << 16) + StartCID;
       m_AddMaps.AppendBlock(buf, sizeof buf);
@@ -451,7 +451,7 @@
 }
 
 // Static.
-FX_DWORD CPDF_CMapParser::CMap_GetCode(const CFX_ByteStringC& word) {
+uint32_t CPDF_CMapParser::CMap_GetCode(const CFX_ByteStringC& word) {
   int num = 0;
   if (word.GetAt(0) == '<') {
     for (int i = 1; i < word.GetLength() && std::isxdigit(word.GetAt(i)); ++i)
@@ -487,12 +487,12 @@
     range.m_Lower[i] = FXSYS_toHexDigit(digit1) * 16 + FXSYS_toHexDigit(digit2);
   }
 
-  FX_DWORD size = second.GetLength();
+  uint32_t size = second.GetLength();
   for (i = 0; i < range.m_CharSize; ++i) {
-    uint8_t digit1 = ((FX_DWORD)i * 2 + 1 < size)
+    uint8_t digit1 = ((uint32_t)i * 2 + 1 < size)
                          ? second.GetAt((FX_STRSIZE)i * 2 + 1)
                          : '0';
-    uint8_t digit2 = ((FX_DWORD)i * 2 + 2 < size)
+    uint8_t digit2 = ((uint32_t)i * 2 + 2 < size)
                          ? second.GetAt((FX_STRSIZE)i * 2 + 2)
                          : '0';
     range.m_Upper[i] = FXSYS_toHexDigit(digit1) * 16 + FXSYS_toHexDigit(digit2);
@@ -555,7 +555,7 @@
   m_CodingScheme = map->m_CodingScheme;
   if (m_CodingScheme == MixedTwoBytes) {
     m_pLeadingBytes = FX_Alloc(uint8_t, 256);
-    for (FX_DWORD i = 0; i < map->m_LeadingSegCount; ++i) {
+    for (uint32_t i = 0; i < map->m_LeadingSegCount; ++i) {
       const uint8_t* segs = map->m_LeadingSegs;
       for (int b = segs[i * 2]; b <= segs[i * 2 + 1]; ++b) {
         m_pLeadingBytes[b] = 1;
@@ -569,7 +569,7 @@
   }
   return FALSE;
 }
-FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, FX_DWORD size) {
+FX_BOOL CPDF_CMap::LoadEmbedded(const uint8_t* pData, uint32_t size) {
   m_pMapping = FX_Alloc(uint16_t, 65536);
   CPDF_CMapParser parser;
   parser.Initialize(this);
@@ -583,7 +583,7 @@
   }
   if (m_CodingScheme == MixedFourBytes && parser.m_AddMaps.GetSize()) {
     m_pAddMapping = FX_Alloc(uint8_t, parser.m_AddMaps.GetSize() + 4);
-    *(FX_DWORD*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8;
+    *(uint32_t*)m_pAddMapping = parser.m_AddMaps.GetSize() / 8;
     FXSYS_memcpy(m_pAddMapping + 4, parser.m_AddMaps.GetBuffer(),
                  parser.m_AddMaps.GetSize());
     FXSYS_qsort(m_pAddMapping + 4, parser.m_AddMaps.GetSize() / 8, 8,
@@ -592,7 +592,7 @@
   return TRUE;
 }
 
-uint16_t CPDF_CMap::CIDFromCharCode(FX_DWORD charcode) const {
+uint16_t CPDF_CMap::CIDFromCharCode(uint32_t charcode) const {
   if (m_Coding == CIDCODING_CID) {
     return (uint16_t)charcode;
   }
@@ -605,27 +605,27 @@
   if (charcode >> 16) {
     if (m_pAddMapping) {
       void* found = FXSYS_bsearch(&charcode, m_pAddMapping + 4,
-                                  *(FX_DWORD*)m_pAddMapping, 8, CompareCID);
+                                  *(uint32_t*)m_pAddMapping, 8, CompareCID);
       if (!found) {
         if (m_pUseMap) {
           return m_pUseMap->CIDFromCharCode(charcode);
         }
         return 0;
       }
-      return (uint16_t)(((FX_DWORD*)found)[1] % 65536 + charcode -
-                        *(FX_DWORD*)found);
+      return (uint16_t)(((uint32_t*)found)[1] % 65536 + charcode -
+                        *(uint32_t*)found);
     }
     if (m_pUseMap)
       return m_pUseMap->CIDFromCharCode(charcode);
     return 0;
   }
-  FX_DWORD CID = m_pMapping[charcode];
+  uint32_t CID = m_pMapping[charcode];
   if (!CID && m_pUseMap)
     return m_pUseMap->CIDFromCharCode(charcode);
   return (uint16_t)CID;
 }
 
-FX_DWORD CPDF_CMap::GetNextChar(const FX_CHAR* pString,
+uint32_t CPDF_CMap::GetNextChar(const FX_CHAR* pString,
                                 int nStrLen,
                                 int& offset) const {
   switch (m_CodingScheme) {
@@ -654,7 +654,7 @@
           return 0;
         }
         if (ret == 2) {
-          FX_DWORD charcode = 0;
+          uint32_t charcode = 0;
           for (int i = 0; i < char_size; i++) {
             charcode = (charcode << 8) + codes[i];
           }
@@ -670,7 +670,7 @@
   }
   return 0;
 }
-int CPDF_CMap::GetCharSize(FX_DWORD charcode) const {
+int CPDF_CMap::GetCharSize(uint32_t charcode) const {
   switch (m_CodingScheme) {
     case OneByte:
       return 1;
@@ -719,7 +719,7 @@
   return size;
 }
 
-int CPDF_CMap::AppendChar(FX_CHAR* str, FX_DWORD charcode) const {
+int CPDF_CMap::AppendChar(FX_CHAR* str, uint32_t charcode) const {
   switch (m_CodingScheme) {
     case OneByte:
       str[0] = (uint8_t)charcode;
diff --git a/core/fpdfapi/fpdf_font/include/cpdf_font.h b/core/fpdfapi/fpdf_font/include/cpdf_font.h
index 1931c24..79456aa 100644
--- a/core/fpdfapi/fpdf_font/include/cpdf_font.h
+++ b/core/fpdfapi/fpdf_font/include/cpdf_font.h
@@ -39,7 +39,7 @@
                                 CPDF_Dictionary* pFontDict);
   static CPDF_Font* GetStockFont(CPDF_Document* pDoc,
                                  const CFX_ByteStringC& fontname);
-  static const FX_DWORD kInvalidCharCode = static_cast<FX_DWORD>(-1);
+  static const uint32_t kInvalidCharCode = static_cast<uint32_t>(-1);
 
   virtual ~CPDF_Font();
 
@@ -58,27 +58,27 @@
 
   virtual FX_BOOL IsVertWriting() const;
   virtual FX_BOOL IsUnicodeCompatible() const;
-  virtual FX_DWORD GetNextChar(const FX_CHAR* pString,
+  virtual uint32_t GetNextChar(const FX_CHAR* pString,
                                int nStrLen,
                                int& offset) const;
   virtual int CountChar(const FX_CHAR* pString, int size) const;
-  virtual int AppendChar(FX_CHAR* buf, FX_DWORD charcode) const;
-  virtual int GetCharSize(FX_DWORD charcode) const;
-  virtual int GlyphFromCharCode(FX_DWORD charcode,
+  virtual int AppendChar(FX_CHAR* buf, uint32_t charcode) const;
+  virtual int GetCharSize(uint32_t charcode) const;
+  virtual int GlyphFromCharCode(uint32_t charcode,
                                 FX_BOOL* pVertGlyph = nullptr);
-  virtual int GlyphFromCharCodeExt(FX_DWORD charcode);
-  virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const;
-  virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const;
+  virtual int GlyphFromCharCodeExt(uint32_t charcode);
+  virtual CFX_WideString UnicodeFromCharCode(uint32_t charcode) const;
+  virtual uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const;
 
   const CFX_ByteString& GetBaseFont() const { return m_BaseFont; }
   const CFX_SubstFont* GetSubstFont() const { return m_Font.GetSubstFont(); }
-  FX_DWORD GetFlags() const { return m_Flags; }
+  uint32_t GetFlags() const { return m_Flags; }
   FX_BOOL IsEmbedded() const { return IsType3Font() || m_pFontFile != nullptr; }
   CPDF_StreamAcc* GetFontFile() const { return m_pFontFile; }
   CPDF_Dictionary* GetFontDict() const { return m_pFontDict; }
   FX_BOOL IsStandardFont() const;
   FXFT_Face GetFace() const { return m_Font.GetFace(); }
-  void AppendChar(CFX_ByteString& str, FX_DWORD charcode) const;
+  void AppendChar(CFX_ByteString& str, uint32_t charcode) const;
 
   void GetFontBBox(FX_RECT& rect) const { rect = m_FontBBox; }
   int GetTypeAscent() const { return m_Ascent; }
@@ -87,8 +87,8 @@
   int GetStemV() const { return m_StemV; }
   int GetStringWidth(const FX_CHAR* pString, int size);
 
-  virtual int GetCharWidthF(FX_DWORD charcode, int level = 0) = 0;
-  virtual FX_RECT GetCharBBox(FX_DWORD charcode, int level = 0) = 0;
+  virtual int GetCharWidthF(uint32_t charcode, int level = 0) = 0;
+  virtual FX_RECT GetCharBBox(uint32_t charcode, int level = 0) = 0;
 
   CPDF_Document* m_pDocument;
   CFX_Font m_Font;
diff --git a/core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h b/core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h
index a64687c..6d6ff43 100644
--- a/core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h
+++ b/core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h
@@ -20,8 +20,8 @@
 #define PDFFONT_ENCODING_MS_SYMBOL 8
 #define PDFFONT_ENCODING_UNICODE 9
 
-FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode);
-FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode);
+uint32_t FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode);
+FX_WCHAR FT_UnicodeFromCharCode(int encoding, uint32_t charcode);
 
 FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name);
 CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode);
diff --git a/core/fpdfapi/fpdf_font/ttgsubtable.cpp b/core/fpdfapi/fpdf_font/ttgsubtable.cpp
index 24825ec..bb1a6f9 100644
--- a/core/fpdfapi/fpdf_font/ttgsubtable.cpp
+++ b/core/fpdfapi/fpdf_font/ttgsubtable.cpp
@@ -16,7 +16,7 @@
 CFX_GlyphMap::~CFX_GlyphMap() {}
 extern "C" {
 static int _CompareInt(const void* p1, const void* p2) {
-  return (*(FX_DWORD*)p1) - (*(FX_DWORD*)p2);
+  return (*(uint32_t*)p1) - (*(uint32_t*)p2);
 }
 };
 struct _IntPair {
@@ -24,7 +24,7 @@
   int32_t value;
 };
 void CFX_GlyphMap::SetAt(int key, int value) {
-  FX_DWORD count = m_Buffer.GetSize() / sizeof(_IntPair);
+  uint32_t count = m_Buffer.GetSize() / sizeof(_IntPair);
   _IntPair* buf = (_IntPair*)m_Buffer.GetBuffer();
   _IntPair pair = {key, value};
   if (count == 0 || key > buf[count - 1].key) {
@@ -52,7 +52,7 @@
   if (!pResult) {
     return FALSE;
   }
-  value = ((FX_DWORD*)pResult)[1];
+  value = ((uint32_t*)pResult)[1];
   return TRUE;
 }
 bool CFX_CTTGSUBTable::LoadGSUBTable(FT_Bytes gsub) {
@@ -82,7 +82,7 @@
              k < ((ScriptList.ScriptRecord + i)->Script.LangSysRecord + j)
                      ->LangSys.FeatureCount;
              ++k) {
-          FX_DWORD index =
+          uint32_t index =
               *(((ScriptList.ScriptRecord + i)->Script.LangSysRecord + j)
                     ->LangSys.FeatureIndex +
                 k);
@@ -382,8 +382,8 @@
     rec->Substitute[i] = GetUInt16(sp);
   }
 }
-FX_BOOL CFX_GSUBTable::GetVerticalGlyph(FX_DWORD glyphnum,
-                                        FX_DWORD* vglyphnum) {
+FX_BOOL CFX_GSUBTable::GetVerticalGlyph(uint32_t glyphnum,
+                                        uint32_t* vglyphnum) {
   return m_GsubImp.GetVerticalGlyph(glyphnum, vglyphnum);
 }
 // static
diff --git a/core/fpdfapi/fpdf_font/ttgsubtable.h b/core/fpdfapi/fpdf_font/ttgsubtable.h
index e0bdcc7..56f3fc0 100644
--- a/core/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/fpdfapi/fpdf_font/ttgsubtable.h
@@ -344,7 +344,7 @@
     p += 4;
     return ret;
   }
-  std::map<FX_DWORD, FX_DWORD> m_featureMap;
+  std::map<uint32_t, uint32_t> m_featureMap;
   FX_BOOL m_bFeautureMapLoad;
   bool loaded;
   struct tt_gsub_header header;
@@ -355,7 +355,7 @@
 class CFX_GSUBTable final : public IFX_GSUBTable {
  public:
   ~CFX_GSUBTable() override {}
-  FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) override;
+  FX_BOOL GetVerticalGlyph(uint32_t glyphnum, uint32_t* vglyphnum) override;
 
   CFX_CTTGSUBTable m_GsubImp;
 };
diff --git a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
index 5d02381..159de58 100644
--- a/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_allstates.cpp
@@ -47,7 +47,7 @@
   CFX_GraphStateData* pData = m_GraphState.GetModify();
   pData->m_DashPhase = phase * scale;
   pData->SetDashCount(pArray->GetCount());
-  for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+  for (uint32_t i = 0; i < pArray->GetCount(); i++) {
     pData->m_DashArray[i] = pArray->GetNumberAt(i) * scale;
   }
 }
@@ -62,7 +62,7 @@
     if (!pObject)
       continue;
 
-    FX_DWORD key = key_str.GetID();
+    uint32_t key = key_str.GetID();
     switch (key) {
       case FXBSTR_ID('L', 'W', 0, 0):
         m_GraphState.GetModify()->m_LineWidth = pObject->GetNumber();
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
index b1b4644..3add21c 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_colorspace.cpp
@@ -364,7 +364,7 @@
     return ColorspaceFromName(familyname);
 
   CPDF_ColorSpace* pCS = NULL;
-  FX_DWORD id = familyname.GetID();
+  uint32_t id = familyname.GetID();
   if (id == FXBSTR_ID('C', 'a', 'l', 'G')) {
     pCS = new CPDF_CalGray(pDoc);
   } else if (id == FXBSTR_ID('C', 'a', 'l', 'R')) {
@@ -930,8 +930,8 @@
         uint8_t* temp_src = FX_Alloc2D(uint8_t, nMaxColors, m_nComponents);
         uint8_t* pSrc = temp_src;
         for (int i = 0; i < nMaxColors; i++) {
-          FX_DWORD color = i;
-          FX_DWORD order = nMaxColors / 52;
+          uint32_t color = i;
+          uint32_t order = nMaxColors / 52;
           for (int c = 0; c < m_nComponents; c++) {
             *pSrc++ = (uint8_t)(color / order * 5);
             color %= order;
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
index 81e5e41..7f80c82 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.cpp
@@ -25,7 +25,7 @@
 }
 
 void CPDF_ColorState::SetColor(CPDF_Color& color,
-                               FX_DWORD& rgb,
+                               uint32_t& rgb,
                                CPDF_ColorSpace* pCS,
                                FX_FLOAT* pValue,
                                int nValues) {
@@ -39,7 +39,7 @@
   }
   color.SetValue(pValue);
   int R, G, B;
-  rgb = color.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD)-1;
+  rgb = color.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
 }
 
 void CPDF_ColorState::SetFillPattern(CPDF_Pattern* pPattern,
@@ -54,7 +54,7 @@
     pData->m_FillRGB = 0x00BFBFBF;
     return;
   }
-  pData->m_FillRGB = ret ? FXSYS_RGB(R, G, B) : (FX_DWORD)-1;
+  pData->m_FillRGB = ret ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
 }
 
 void CPDF_ColorState::SetStrokePattern(CPDF_Pattern* pPattern,
@@ -70,5 +70,5 @@
     return;
   }
   pData->m_StrokeRGB =
-      pData->m_StrokeColor.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (FX_DWORD)-1;
+      pData->m_StrokeColor.GetRGB(R, G, B) ? FXSYS_RGB(R, G, B) : (uint32_t)-1;
 }
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstate.h b/core/fpdfapi/fpdf_page/cpdf_colorstate.h
index e7f3e37..2b27d07 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorstate.h
+++ b/core/fpdfapi/fpdf_page/cpdf_colorstate.h
@@ -32,7 +32,7 @@
 
  private:
   void SetColor(CPDF_Color& color,
-                FX_DWORD& rgb,
+                uint32_t& rgb,
                 CPDF_ColorSpace* pCS,
                 FX_FLOAT* pValue,
                 int nValues);
diff --git a/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h b/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
index 96e43bd..6a992ad 100644
--- a/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
+++ b/core/fpdfapi/fpdf_page/cpdf_colorstatedata.h
@@ -18,9 +18,9 @@
   void Default();
 
   CPDF_Color m_FillColor;
-  FX_DWORD m_FillRGB;
+  uint32_t m_FillRGB;
   CPDF_Color m_StrokeColor;
-  FX_DWORD m_StrokeRGB;
+  uint32_t m_StrokeRGB;
 };
 
 #endif  // CORE_FPDFAPI_FPDF_PAGE_CPDF_COLORSTATEDATA_H_
diff --git a/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp b/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp
index 11c4dc7..45a40cc 100644
--- a/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_generalstate.cpp
@@ -9,7 +9,7 @@
 namespace {
 
 int RI_StringToId(const CFX_ByteString& ri) {
-  FX_DWORD id = ri.GetID();
+  uint32_t id = ri.GetID();
   if (id == FXBSTR_ID('A', 'b', 's', 'o'))
     return 1;
 
diff --git a/core/fpdfapi/fpdf_page/cpdf_image.cpp b/core/fpdfapi/fpdf_page/cpdf_image.cpp
index 7b11484..d5c9780 100644
--- a/core/fpdfapi/fpdf_page/cpdf_image.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_image.cpp
@@ -74,7 +74,7 @@
   return TRUE;
 }
 
-CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, FX_DWORD size) {
+CPDF_Dictionary* CPDF_Image::InitJPEG(uint8_t* pData, uint32_t size) {
   int32_t width;
   int32_t height;
   int32_t num_comps;
@@ -120,7 +120,7 @@
   return pDict;
 }
 
-void CPDF_Image::SetJpegImage(uint8_t* pData, FX_DWORD size) {
+void CPDF_Image::SetJpegImage(uint8_t* pData, uint32_t size) {
   CPDF_Dictionary* pDict = InitJPEG(pData, size);
   if (!pDict) {
     return;
@@ -129,11 +129,11 @@
 }
 
 void CPDF_Image::SetJpegImage(IFX_FileRead* pFile) {
-  FX_DWORD size = (FX_DWORD)pFile->GetSize();
+  uint32_t size = (uint32_t)pFile->GetSize();
   if (!size) {
     return;
   }
-  FX_DWORD dwEstimateSize = size;
+  uint32_t dwEstimateSize = size;
   if (dwEstimateSize > 8192) {
     dwEstimateSize = 8192;
   }
@@ -221,7 +221,7 @@
       uint8_t* pColorTable = FX_Alloc2D(uint8_t, iPalette, 3);
       uint8_t* ptr = pColorTable;
       for (int32_t i = 0; i < iPalette; i++) {
-        FX_DWORD argb = pBitmap->GetPaletteArgb(i);
+        uint32_t argb = pBitmap->GetPaletteArgb(i);
         ptr[0] = (uint8_t)(argb >> 16);
         ptr[1] = (uint8_t)(argb >> 8);
         ptr[2] = (uint8_t)argb;
@@ -357,9 +357,9 @@
 }
 
 CFX_DIBSource* CPDF_Image::LoadDIBSource(CFX_DIBSource** ppMask,
-                                         FX_DWORD* pMatteColor,
+                                         uint32_t* pMatteColor,
                                          FX_BOOL bStdCS,
-                                         FX_DWORD GroupFamily,
+                                         uint32_t GroupFamily,
                                          FX_BOOL bLoadMask) const {
   std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
   if (source->Load(m_pDocument, m_pStream,
@@ -385,7 +385,7 @@
 FX_BOOL CPDF_Image::StartLoadDIBSource(CPDF_Dictionary* pFormResource,
                                        CPDF_Dictionary* pPageResource,
                                        FX_BOOL bStdCS,
-                                       FX_DWORD GroupFamily,
+                                       uint32_t GroupFamily,
                                        FX_BOOL bLoadMask) {
   std::unique_ptr<CPDF_DIBSource> source(new CPDF_DIBSource);
   int ret =
diff --git a/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp b/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp
index 1d983d2..f4a1c16 100644
--- a/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_meshstream.cpp
@@ -26,7 +26,7 @@
   if (!m_nCoordBits || !m_nCompBits)
     return FALSE;
 
-  FX_DWORD nComps = pCS->CountComponents();
+  uint32_t nComps = pCS->CountComponents();
   if (nComps > 8)
     return FALSE;
 
@@ -44,14 +44,14 @@
   m_xmax = pDecode->GetNumberAt(1);
   m_ymin = pDecode->GetNumberAt(2);
   m_ymax = pDecode->GetNumberAt(3);
-  for (FX_DWORD i = 0; i < m_nComps; i++) {
+  for (uint32_t i = 0; i < m_nComps; i++) {
     m_ColorMin[i] = pDecode->GetNumberAt(i * 2 + 4);
     m_ColorMax[i] = pDecode->GetNumberAt(i * 2 + 5);
   }
   return TRUE;
 }
 
-FX_DWORD CPDF_MeshStream::GetFlag() {
+uint32_t CPDF_MeshStream::GetFlag() {
   return m_BitStream.GetBits(m_nFlagBits) & 0x03;
 }
 
@@ -70,7 +70,7 @@
 }
 
 void CPDF_MeshStream::GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b) {
-  FX_DWORD i;
+  uint32_t i;
   FX_FLOAT color_value[8];
   for (i = 0; i < m_nComps; i++) {
     color_value[i] = m_ColorMin[i] +
@@ -82,7 +82,7 @@
     FX_FLOAT result[kMaxResults];
     int nResults;
     FXSYS_memset(result, 0, sizeof(result));
-    for (FX_DWORD i = 0; i < m_nFuncs; i++) {
+    for (uint32_t i = 0; i < m_nFuncs; i++) {
       if (m_pFuncs[i] && m_pFuncs[i]->CountOutputs() <= kMaxResults) {
         m_pFuncs[i]->Call(color_value, 1, result, nResults);
       }
@@ -93,9 +93,9 @@
   }
 }
 
-FX_DWORD CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
+uint32_t CPDF_MeshStream::GetVertex(CPDF_MeshVertex& vertex,
                                     CFX_Matrix* pObject2Bitmap) {
-  FX_DWORD flag = GetFlag();
+  uint32_t flag = GetFlag();
   GetCoords(vertex.x, vertex.y);
   pObject2Bitmap->Transform(vertex.x, vertex.y);
   GetColor(vertex.r, vertex.g, vertex.b);
diff --git a/core/fpdfapi/fpdf_page/cpdf_meshstream.h b/core/fpdfapi/fpdf_page/cpdf_meshstream.h
index 4934c0b..462dcf0 100644
--- a/core/fpdfapi/fpdf_page/cpdf_meshstream.h
+++ b/core/fpdfapi/fpdf_page/cpdf_meshstream.h
@@ -31,25 +31,25 @@
                int nFuncs,
                CPDF_ColorSpace* pCS);
 
-  FX_DWORD GetFlag();
+  uint32_t GetFlag();
 
   void GetCoords(FX_FLOAT& x, FX_FLOAT& y);
   void GetColor(FX_FLOAT& r, FX_FLOAT& g, FX_FLOAT& b);
 
-  FX_DWORD GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap);
+  uint32_t GetVertex(CPDF_MeshVertex& vertex, CFX_Matrix* pObject2Bitmap);
   FX_BOOL GetVertexRow(CPDF_MeshVertex* vertex,
                        int count,
                        CFX_Matrix* pObject2Bitmap);
 
   CPDF_Function** m_pFuncs;
   CPDF_ColorSpace* m_pCS;
-  FX_DWORD m_nFuncs;
-  FX_DWORD m_nCoordBits;
-  FX_DWORD m_nCompBits;
-  FX_DWORD m_nFlagBits;
-  FX_DWORD m_nComps;
-  FX_DWORD m_CoordMax;
-  FX_DWORD m_CompMax;
+  uint32_t m_nFuncs;
+  uint32_t m_nCoordBits;
+  uint32_t m_nCompBits;
+  uint32_t m_nFlagBits;
+  uint32_t m_nComps;
+  uint32_t m_CoordMax;
+  uint32_t m_CompMax;
   FX_FLOAT m_xmin;
   FX_FLOAT m_xmax;
   FX_FLOAT m_ymin;
diff --git a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
index cf588dc..7ca03b4 100644
--- a/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
+++ b/core/fpdfapi/fpdf_page/cpdf_textobject.cpp
@@ -25,7 +25,7 @@
 
 void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const {
   pInfo->m_CharCode =
-      m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[index];
+      m_nChars == 1 ? (uint32_t)(uintptr_t)m_pCharCodes : m_pCharCodes[index];
   pInfo->m_OriginX = index ? m_pCharPos[index - 1] : 0;
   pInfo->m_OriginY = 0;
   if (pInfo->m_CharCode == -1) {
@@ -54,26 +54,26 @@
   }
   int count = 0;
   for (int i = 0; i < m_nChars; ++i)
-    if (m_pCharCodes[i] != (FX_DWORD)-1) {
+    if (m_pCharCodes[i] != (uint32_t)-1) {
       ++count;
     }
   return count;
 }
 
 void CPDF_TextObject::GetCharInfo(int index,
-                                  FX_DWORD& charcode,
+                                  uint32_t& charcode,
                                   FX_FLOAT& kerning) const {
   if (m_nChars == 1) {
-    charcode = (FX_DWORD)(uintptr_t)m_pCharCodes;
+    charcode = (uint32_t)(uintptr_t)m_pCharCodes;
     kerning = 0;
     return;
   }
   int count = 0;
   for (int i = 0; i < m_nChars; ++i) {
-    if (m_pCharCodes[i] != (FX_DWORD)-1) {
+    if (m_pCharCodes[i] != (uint32_t)-1) {
       if (count == index) {
         charcode = m_pCharCodes[i];
-        if (i == m_nChars - 1 || m_pCharCodes[i + 1] != (FX_DWORD)-1) {
+        if (i == m_nChars - 1 || m_pCharCodes[i + 1] != (uint32_t)-1) {
           kerning = 0;
         } else {
           kerning = m_pCharPos[i];
@@ -92,8 +92,8 @@
   }
   int count = 0;
   for (int i = 0; i < m_nChars; ++i) {
-    FX_DWORD charcode = m_pCharCodes[i];
-    if (charcode == (FX_DWORD)-1) {
+    uint32_t charcode = m_pCharCodes[i];
+    if (charcode == (uint32_t)-1) {
       continue;
     }
     if (count == index) {
@@ -110,8 +110,8 @@
 
   obj->m_nChars = m_nChars;
   if (m_nChars > 1) {
-    obj->m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
-    FXSYS_memcpy(obj->m_pCharCodes, m_pCharCodes, m_nChars * sizeof(FX_DWORD));
+    obj->m_pCharCodes = FX_Alloc(uint32_t, m_nChars);
+    FXSYS_memcpy(obj->m_pCharCodes, m_pCharCodes, m_nChars * sizeof(uint32_t));
     obj->m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
     FXSYS_memcpy(obj->m_pCharPos, m_pCharPos,
                  (m_nChars - 1) * sizeof(FX_FLOAT));
@@ -145,7 +145,7 @@
   }
   m_nChars += nsegs - 1;
   if (m_nChars > 1) {
-    m_pCharCodes = FX_Alloc(FX_DWORD, m_nChars);
+    m_pCharCodes = FX_Alloc(uint32_t, m_nChars);
     m_pCharPos = FX_Alloc(FX_FLOAT, m_nChars - 1);
     int index = 0;
     for (int i = 0; i < nsegs; ++i) {
@@ -156,12 +156,12 @@
       }
       if (i != nsegs - 1) {
         m_pCharPos[index - 1] = pKerning[i];
-        m_pCharCodes[index++] = (FX_DWORD)-1;
+        m_pCharCodes[index++] = (uint32_t)-1;
       }
     }
   } else {
     int offset = 0;
-    m_pCharCodes = (FX_DWORD*)(uintptr_t)pFont->GetNextChar(
+    m_pCharCodes = (uint32_t*)(uintptr_t)pFont->GetNextChar(
         pStrs[0], pStrs[0].GetLength(), offset);
   }
 }
@@ -171,7 +171,7 @@
   RecalcPositionData();
 }
 
-FX_FLOAT CPDF_TextObject::GetCharWidth(FX_DWORD charcode) const {
+FX_FLOAT CPDF_TextObject::GetCharWidth(uint32_t charcode) const {
   FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
   CPDF_Font* pFont = m_TextState.GetFont();
   FX_BOOL bVertWriting = FALSE;
@@ -203,10 +203,10 @@
   }
   FX_FLOAT fontsize = m_TextState.GetFontSize();
   for (int i = 0; i < m_nChars; ++i) {
-    FX_DWORD charcode =
-        m_nChars == 1 ? (FX_DWORD)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
+    uint32_t charcode =
+        m_nChars == 1 ? (uint32_t)(uintptr_t)m_pCharCodes : m_pCharCodes[i];
     if (i > 0) {
-      if (charcode == (FX_DWORD)-1) {
+      if (charcode == (uint32_t)-1) {
         curpos -= (m_pCharPos[i - 1] * fontsize) / 1000;
         continue;
       }
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp b/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp
index cc40976..224602e 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_colors.cpp
@@ -21,7 +21,7 @@
 
 namespace {
 
-FX_DWORD ComponentsForFamily(int family) {
+uint32_t ComponentsForFamily(int family) {
   if (family == PDFCS_DEVICERGB)
     return 3;
   if (family == PDFCS_DEVICEGRAY)
@@ -216,7 +216,7 @@
   }
 }
 
-CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize)
+CPDF_IccProfile::CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize)
     : m_bsRGB(FALSE), m_pTransform(NULL), m_nSrcComponents(0) {
   if (dwSize == 3144 &&
       FXSYS_memcmp(pData + 0x190, "sRGB IEC61966-2.1", 17) == 0) {
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 2e68702..d762e1a 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -477,7 +477,7 @@
   if (!pImageStream)
     return nullptr;
 
-  const FX_DWORD dwImageObjNum = pImageStream->GetObjNum();
+  const uint32_t dwImageObjNum = pImageStream->GetObjNum();
   auto it = m_ImageMap.find(dwImageObjNum);
   if (it != m_ImageMap.end()) {
     return it->second->AddRef();
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_func.cpp b/core/fpdfapi/fpdf_page/fpdf_page_func.cpp
index 08eafad..0fa2dd7 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_func.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_func.cpp
@@ -490,7 +490,7 @@
                                 FX_FLOAT ymax) {
   return ((x - xmin) * (ymax - ymin) / (xmax - xmin)) + ymin;
 }
-static FX_DWORD _GetBits32(const uint8_t* pData, int bitpos, int nbits) {
+static uint32_t _GetBits32(const uint8_t* pData, int bitpos, int nbits) {
   int result = 0;
   for (int i = 0; i < nbits; i++)
     if (pData[(bitpos + i) / 8] & (1 << (7 - (bitpos + i) % 8))) {
@@ -515,8 +515,8 @@
 
   SampleEncodeInfo* m_pEncodeInfo;
   SampleDecodeInfo* m_pDecodeInfo;
-  FX_DWORD m_nBitsPerSample;
-  FX_DWORD m_SampleMax;
+  uint32_t m_nBitsPerSample;
+  uint32_t m_SampleMax;
   CPDF_StreamAcc* m_pSampleStream;
 };
 
@@ -632,7 +632,7 @@
     return FALSE;
   }
   for (int j = 0; j < m_nOutputs; j++) {
-    FX_DWORD sample =
+    uint32_t sample =
         _GetBits32(pSampleData, bitpos.ValueOrDie() + j * m_nBitsPerSample,
                    m_nBitsPerSample);
     FX_FLOAT encoded = (FX_FLOAT)sample;
@@ -650,7 +650,7 @@
         if (!bitpos2.IsValid()) {
           return FALSE;
         }
-        FX_DWORD sample1 =
+        uint32_t sample1 =
             _GetBits32(pSampleData, bitpos2.ValueOrDie(), m_nBitsPerSample);
         encoded += (encoded_input[i] - index[i]) *
                    ((FX_FLOAT)sample1 - (FX_FLOAT)sample);
@@ -770,12 +770,12 @@
   if (!pArray) {
     return FALSE;
   }
-  FX_DWORD nSubs = pArray->GetCount();
+  uint32_t nSubs = pArray->GetCount();
   if (nSubs == 0) {
     return FALSE;
   }
   m_nOutputs = 0;
-  for (FX_DWORD i = 0; i < nSubs; i++) {
+  for (uint32_t i = 0; i < nSubs; i++) {
     CPDF_Object* pSub = pArray->GetElementValue(i);
     if (pSub == pObj) {
       return FALSE;
@@ -804,7 +804,7 @@
   if (!pArray) {
     return FALSE;
   }
-  for (FX_DWORD i = 0; i < nSubs - 1; i++) {
+  for (uint32_t i = 0; i < nSubs - 1; i++) {
     m_pBounds[i + 1] = pArray->GetFloatAt(i);
   }
   m_pBounds[nSubs] = m_pDomains[1];
@@ -813,7 +813,7 @@
   if (!pArray) {
     return FALSE;
   }
-  for (FX_DWORD i = 0; i < nSubs * 2; i++) {
+  for (uint32_t i = 0; i < nSubs * 2; i++) {
     m_pEncode[i] = pArray->GetFloatAt(i);
   }
   return TRUE;
@@ -900,7 +900,7 @@
       m_pRanges[i] = pRanges->GetFloatAt(i);
     }
   }
-  FX_DWORD old_outputs = m_nOutputs;
+  uint32_t old_outputs = m_nOutputs;
   if (!v_Init(pObj)) {
     return FALSE;
   }
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 63c84bb..75b7452 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -255,8 +255,8 @@
   m_ParamBuf[index].m_pObject = pObj;
 }
 void CPDF_StreamContentParser::ClearAllParams() {
-  FX_DWORD index = m_ParamStartPos;
-  for (FX_DWORD i = 0; i < m_ParamCount; i++) {
+  uint32_t index = m_ParamStartPos;
+  for (uint32_t i = 0; i < m_ParamCount; i++) {
     if (m_ParamBuf[index].m_Type == 0) {
       if (CPDF_Object* pObject = m_ParamBuf[index].m_pObject)
         pObject->Release();
@@ -270,7 +270,7 @@
   m_ParamCount = 0;
 }
 
-CPDF_Object* CPDF_StreamContentParser::GetObject(FX_DWORD index) {
+CPDF_Object* CPDF_StreamContentParser::GetObject(uint32_t index) {
   if (index >= m_ParamCount) {
     return NULL;
   }
@@ -302,7 +302,7 @@
   return NULL;
 }
 
-CFX_ByteString CPDF_StreamContentParser::GetString(FX_DWORD index) {
+CFX_ByteString CPDF_StreamContentParser::GetString(uint32_t index) {
   if (index >= m_ParamCount) {
     return CFX_ByteString();
   }
@@ -320,7 +320,7 @@
   return CFX_ByteString();
 }
 
-FX_FLOAT CPDF_StreamContentParser::GetNumber(FX_DWORD index) {
+FX_FLOAT CPDF_StreamContentParser::GetNumber(uint32_t index) {
   if (index >= m_ParamCount) {
     return 0;
   }
@@ -339,7 +339,7 @@
   return 0;
 }
 
-FX_FLOAT CPDF_StreamContentParser::GetNumber16(FX_DWORD index) {
+FX_FLOAT CPDF_StreamContentParser::GetNumber16(uint32_t index) {
   return GetNumber(index);
 }
 
@@ -484,7 +484,7 @@
 
 void CPDF_StreamContentParser::OnOperator(const FX_CHAR* op) {
   int i = 0;
-  FX_DWORD opid = 0;
+  uint32_t opid = 0;
   while (i < 4 && op[i]) {
     opid = (opid << 8) + op[i];
     i++;
@@ -574,7 +574,7 @@
     std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj(
         m_pSyntax->ReadNextObject());
     if (!key.IsEmpty()) {
-      FX_DWORD dwObjNum = pObj ? pObj->GetObjNum() : 0;
+      uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0;
       if (dwObjNum)
         pDict->SetAtReference(key, m_pDocument, dwObjNum);
       else
@@ -1645,17 +1645,17 @@
   }
 }
 
-FX_DWORD CPDF_StreamContentParser::Parse(const uint8_t* pData,
-                                         FX_DWORD dwSize,
-                                         FX_DWORD max_cost) {
+uint32_t CPDF_StreamContentParser::Parse(const uint8_t* pData,
+                                         uint32_t dwSize,
+                                         uint32_t max_cost) {
   if (m_Level > _FPDF_MAX_FORM_LEVEL_) {
     return dwSize;
   }
-  FX_DWORD InitObjCount = m_pObjectHolder->GetPageObjectList()->size();
+  uint32_t InitObjCount = m_pObjectHolder->GetPageObjectList()->size();
   CPDF_StreamParser syntax(pData, dwSize);
   CPDF_StreamParserAutoClearer auto_clearer(&m_pSyntax, &syntax);
   while (1) {
-    FX_DWORD cost = m_pObjectHolder->GetPageObjectList()->size() - InitObjCount;
+    uint32_t cost = m_pObjectHolder->GetPageObjectList()->size() - InitObjCount;
     if (max_cost && cost >= max_cost) {
       break;
     }
@@ -1810,7 +1810,7 @@
     }
     case CPDF_Object::ARRAY: {
       CPDF_Array* pArray = pObj->AsArray();
-      for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+      for (uint32_t i = 0; i < pArray->GetCount(); i++) {
         CPDF_Object* pElement = pArray->GetElement(i);
         if (pElement->IsName()) {
           CFX_ByteString name = pElement->GetString();
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
index 9995038..f2b7582 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp
@@ -31,7 +31,7 @@
 #include "core/fxcrt/include/fx_safe_types.h"
 #include "core/include/fxcodec/fx_codec.h"
 
-CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize) {
+CPDF_StreamParser::CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize) {
   m_pBuf = pData;
   m_Size = dwSize;
   m_Pos = 0;
@@ -44,11 +44,11 @@
   }
 }
 
-FX_DWORD DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder,
+uint32_t DecodeAllScanlines(ICodec_ScanlineDecoder* pDecoder,
                             uint8_t*& dest_buf,
-                            FX_DWORD& dest_size) {
+                            uint32_t& dest_size) {
   if (!pDecoder) {
-    return static_cast<FX_DWORD>(-1);
+    return static_cast<uint32_t>(-1);
   }
   int ncomps = pDecoder->CountComps();
   int bpc = pDecoder->GetBPC();
@@ -57,7 +57,7 @@
   int pitch = (width * ncomps * bpc + 7) / 8;
   if (height == 0 || pitch > (1 << 30) / height) {
     delete pDecoder;
-    return static_cast<FX_DWORD>(-1);
+    return static_cast<uint32_t>(-1);
   }
   dest_buf = FX_Alloc2D(uint8_t, pitch, height);
   dest_size = pitch * height;  // Safe since checked alloc returned.
@@ -68,26 +68,26 @@
 
     FXSYS_memcpy(dest_buf + row * pitch, pLine, pitch);
   }
-  FX_DWORD srcoff = pDecoder->GetSrcOffset();
+  uint32_t srcoff = pDecoder->GetSrcOffset();
   delete pDecoder;
   return srcoff;
 }
 
 ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     const CPDF_Dictionary* pParams);
 
-FX_DWORD PDF_DecodeInlineStream(const uint8_t* src_buf,
-                                FX_DWORD limit,
+uint32_t PDF_DecodeInlineStream(const uint8_t* src_buf,
+                                uint32_t limit,
                                 int width,
                                 int height,
                                 CFX_ByteString& decoder,
                                 CPDF_Dictionary* pParam,
                                 uint8_t*& dest_buf,
-                                FX_DWORD& dest_size) {
+                                uint32_t& dest_size) {
   if (decoder == "CCITTFaxDecode" || decoder == "CCF") {
     ICodec_ScanlineDecoder* pDecoder =
         FPDFAPI_CreateFaxDecoder(src_buf, limit, width, height, pParam);
@@ -119,7 +119,7 @@
   }
   dest_size = 0;
   dest_buf = 0;
-  return (FX_DWORD)-1;
+  return (uint32_t)-1;
 }
 
 CPDF_Stream* CPDF_StreamParser::ReadInlineStream(CPDF_Document* pDoc,
@@ -146,12 +146,12 @@
       pParam = pDict->GetDictBy("DecodeParms");
     }
   }
-  FX_DWORD width = pDict->GetIntegerBy("Width");
-  FX_DWORD height = pDict->GetIntegerBy("Height");
-  FX_DWORD OrigSize = 0;
+  uint32_t width = pDict->GetIntegerBy("Width");
+  uint32_t height = pDict->GetIntegerBy("Height");
+  uint32_t OrigSize = 0;
   if (pCSObj) {
-    FX_DWORD bpc = pDict->GetIntegerBy("BitsPerComponent");
-    FX_DWORD nComponents = 1;
+    uint32_t bpc = pDict->GetIntegerBy("BitsPerComponent");
+    uint32_t nComponents = 1;
     CPDF_ColorSpace* pCS = pDoc->LoadColorSpace(pCSObj);
     if (!pCS) {
       nComponents = 3;
@@ -159,7 +159,7 @@
       nComponents = pCS->CountComponents();
       pDoc->GetPageData()->ReleaseColorSpace(pCSObj);
     }
-    FX_DWORD pitch = width;
+    uint32_t pitch = width;
     if (bpc && pitch > INT_MAX / bpc) {
       return NULL;
     }
@@ -185,7 +185,7 @@
   }
   OrigSize *= height;
   uint8_t* pData = NULL;
-  FX_DWORD dwStreamSize;
+  uint32_t dwStreamSize;
   if (Decoder.IsEmpty()) {
     if (OrigSize > m_Size - m_Pos) {
       OrigSize = m_Size - m_Pos;
@@ -195,7 +195,7 @@
     dwStreamSize = OrigSize;
     m_Pos += OrigSize;
   } else {
-    FX_DWORD dwDestSize = OrigSize;
+    uint32_t dwDestSize = OrigSize;
     dwStreamSize =
         PDF_DecodeInlineStream(m_pBuf + m_Pos, m_Size - m_Pos, width, height,
                                Decoder, pParam, pData, dwDestSize);
@@ -217,10 +217,10 @@
       }
     } else {
       FX_Free(pData);
-      FX_DWORD dwSavePos = m_Pos;
+      uint32_t dwSavePos = m_Pos;
       m_Pos += dwStreamSize;
       while (1) {
-        FX_DWORD dwPrevPos = m_Pos;
+        uint32_t dwPrevPos = m_Pos;
         CPDF_StreamParser::SyntaxType type = ParseNextElement();
         if (type == CPDF_StreamParser::EndOfData) {
           break;
@@ -332,7 +332,7 @@
 }
 
 void CPDF_StreamParser::SkipPathObject() {
-  FX_DWORD command_startpos = m_Pos;
+  uint32_t command_startpos = m_Pos;
   if (!PositionIsInBounds())
     return;
 
@@ -365,7 +365,7 @@
       if (PDFCharIsNumeric(ch))
         continue;
 
-      FX_DWORD op_startpos = m_Pos - 1;
+      uint32_t op_startpos = m_Pos - 1;
       while (!PDFCharIsWhitespace(ch) && !PDFCharIsDelimiter(ch)) {
         if (!PositionIsInBounds())
           return;
@@ -808,7 +808,7 @@
           }
           m_Size = safeSize.ValueOrDie();
           m_pData = FX_Alloc(uint8_t, m_Size);
-          FX_DWORD pos = 0;
+          uint32_t pos = 0;
           for (const auto& stream : m_StreamArray) {
             FXSYS_memcpy(m_pData + pos, stream->GetData(), stream->GetSize());
             pos += stream->GetSize();
diff --git a/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp b/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
index 822d06d..68ac8c8 100644
--- a/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
+++ b/core/fpdfapi/fpdf_page/fpdf_page_pattern.cpp
@@ -58,7 +58,7 @@
     color_count = kQuadColorsPerPatch;
 
   while (!stream.m_BitStream.IsEOF()) {
-    FX_DWORD flag = 0;
+    uint32_t flag = 0;
     if (type != kLatticeFormGouraudTriangleMeshShading)
       flag = stream.GetFlag();
 
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h b/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
index e265cd4..6f239e6 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_clippath.h
@@ -17,10 +17,10 @@
 
 class CPDF_ClipPath : public CFX_CountRef<CPDF_ClipPathData> {
  public:
-  FX_DWORD GetPathCount() const { return m_pObject->m_PathCount; }
+  uint32_t GetPathCount() const { return m_pObject->m_PathCount; }
   CPDF_Path GetPath(int i) const { return m_pObject->m_pPathList[i]; }
   int GetClipType(int i) const { return m_pObject->m_pTypeList[i]; }
-  FX_DWORD GetTextCount() const { return m_pObject->m_TextCount; }
+  uint32_t GetTextCount() const { return m_pObject->m_TextCount; }
   CPDF_TextObject* GetText(int i) const { return m_pObject->m_pTextList[i]; }
   CFX_FloatRect GetClipBox() const;
 
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h b/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h
index afdd71d..6be55f4 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_colorspace.h
@@ -37,7 +37,7 @@
   int GetBufSize() const;
   FX_FLOAT* CreateBuf();
   void GetDefaultColor(FX_FLOAT* buf) const;
-  FX_DWORD CountComponents() const { return m_nComponents; }
+  uint32_t CountComponents() const { return m_nComponents; }
   int GetFamily() const { return m_Family; }
   virtual void GetDefaultValue(int iComponent,
                                FX_FLOAT& value,
@@ -87,7 +87,7 @@
   CPDF_Document* const m_pDocument;
 
  protected:
-  CPDF_ColorSpace(CPDF_Document* pDoc, int family, FX_DWORD nComponents)
+  CPDF_ColorSpace(CPDF_Document* pDoc, int family, uint32_t nComponents)
       : m_pDocument(pDoc),
         m_Family(family),
         m_nComponents(nComponents),
@@ -114,9 +114,9 @@
   }
 
   int m_Family;
-  FX_DWORD m_nComponents;
+  uint32_t m_nComponents;
   CPDF_Array* m_pArray;
-  FX_DWORD m_dwStdConversion;
+  uint32_t m_dwStdConversion;
 };
 
 #endif  // CORE_FPDFAPI_FPDF_PAGE_INCLUDE_CPDF_COLORSPACE_H_
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_image.h b/core/fpdfapi/fpdf_page/include/cpdf_image.h
index 9153e9a..48349de 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_image.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_image.h
@@ -52,14 +52,14 @@
   FX_BOOL IsInterpol() const { return m_bInterpolate; }
 
   CFX_DIBSource* LoadDIBSource(CFX_DIBSource** ppMask = NULL,
-                               FX_DWORD* pMatteColor = NULL,
+                               uint32_t* pMatteColor = NULL,
                                FX_BOOL bStdCS = FALSE,
-                               FX_DWORD GroupFamily = 0,
+                               uint32_t GroupFamily = 0,
                                FX_BOOL bLoadMask = FALSE) const;
 
   void SetInlineDict(CPDF_Dictionary* pDict) { m_pInlineDict = pDict; }
   void SetImage(const CFX_DIBitmap* pDIBitmap, int32_t iCompress);
-  void SetJpegImage(uint8_t* pImageData, FX_DWORD size);
+  void SetJpegImage(uint8_t* pImageData, uint32_t size);
   void SetJpegImage(IFX_FileRead* pFile);
 
   void ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pDIBitmap);
@@ -67,7 +67,7 @@
   FX_BOOL StartLoadDIBSource(CPDF_Dictionary* pFormResource,
                              CPDF_Dictionary* pPageResource,
                              FX_BOOL bStdCS = FALSE,
-                             FX_DWORD GroupFamily = 0,
+                             uint32_t GroupFamily = 0,
                              FX_BOOL bLoadMask = FALSE);
   FX_BOOL Continue(IFX_Pause* pPause);
   CFX_DIBSource* DetachBitmap();
@@ -75,10 +75,10 @@
 
   CFX_DIBSource* m_pDIBSource;
   CFX_DIBSource* m_pMask;
-  FX_DWORD m_MatteColor;
+  uint32_t m_MatteColor;
 
  private:
-  CPDF_Dictionary* InitJPEG(uint8_t* pData, FX_DWORD size);
+  CPDF_Dictionary* InitJPEG(uint8_t* pData, uint32_t size);
 
   CPDF_Stream* m_pStream;
   FX_BOOL m_bInline;
diff --git a/core/fpdfapi/fpdf_page/include/cpdf_textobject.h b/core/fpdfapi/fpdf_page/include/cpdf_textobject.h
index bb268c1..c47180e 100644
--- a/core/fpdfapi/fpdf_page/include/cpdf_textobject.h
+++ b/core/fpdfapi/fpdf_page/include/cpdf_textobject.h
@@ -12,7 +12,7 @@
 #include "core/fxcrt/include/fx_system.h"
 
 struct CPDF_TextObjectItem {
-  FX_DWORD m_CharCode;
+  uint32_t m_CharCode;
   FX_FLOAT m_OriginX;
   FX_FLOAT m_OriginY;
 };
@@ -33,9 +33,9 @@
   int CountItems() const { return m_nChars; }
   void GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const;
   int CountChars() const;
-  void GetCharInfo(int index, FX_DWORD& charcode, FX_FLOAT& kerning) const;
+  void GetCharInfo(int index, uint32_t& charcode, FX_FLOAT& kerning) const;
   void GetCharInfo(int index, CPDF_TextObjectItem* pInfo) const;
-  FX_FLOAT GetCharWidth(FX_DWORD charcode) const;
+  FX_FLOAT GetCharWidth(uint32_t charcode) const;
   FX_FLOAT GetPosX() const { return m_PosX; }
   FX_FLOAT GetPosY() const { return m_PosY; }
   void GetTextMatrix(CFX_Matrix* pMatrix) const;
@@ -62,7 +62,7 @@
   FX_FLOAT m_PosX;
   FX_FLOAT m_PosY;
   int m_nChars;
-  FX_DWORD* m_pCharCodes;
+  uint32_t* m_pCharCodes;
   FX_FLOAT* m_pCharPos;
 };
 
diff --git a/core/fpdfapi/fpdf_page/pageint.h b/core/fpdfapi/fpdf_page/pageint.h
index 297b1e2..d76eea4 100644
--- a/core/fpdfapi/fpdf_page/pageint.h
+++ b/core/fpdfapi/fpdf_page/pageint.h
@@ -39,7 +39,7 @@
  public:
   enum SyntaxType { EndOfData, Number, Keyword, Name, Others };
 
-  CPDF_StreamParser(const uint8_t* pData, FX_DWORD dwSize);
+  CPDF_StreamParser(const uint8_t* pData, uint32_t dwSize);
   ~CPDF_StreamParser();
 
   CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc,
@@ -48,14 +48,14 @@
                                 FX_BOOL bDecode);
   SyntaxType ParseNextElement();
   uint8_t* GetWordBuf() { return m_WordBuffer; }
-  FX_DWORD GetWordSize() const { return m_WordSize; }
+  uint32_t GetWordSize() const { return m_WordSize; }
   CPDF_Object* GetObject() {
     CPDF_Object* pObj = m_pLastObj;
     m_pLastObj = NULL;
     return pObj;
   }
-  FX_DWORD GetPos() const { return m_Pos; }
-  void SetPos(FX_DWORD pos) { m_Pos = pos; }
+  uint32_t GetPos() const { return m_Pos; }
+  void SetPos(uint32_t pos) { m_Pos = pos; }
   CPDF_Object* ReadNextObject(FX_BOOL bAllowNestedArray = FALSE,
                               FX_BOOL bInArray = FALSE);
   void SkipPathObject();
@@ -69,13 +69,13 @@
   const uint8_t* m_pBuf;
 
   // Length in bytes of m_pBuf.
-  FX_DWORD m_Size;
+  uint32_t m_Size;
 
   // Current byte position within m_pBuf.
-  FX_DWORD m_Pos;
+  uint32_t m_Pos;
 
   uint8_t m_WordBuffer[256];
-  FX_DWORD m_WordSize;
+  uint32_t m_WordSize;
   CPDF_Object* m_pLastObj;
 
  private:
@@ -128,14 +128,14 @@
   void AddNameParam(const FX_CHAR* name, int size);
   int GetNextParamPos();
   void ClearAllParams();
-  CPDF_Object* GetObject(FX_DWORD index);
-  CFX_ByteString GetString(FX_DWORD index);
-  FX_FLOAT GetNumber(FX_DWORD index);
-  FX_FLOAT GetNumber16(FX_DWORD index);
-  int GetInteger(FX_DWORD index) { return (int32_t)(GetNumber(index)); }
+  CPDF_Object* GetObject(uint32_t index);
+  CFX_ByteString GetString(uint32_t index);
+  FX_FLOAT GetNumber(uint32_t index);
+  FX_FLOAT GetNumber16(uint32_t index);
+  int GetInteger(uint32_t index) { return (int32_t)(GetNumber(index)); }
   void OnOperator(const FX_CHAR* op);
   void BigCaseCaller(int index);
-  FX_DWORD GetParsePos() { return m_pSyntax->GetPos(); }
+  uint32_t GetParsePos() { return m_pSyntax->GetPos(); }
   void AddTextObject(CFX_ByteString* pText,
                      FX_FLOAT fInitKerning,
                      FX_FLOAT* pKerning,
@@ -144,7 +144,7 @@
   void ConvertUserSpace(FX_FLOAT& x, FX_FLOAT& y);
   void ConvertTextSpace(FX_FLOAT& x, FX_FLOAT& y);
   void OnChangeTextMatrix();
-  FX_DWORD Parse(const uint8_t* pData, FX_DWORD dwSize, FX_DWORD max_cost);
+  uint32_t Parse(const uint8_t* pData, uint32_t dwSize, uint32_t max_cost);
   void ParsePathObject();
   void AddPathPoint(FX_FLOAT x, FX_FLOAT y, int flag);
   void AddPathRect(FX_FLOAT x, FX_FLOAT y, FX_FLOAT w, FX_FLOAT h);
@@ -168,7 +168,7 @@
 
  protected:
   using OpCodes =
-      std::unordered_map<FX_DWORD, void (CPDF_StreamContentParser::*)()>;
+      std::unordered_map<uint32_t, void (CPDF_StreamContentParser::*)()>;
   static OpCodes InitializeOpCodes();
 
   void Handle_CloseFillStrokePath();
@@ -254,8 +254,8 @@
   CFX_FloatRect m_BBox;
   CPDF_ParseOptions m_Options;
   ContentParam m_ParamBuf[PARAM_BUF_SIZE];
-  FX_DWORD m_ParamStartPos;
-  FX_DWORD m_ParamCount;
+  uint32_t m_ParamStartPos;
+  uint32_t m_ParamCount;
   CPDF_StreamParser* m_pSyntax;
   std::unique_ptr<CPDF_AllStates> m_pCurStates;
   CPDF_ContentMark m_CurContentMark;
@@ -313,12 +313,12 @@
   FX_BOOL m_bForm;
   CPDF_ParseOptions m_Options;
   CPDF_Type3Char* m_pType3Char;
-  FX_DWORD m_nStreams;
+  uint32_t m_nStreams;
   std::unique_ptr<CPDF_StreamAcc> m_pSingleStream;
   std::vector<std::unique_ptr<CPDF_StreamAcc>> m_StreamArray;
   uint8_t* m_pData;
-  FX_DWORD m_Size;
-  FX_DWORD m_CurrentOffset;
+  uint32_t m_Size;
+  uint32_t m_CurrentOffset;
   std::unique_ptr<CPDF_StreamContentParser> m_pParser;
 };
 
@@ -361,7 +361,7 @@
   using CPDF_FontFileMap = std::map<CPDF_Stream*, CPDF_CountedStreamAcc*>;
   using CPDF_FontMap = std::map<CPDF_Dictionary*, CPDF_CountedFont*>;
   using CPDF_IccProfileMap = std::map<CPDF_Stream*, CPDF_CountedIccProfile*>;
-  using CPDF_ImageMap = std::map<FX_DWORD, CPDF_CountedImage*>;
+  using CPDF_ImageMap = std::map<uint32_t, CPDF_CountedImage*>;
   using CPDF_PatternMap = std::map<CPDF_Object*, CPDF_CountedPattern*>;
 
   CPDF_Document* const m_pPDFDoc;
@@ -441,14 +441,14 @@
 
 class CPDF_IccProfile {
  public:
-  CPDF_IccProfile(const uint8_t* pData, FX_DWORD dwSize);
+  CPDF_IccProfile(const uint8_t* pData, uint32_t dwSize);
   ~CPDF_IccProfile();
-  FX_DWORD GetComponents() const { return m_nSrcComponents; }
+  uint32_t GetComponents() const { return m_nSrcComponents; }
   FX_BOOL m_bsRGB;
   void* m_pTransform;
 
  private:
-  FX_DWORD m_nSrcComponents;
+  uint32_t m_nSrcComponents;
 };
 
 class CPDF_DeviceCS : public CPDF_ColorSpace {
diff --git a/core/fpdfapi/fpdf_parser/cfdf_document.cpp b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
index dec8fbd..9cbf999 100644
--- a/core/fpdfapi/fpdf_parser/cfdf_document.cpp
+++ b/core/fpdfapi/fpdf_parser/cfdf_document.cpp
@@ -40,7 +40,7 @@
   }
   return pDoc;
 }
-CFDF_Document* CFDF_Document::ParseMemory(const uint8_t* pData, FX_DWORD size) {
+CFDF_Document* CFDF_Document::ParseMemory(const uint8_t* pData, uint32_t size) {
   return CFDF_Document::ParseFile(FX_CreateMemoryStream((uint8_t*)pData, size),
                                   TRUE);
 }
@@ -53,7 +53,7 @@
     bool bNumber;
     CFX_ByteString word = parser.GetNextWord(&bNumber);
     if (bNumber) {
-      FX_DWORD objnum = FXSYS_atoui(word);
+      uint32_t objnum = FXSYS_atoui(word);
       word = parser.GetNextWord(&bNumber);
       if (!bNumber) {
         break;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_array.cpp b/core/fpdfapi/fpdf_parser/cpdf_array.cpp
index acd39a9..69de5bb 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_array.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_array.cpp
@@ -76,43 +76,43 @@
   return matrix;
 }
 
-CPDF_Object* CPDF_Array::GetElement(FX_DWORD i) const {
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+CPDF_Object* CPDF_Array::GetElement(uint32_t i) const {
+  if (i >= (uint32_t)m_Objects.GetSize())
     return nullptr;
   return m_Objects.GetAt(i);
 }
 
-CPDF_Object* CPDF_Array::GetElementValue(FX_DWORD i) const {
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+CPDF_Object* CPDF_Array::GetElementValue(uint32_t i) const {
+  if (i >= (uint32_t)m_Objects.GetSize())
     return nullptr;
   return m_Objects.GetAt(i)->GetDirect();
 }
 
-CFX_ByteString CPDF_Array::GetStringAt(FX_DWORD i) const {
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+CFX_ByteString CPDF_Array::GetStringAt(uint32_t i) const {
+  if (i >= (uint32_t)m_Objects.GetSize())
     return CFX_ByteString();
   return m_Objects.GetAt(i)->GetString();
 }
 
-CFX_ByteStringC CPDF_Array::GetConstStringAt(FX_DWORD i) const {
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+CFX_ByteStringC CPDF_Array::GetConstStringAt(uint32_t i) const {
+  if (i >= (uint32_t)m_Objects.GetSize())
     return CFX_ByteStringC();
   return m_Objects.GetAt(i)->GetConstString();
 }
 
-int CPDF_Array::GetIntegerAt(FX_DWORD i) const {
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+int CPDF_Array::GetIntegerAt(uint32_t i) const {
+  if (i >= (uint32_t)m_Objects.GetSize())
     return 0;
   return m_Objects.GetAt(i)->GetInteger();
 }
 
-FX_FLOAT CPDF_Array::GetNumberAt(FX_DWORD i) const {
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+FX_FLOAT CPDF_Array::GetNumberAt(uint32_t i) const {
+  if (i >= (uint32_t)m_Objects.GetSize())
     return 0;
   return m_Objects.GetAt(i)->GetNumber();
 }
 
-CPDF_Dictionary* CPDF_Array::GetDictAt(FX_DWORD i) const {
+CPDF_Dictionary* CPDF_Array::GetDictAt(uint32_t i) const {
   CPDF_Object* p = GetElementValue(i);
   if (!p)
     return NULL;
@@ -123,16 +123,16 @@
   return NULL;
 }
 
-CPDF_Stream* CPDF_Array::GetStreamAt(FX_DWORD i) const {
+CPDF_Stream* CPDF_Array::GetStreamAt(uint32_t i) const {
   return ToStream(GetElementValue(i));
 }
 
-CPDF_Array* CPDF_Array::GetArrayAt(FX_DWORD i) const {
+CPDF_Array* CPDF_Array::GetArrayAt(uint32_t i) const {
   return ToArray(GetElementValue(i));
 }
 
-void CPDF_Array::RemoveAt(FX_DWORD i, int nCount) {
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+void CPDF_Array::RemoveAt(uint32_t i, int nCount) {
+  if (i >= (uint32_t)m_Objects.GetSize())
     return;
 
   if (nCount <= 0 || nCount > m_Objects.GetSize() - i)
@@ -145,12 +145,12 @@
   m_Objects.RemoveAt(i, nCount);
 }
 
-void CPDF_Array::SetAt(FX_DWORD i,
+void CPDF_Array::SetAt(uint32_t i,
                        CPDF_Object* pObj,
                        CPDF_IndirectObjectHolder* pObjs) {
   ASSERT(IsArray());
-  ASSERT(i < (FX_DWORD)m_Objects.GetSize());
-  if (i >= (FX_DWORD)m_Objects.GetSize())
+  ASSERT(i < (uint32_t)m_Objects.GetSize());
+  if (i >= (uint32_t)m_Objects.GetSize())
     return;
   if (CPDF_Object* pOld = m_Objects.GetAt(i))
     pOld->Release();
@@ -161,7 +161,7 @@
   m_Objects.SetAt(i, pObj);
 }
 
-void CPDF_Array::InsertAt(FX_DWORD index,
+void CPDF_Array::InsertAt(uint32_t index,
                           CPDF_Object* pObj,
                           CPDF_IndirectObjectHolder* pObjs) {
   if (pObj->GetObjNum()) {
@@ -201,7 +201,7 @@
 }
 
 void CPDF_Array::AddReference(CPDF_IndirectObjectHolder* pDoc,
-                              FX_DWORD objnum) {
+                              uint32_t objnum) {
   ASSERT(IsArray());
   Add(new CPDF_Reference(pDoc, objnum));
 }
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
index 2c41c13..858133d 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp
@@ -46,7 +46,7 @@
   m_Pos = 0;
   m_dwFileLen = 0;
   if (m_pFileRead) {
-    m_dwFileLen = (FX_DWORD)m_pFileRead->GetSize();
+    m_dwFileLen = (uint32_t)m_pFileRead->GetSize();
   }
   m_dwCurrentOffset = 0;
   m_dwXRefOffset = 0;
@@ -107,7 +107,7 @@
   m_pDocument = pDoc;
 }
 
-FX_DWORD CPDF_DataAvail::GetObjectSize(FX_DWORD objnum, FX_FILESIZE& offset) {
+uint32_t CPDF_DataAvail::GetObjectSize(uint32_t objnum, FX_FILESIZE& offset) {
   CPDF_Parser* pParser = m_pDocument->GetParser();
   if (!pParser || !pParser->IsValidObjectNumber(objnum))
     return 0;
@@ -140,7 +140,7 @@
   if (!obj_array.GetSize())
     return TRUE;
 
-  FX_DWORD count = 0;
+  uint32_t count = 0;
   CFX_ArrayTemplate<CPDF_Object*> new_obj_array;
   int32_t i = 0;
   for (i = 0; i < obj_array.GetSize(); i++) {
@@ -152,7 +152,7 @@
     switch (type) {
       case CPDF_Object::ARRAY: {
         CPDF_Array* pArray = pObj->GetArray();
-        for (FX_DWORD k = 0; k < pArray->GetCount(); ++k)
+        for (uint32_t k = 0; k < pArray->GetCount(); ++k)
           new_obj_array.Add(pArray->GetElement(k));
       } break;
       case CPDF_Object::STREAM:
@@ -171,10 +171,10 @@
       } break;
       case CPDF_Object::REFERENCE: {
         CPDF_Reference* pRef = pObj->AsReference();
-        FX_DWORD dwNum = pRef->GetRefObjNum();
+        uint32_t dwNum = pRef->GetRefObjNum();
 
         FX_FILESIZE offset;
-        FX_DWORD size = GetObjectSize(dwNum, offset);
+        uint32_t size = GetObjectSize(dwNum, offset);
         if (size == 0 || offset < 0 || offset >= m_dwFileLen)
           break;
 
@@ -197,7 +197,7 @@
     for (i = 0; i < iSize; ++i) {
       CPDF_Object* pObj = new_obj_array[i];
       if (CPDF_Reference* pRef = pObj->AsReference()) {
-        FX_DWORD dwNum = pRef->GetRefObjNum();
+        uint32_t dwNum = pRef->GetRefObjNum();
         if (!pdfium::ContainsKey(m_ObjectSet, dwNum))
           ret_array.Add(pObj);
       } else {
@@ -215,7 +215,7 @@
 IPDF_DataAvail::DocAvailStatus CPDF_DataAvail::IsDocAvail(
     IPDF_DataAvail::DownloadHints* pHints) {
   if (!m_dwFileLen && m_pFileRead) {
-    m_dwFileLen = (FX_DWORD)m_pFileRead->GetSize();
+    m_dwFileLen = (uint32_t)m_pFileRead->GetSize();
     if (!m_dwFileLen)
       return DataError;
   }
@@ -343,17 +343,17 @@
 }
 
 FX_BOOL CPDF_DataAvail::LoadAllFile(IPDF_DataAvail::DownloadHints* pHints) {
-  if (m_pFileAvail->IsDataAvail(0, (FX_DWORD)m_dwFileLen)) {
+  if (m_pFileAvail->IsDataAvail(0, (uint32_t)m_dwFileLen)) {
     m_docStatus = PDF_DATAAVAIL_DONE;
     return TRUE;
   }
 
-  pHints->AddSegment(0, (FX_DWORD)m_dwFileLen);
+  pHints->AddSegment(0, (uint32_t)m_dwFileLen);
   return FALSE;
 }
 
 FX_BOOL CPDF_DataAvail::LoadAllXref(IPDF_DataAvail::DownloadHints* pHints) {
-  m_parser.m_pSyntax->InitParser(m_pFileRead, (FX_DWORD)m_dwHeaderOffset);
+  m_parser.m_pSyntax->InitParser(m_pFileRead, (uint32_t)m_dwHeaderOffset);
   m_parser.m_bOwnFileRead = false;
   if (!m_parser.LoadAllCrossRefV4(m_dwLastXRefOffset) &&
       !m_parser.LoadAllCrossRefV5(m_dwLastXRefOffset)) {
@@ -368,11 +368,11 @@
   return TRUE;
 }
 
-CPDF_Object* CPDF_DataAvail::GetObject(FX_DWORD objnum,
+CPDF_Object* CPDF_DataAvail::GetObject(uint32_t objnum,
                                        IPDF_DataAvail::DownloadHints* pHints,
                                        FX_BOOL* pExistInFile) {
   CPDF_Object* pRet = nullptr;
-  FX_DWORD size = 0;
+  uint32_t size = 0;
   FX_FILESIZE offset = 0;
   CPDF_Parser* pParser = nullptr;
 
@@ -383,7 +383,7 @@
     size = GetObjectSize(objnum, offset);
     pParser = m_pDocument->GetParser();
   } else {
-    size = (FX_DWORD)m_parser.GetObjectSize(objnum);
+    size = (uint32_t)m_parser.GetObjectSize(objnum);
     offset = m_parser.GetObjectOffset(objnum);
     pParser = &m_parser;
   }
@@ -498,10 +498,10 @@
 }
 
 FX_BOOL CPDF_DataAvail::CheckPage(IPDF_DataAvail::DownloadHints* pHints) {
-  FX_DWORD iPageObjs = m_PageObjList.GetSize();
-  CFX_ArrayTemplate<FX_DWORD> UnavailObjList;
-  for (FX_DWORD i = 0; i < iPageObjs; ++i) {
-    FX_DWORD dwPageObjNum = m_PageObjList.GetAt(i);
+  uint32_t iPageObjs = m_PageObjList.GetSize();
+  CFX_ArrayTemplate<uint32_t> UnavailObjList;
+  for (uint32_t i = 0; i < iPageObjs; ++i) {
+    uint32_t dwPageObjNum = m_PageObjList.GetAt(i);
     FX_BOOL bExist = FALSE;
     CPDF_Object* pObj = GetObject(dwPageObjNum, pHints, &bExist);
     if (!pObj) {
@@ -540,8 +540,8 @@
     return FALSE;
   }
 
-  FX_DWORD iPages = m_PagesArray.GetSize();
-  for (FX_DWORD i = 0; i < iPages; i++) {
+  uint32_t iPages = m_PagesArray.GetSize();
+  for (uint32_t i = 0; i < iPages; i++) {
     CPDF_Object* pPages = m_PagesArray.GetAt(i);
     if (!pPages)
       continue;
@@ -583,7 +583,7 @@
       break;
     case CPDF_Object::ARRAY: {
       CPDF_Array* pKidsArray = pKids->AsArray();
-      for (FX_DWORD i = 0; i < pKidsArray->GetCount(); ++i) {
+      for (uint32_t i = 0; i < pKidsArray->GetCount(); ++i) {
         if (CPDF_Reference* pRef = ToReference(pKidsArray->GetElement(i)))
           m_PageObjList.Add(pRef->GetRefObjNum());
       }
@@ -623,9 +623,9 @@
 }
 
 FX_BOOL CPDF_DataAvail::CheckHeader(IPDF_DataAvail::DownloadHints* pHints) {
-  FX_DWORD req_size = 1024;
+  uint32_t req_size = 1024;
   if ((FX_FILESIZE)req_size > m_dwFileLen)
-    req_size = (FX_DWORD)m_dwFileLen;
+    req_size = (uint32_t)m_dwFileLen;
 
   if (m_pFileAvail->IsDataAvail(0, req_size)) {
     uint8_t buffer[1024];
@@ -667,10 +667,10 @@
 
   FX_BOOL bNeedDownLoad = FALSE;
   if (pEndOffSet->IsNumber()) {
-    FX_DWORD dwEnd = pEndOffSet->GetInteger();
+    uint32_t dwEnd = pEndOffSet->GetInteger();
     dwEnd += 512;
     if ((FX_FILESIZE)dwEnd > m_dwFileLen)
-      dwEnd = (FX_DWORD)m_dwFileLen;
+      dwEnd = (uint32_t)m_dwFileLen;
 
     int32_t iStartPos = (int32_t)(m_dwFileLen > 1024 ? 1024 : m_dwFileLen);
     int32_t iSize = dwEnd > 1024 ? dwEnd - 1024 : 0;
@@ -689,9 +689,9 @@
     dwFileLen = pFileLen->GetInteger();
 
   if (!m_pFileAvail->IsDataAvail(m_dwLastXRefOffset,
-                                 (FX_DWORD)(dwFileLen - m_dwLastXRefOffset))) {
+                                 (uint32_t)(dwFileLen - m_dwLastXRefOffset))) {
     if (m_docStatus == PDF_DATAAVAIL_FIRSTPAGE) {
-      FX_DWORD dwSize = (FX_DWORD)(dwFileLen - m_dwLastXRefOffset);
+      uint32_t dwSize = (uint32_t)(dwFileLen - m_dwLastXRefOffset);
       FX_FILESIZE offset = m_dwLastXRefOffset;
       if (dwSize < 512 && dwFileLen > 512) {
         dwSize = 512;
@@ -714,12 +714,12 @@
 }
 
 FX_BOOL CPDF_DataAvail::IsDataAvail(FX_FILESIZE offset,
-                                    FX_DWORD size,
+                                    uint32_t size,
                                     IPDF_DataAvail::DownloadHints* pHints) {
   if (offset > m_dwFileLen)
     return TRUE;
 
-  FX_SAFE_DWORD safeSize = pdfium::base::checked_cast<FX_DWORD>(offset);
+  FX_SAFE_DWORD safeSize = pdfium::base::checked_cast<uint32_t>(offset);
   safeSize += size;
   safeSize += 512;
   if (!safeSize.IsValid() || safeSize.ValueOrDie() > m_dwFileLen)
@@ -785,7 +785,7 @@
 
 CPDF_Object* CPDF_DataAvail::ParseIndirectObjectAt(
     FX_FILESIZE pos,
-    FX_DWORD objnum,
+    uint32_t objnum,
     CPDF_IndirectObjectHolder* pObjList) {
   FX_FILESIZE SavedPos = m_syntaxParser.SavePos();
   m_syntaxParser.RestorePos(pos);
@@ -795,7 +795,7 @@
   if (!bIsNumber)
     return nullptr;
 
-  FX_DWORD parser_objnum = FXSYS_atoui(word);
+  uint32_t parser_objnum = FXSYS_atoui(word);
   if (objnum && parser_objnum != objnum)
     return nullptr;
 
@@ -803,7 +803,7 @@
   if (!bIsNumber)
     return nullptr;
 
-  FX_DWORD gennum = FXSYS_atoui(word);
+  uint32_t gennum = FXSYS_atoui(word);
   if (m_syntaxParser.GetKeyword() != "obj") {
     m_syntaxParser.RestorePos(SavedPos);
     return nullptr;
@@ -816,7 +816,7 @@
 }
 
 IPDF_DataAvail::DocLinearizationStatus CPDF_DataAvail::IsLinearizedPDF() {
-  FX_DWORD req_size = 1024;
+  uint32_t req_size = 1024;
   if (!m_pFileAvail->IsDataAvail(0, req_size))
     return LinearizationUnknown;
 
@@ -834,7 +834,7 @@
 
   return NotLinearized;
 }
-FX_BOOL CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen) {
+FX_BOOL CPDF_DataAvail::IsLinearizedFile(uint8_t* pData, uint32_t dwLen) {
   ScopedFileStream file(FX_CreateMemoryStream(pData, (size_t)dwLen, FALSE));
 
   int32_t offset = GetHeaderOffset(file.get());
@@ -852,7 +852,7 @@
   if (!bNumber)
     return FALSE;
 
-  FX_DWORD objnum = FXSYS_atoui(wordObjNum);
+  uint32_t objnum = FXSYS_atoui(wordObjNum);
   if (m_pLinearized) {
     m_pLinearized->Release();
     m_pLinearized = nullptr;
@@ -883,8 +883,8 @@
 }
 
 FX_BOOL CPDF_DataAvail::CheckEnd(IPDF_DataAvail::DownloadHints* pHints) {
-  FX_DWORD req_pos = (FX_DWORD)(m_dwFileLen > 1024 ? m_dwFileLen - 1024 : 0);
-  FX_DWORD dwSize = (FX_DWORD)(m_dwFileLen - req_pos);
+  uint32_t req_pos = (uint32_t)(m_dwFileLen > 1024 ? m_dwFileLen - 1024 : 0);
+  uint32_t dwSize = (uint32_t)(m_dwFileLen - req_pos);
 
   if (m_pFileAvail->IsDataAvail(req_pos, dwSize)) {
     uint8_t buffer[1024];
@@ -928,8 +928,8 @@
     IPDF_DataAvail::DownloadHints* pHints,
     FX_FILESIZE& xref_offset) {
   xref_offset = 0;
-  FX_DWORD req_size =
-      (FX_DWORD)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
+  uint32_t req_size =
+      (uint32_t)(m_Pos + 512 > m_dwFileLen ? m_dwFileLen - m_Pos : 512);
 
   if (m_pFileAvail->IsDataAvail(m_Pos, req_size)) {
     int32_t iSize = (int32_t)(m_Pos + req_size - m_dwCurrentXRefSteam);
@@ -946,7 +946,7 @@
     if (!bNumber)
       return -1;
 
-    FX_DWORD objNum = FXSYS_atoui(objnum);
+    uint32_t objNum = FXSYS_atoui(objnum);
     CPDF_Object* pObj = m_parser.ParseIndirectObjectAt(nullptr, 0, objNum);
     if (!pObj) {
       m_Pos += m_parser.m_pSyntax->SavePos();
@@ -997,7 +997,7 @@
   }
 
   uint8_t buffer[256];
-  FX_DWORD index = 0;
+  uint32_t index = 0;
   if (PDFCharIsDelimiter(ch)) {
     buffer[index++] = ch;
     if (ch == '/') {
@@ -1063,9 +1063,9 @@
   if (m_bufferOffset >= pos ||
       (FX_FILESIZE)(m_bufferOffset + m_bufferSize) <= pos) {
     FX_FILESIZE read_pos = pos;
-    FX_DWORD read_size = 512;
+    uint32_t read_size = 512;
     if ((FX_FILESIZE)read_size > m_dwFileLen)
-      read_size = (FX_DWORD)m_dwFileLen;
+      read_size = (uint32_t)m_dwFileLen;
 
     if ((FX_FILESIZE)(read_pos + read_size) > m_dwFileLen)
       read_pos = m_dwFileLen - read_size;
@@ -1210,7 +1210,7 @@
       return TRUE;
     }
 
-    FX_DWORD xrefpos = GetDirectInteger(pTrailerDict, "Prev");
+    uint32_t xrefpos = GetDirectInteger(pTrailerDict, "Prev");
     if (xrefpos) {
       m_dwPrevXRefOffset = GetDirectInteger(pTrailerDict, "XRefStm");
       if (m_dwPrevXRefOffset) {
@@ -1259,7 +1259,7 @@
 }
 
 FX_BOOL CPDF_DataAvail::CheckArrayPageNode(
-    FX_DWORD dwPageNo,
+    uint32_t dwPageNo,
     CPDF_DataAvail::PageNode* pPageNode,
     IPDF_DataAvail::DownloadHints* pHints) {
   FX_BOOL bExist = FALSE;
@@ -1285,7 +1285,7 @@
   }
 
   pPageNode->m_type = PDF_PAGENODE_PAGES;
-  for (FX_DWORD i = 0; i < pArray->GetCount(); ++i) {
+  for (uint32_t i = 0; i < pArray->GetCount(); ++i) {
     CPDF_Reference* pKid = ToReference(pArray->GetElement(i));
     if (!pKid)
       continue;
@@ -1299,7 +1299,7 @@
 }
 
 FX_BOOL CPDF_DataAvail::CheckUnkownPageNode(
-    FX_DWORD dwPageNo,
+    uint32_t dwPageNo,
     CPDF_DataAvail::PageNode* pPageNode,
     IPDF_DataAvail::DownloadHints* pHints) {
   FX_BOOL bExist = FALSE;
@@ -1348,7 +1348,7 @@
       } break;
       case CPDF_Object::ARRAY: {
         CPDF_Array* pKidsArray = pKids->AsArray();
-        for (FX_DWORD i = 0; i < pKidsArray->GetCount(); ++i) {
+        for (uint32_t i = 0; i < pKidsArray->GetCount(); ++i) {
           CPDF_Reference* pKid = ToReference(pKidsArray->GetElement(i));
           if (!pKid)
             continue;
@@ -1623,7 +1623,7 @@
     return DataAvailable;
 
   if (m_bLinearized) {
-    if ((FX_DWORD)iPage == m_dwFirstPageNo) {
+    if ((uint32_t)iPage == m_dwFirstPageNo) {
       DocAvailStatus nRet = CheckLinearizedFirstPage(iPage, pHints);
       if (nRet == DataAvailable)
         m_pagesLoadState.insert(iPage);
@@ -1753,11 +1753,11 @@
 }
 
 void CPDF_DataAvail::GetLinearizedMainXRefInfo(FX_FILESIZE* pPos,
-                                               FX_DWORD* pSize) {
+                                               uint32_t* pSize) {
   if (pPos)
     *pPos = m_dwLastXRefOffset;
   if (pSize)
-    *pSize = (FX_DWORD)(m_dwFileLen - m_dwLastXRefOffset);
+    *pSize = (uint32_t)(m_dwFileLen - m_dwLastXRefOffset);
 }
 
 int CPDF_DataAvail::GetPageCount() const {
@@ -1781,13 +1781,13 @@
     if (m_pHintTables && index != pageNum) {
       FX_FILESIZE szPageStartPos = 0;
       FX_FILESIZE szPageLength = 0;
-      FX_DWORD dwObjNum = 0;
+      uint32_t dwObjNum = 0;
       FX_BOOL bPagePosGot = m_pHintTables->GetPagePos(index, szPageStartPos,
                                                       szPageLength, dwObjNum);
       if (!bPagePosGot)
         return nullptr;
 
-      m_syntaxParser.InitParser(m_pFileRead, (FX_DWORD)szPageStartPos);
+      m_syntaxParser.InitParser(m_pFileRead, (uint32_t)szPageStartPos);
       CPDF_Object* pPageDict = ParseIndirectObjectAt(0, dwObjNum, m_pDocument);
       if (!pPageDict)
         return nullptr;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_data_avail.h b/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
index 036de72..f7da8f0 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_data_avail.h
@@ -63,7 +63,7 @@
   DocFormStatus IsFormAvail(DownloadHints* pHints) override;
   DocLinearizationStatus IsLinearizedPDF() override;
   FX_BOOL IsLinearized() override { return m_bLinearized; }
-  void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, FX_DWORD* pSize) override;
+  void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos, uint32_t* pSize) override;
 
   int GetPageCount() const;
   CPDF_Dictionary* GetPage(int index);
@@ -77,7 +77,7 @@
     ~PageNode();
 
     PDF_PAGENODE_TYPE m_type;
-    FX_DWORD m_dwPageNo;
+    uint32_t m_dwPageNo;
     CFX_ArrayTemplate<PageNode*> m_childNode;
   };
 
@@ -85,7 +85,7 @@
   static int s_CurrentDataAvailRecursionDepth;
   static const int kMaxPageRecursionDepth = 1024;
 
-  FX_DWORD GetObjectSize(FX_DWORD objnum, FX_FILESIZE& offset);
+  uint32_t GetObjectSize(uint32_t objnum, FX_FILESIZE& offset);
   FX_BOOL IsObjectsAvail(CFX_ArrayTemplate<CPDF_Object*>& obj_array,
                          FX_BOOL bParsePage,
                          IPDF_DataAvail::DownloadHints* pHints,
@@ -112,15 +112,15 @@
 
   int32_t CheckCrossRefStream(IPDF_DataAvail::DownloadHints* pHints,
                               FX_FILESIZE& xref_offset);
-  FX_BOOL IsLinearizedFile(uint8_t* pData, FX_DWORD dwLen);
+  FX_BOOL IsLinearizedFile(uint8_t* pData, uint32_t dwLen);
   void SetStartOffset(FX_FILESIZE dwOffset);
   FX_BOOL GetNextToken(CFX_ByteString& token);
   FX_BOOL GetNextChar(uint8_t& ch);
   CPDF_Object* ParseIndirectObjectAt(
       FX_FILESIZE pos,
-      FX_DWORD objnum,
+      uint32_t objnum,
       CPDF_IndirectObjectHolder* pObjList = nullptr);
-  CPDF_Object* GetObject(FX_DWORD objnum,
+  CPDF_Object* GetObject(uint32_t objnum,
                          IPDF_DataAvail::DownloadHints* pHints,
                          FX_BOOL* pExistInFile);
   FX_BOOL GetPageKids(CPDF_Parser* pParser, CPDF_Object* pPages);
@@ -143,24 +143,24 @@
                         int32_t& iCount,
                         IPDF_DataAvail::DownloadHints* pHints,
                         int level);
-  FX_BOOL CheckUnkownPageNode(FX_DWORD dwPageNo,
+  FX_BOOL CheckUnkownPageNode(uint32_t dwPageNo,
                               PageNode* pPageNode,
                               IPDF_DataAvail::DownloadHints* pHints);
-  FX_BOOL CheckArrayPageNode(FX_DWORD dwPageNo,
+  FX_BOOL CheckArrayPageNode(uint32_t dwPageNo,
                              PageNode* pPageNode,
                              IPDF_DataAvail::DownloadHints* pHints);
   FX_BOOL CheckPageCount(IPDF_DataAvail::DownloadHints* pHints);
   bool IsFirstCheck(int iPage);
   void ResetFirstCheck(int iPage);
   FX_BOOL IsDataAvail(FX_FILESIZE offset,
-                      FX_DWORD size,
+                      uint32_t size,
                       IPDF_DataAvail::DownloadHints* pHints);
 
   CPDF_Parser m_parser;
   CPDF_SyntaxParser m_syntaxParser;
   CPDF_Object* m_pRoot;
-  FX_DWORD m_dwRootObjNum;
-  FX_DWORD m_dwInfoObjNum;
+  uint32_t m_dwRootObjNum;
+  uint32_t m_dwInfoObjNum;
   CPDF_Object* m_pLinearized;
   CPDF_Object* m_pTrailer;
   FX_BOOL m_bDocAvail;
@@ -172,18 +172,18 @@
   PDF_DATAAVAIL_STATUS m_docStatus;
   FX_FILESIZE m_dwFileLen;
   CPDF_Document* m_pDocument;
-  std::set<FX_DWORD> m_ObjectSet;
+  std::set<uint32_t> m_ObjectSet;
   CFX_ArrayTemplate<CPDF_Object*> m_objs_array;
   FX_FILESIZE m_Pos;
   FX_FILESIZE m_bufferOffset;
-  FX_DWORD m_bufferSize;
+  uint32_t m_bufferSize;
   CFX_ByteString m_WordBuf;
   uint8_t m_bufferData[512];
-  CFX_ArrayTemplate<FX_DWORD> m_XRefStreamList;
-  CFX_ArrayTemplate<FX_DWORD> m_PageObjList;
-  FX_DWORD m_PagesObjNum;
+  CFX_ArrayTemplate<uint32_t> m_XRefStreamList;
+  CFX_ArrayTemplate<uint32_t> m_PageObjList;
+  uint32_t m_PagesObjNum;
   FX_BOOL m_bLinearized;
-  FX_DWORD m_dwFirstPageNo;
+  uint32_t m_dwFirstPageNo;
   FX_BOOL m_bLinearedDataOK;
   FX_BOOL m_bMainXRefLoadTried;
   FX_BOOL m_bMainXRefLoadedOK;
@@ -193,7 +193,7 @@
   FX_FILESIZE m_dwCurrentXRefSteam;
   FX_BOOL m_bAnnotsLoad;
   FX_BOOL m_bHaveAcroForm;
-  FX_DWORD m_dwAcroFormObjNum;
+  uint32_t m_dwAcroFormObjNum;
   FX_BOOL m_bAcroFormLoad;
   CPDF_Object* m_pAcroForm;
   CFX_ArrayTemplate<CPDF_Object*> m_arrayAcroforms;
@@ -203,13 +203,13 @@
   FX_BOOL m_bPageLoadedOK;
   FX_BOOL m_bLinearizedFormParamLoad;
   CFX_ArrayTemplate<CPDF_Object*> m_PagesArray;
-  FX_DWORD m_dwEncryptObjNum;
+  uint32_t m_dwEncryptObjNum;
   FX_FILESIZE m_dwPrevXRefOffset;
   FX_BOOL m_bTotalLoadPageTree;
   FX_BOOL m_bCurPageDictLoadOK;
   PageNode m_pageNodes;
-  std::set<FX_DWORD> m_pageMapCheckState;
-  std::set<FX_DWORD> m_pagesLoadState;
+  std::set<uint32_t> m_pageMapCheckState;
+  std::set<uint32_t> m_pagesLoadState;
   std::unique_ptr<CPDF_HintTables> m_pHintTables;
   FX_BOOL m_bSupportHintTable;
 };
diff --git a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp
index 0155c43..75730e5 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_dictionary.cpp
@@ -229,13 +229,13 @@
 
 void CPDF_Dictionary::SetAtReference(const CFX_ByteStringC& key,
                                      CPDF_IndirectObjectHolder* pDoc,
-                                     FX_DWORD objnum) {
+                                     uint32_t objnum) {
   SetAt(key, new CPDF_Reference(pDoc, objnum));
 }
 
 void CPDF_Dictionary::AddReference(const CFX_ByteStringC& key,
                                    CPDF_IndirectObjectHolder* pDoc,
-                                   FX_DWORD objnum) {
+                                   uint32_t objnum) {
   SetAt(key, new CPDF_Reference(pDoc, objnum));
 }
 
diff --git a/core/fpdfapi/fpdf_parser/cpdf_document.cpp b/core/fpdfapi/fpdf_parser/cpdf_document.cpp
index eb9a483..9ed8b3f 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_document.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_document.cpp
@@ -32,7 +32,7 @@
     return 0;
   }
   count = 0;
-  for (FX_DWORD i = 0; i < pKidList->GetCount(); i++) {
+  for (uint32_t i = 0; i < pKidList->GetCount(); i++) {
     CPDF_Dictionary* pKid = pKidList->GetDictAt(i);
     if (!pKid || pdfium::ContainsKey(*visited_pages, pKid)) {
       continue;
@@ -114,7 +114,7 @@
     m_ID1 = pIDArray->GetStringAt(0);
     m_ID2 = pIDArray->GetStringAt(1);
   }
-  FX_DWORD dwPageCount = 0;
+  uint32_t dwPageCount = 0;
   CPDF_Object* pCount = pLinearized->GetElement("N");
   if (ToNumber(pCount))
     dwPageCount = pCount->GetInteger();
@@ -216,8 +216,8 @@
 }
 
 int CPDF_Document::_FindPageIndex(CPDF_Dictionary* pNode,
-                                  FX_DWORD& skip_count,
-                                  FX_DWORD objnum,
+                                  uint32_t& skip_count,
+                                  uint32_t objnum,
                                   int& index,
                                   int level) {
   if (pNode->KeyExist("Kids")) {
@@ -228,14 +228,14 @@
     if (level >= FX_MAX_PAGE_LEVEL) {
       return -1;
     }
-    FX_DWORD count = pNode->GetIntegerBy("Count");
+    uint32_t count = pNode->GetIntegerBy("Count");
     if (count <= skip_count) {
       skip_count -= count;
       index += count;
       return -1;
     }
     if (count && count == pKidList->GetCount()) {
-      for (FX_DWORD i = 0; i < count; i++) {
+      for (uint32_t i = 0; i < count; i++) {
         if (CPDF_Reference* pKid = ToReference(pKidList->GetElement(i))) {
           if (pKid->GetRefObjNum() == objnum) {
             m_PageList.SetAt(index + i, objnum);
@@ -244,7 +244,7 @@
         }
       }
     }
-    for (FX_DWORD i = 0; i < pKidList->GetCount(); i++) {
+    for (uint32_t i = 0; i < pKidList->GetCount(); i++) {
       CPDF_Dictionary* pKid = pKidList->GetDictAt(i);
       if (!pKid) {
         continue;
@@ -269,12 +269,12 @@
   }
   return -1;
 }
-int CPDF_Document::GetPageIndex(FX_DWORD objnum) {
-  FX_DWORD nPages = m_PageList.GetSize();
-  FX_DWORD skip_count = 0;
+int CPDF_Document::GetPageIndex(uint32_t objnum) {
+  uint32_t nPages = m_PageList.GetSize();
+  uint32_t skip_count = 0;
   FX_BOOL bSkipped = FALSE;
-  for (FX_DWORD i = 0; i < nPages; i++) {
-    FX_DWORD objnum1 = m_PageList.GetAt(i);
+  for (uint32_t i = 0; i < nPages; i++) {
+    uint32_t objnum1 = m_PageList.GetAt(i);
     if (objnum1 == objnum) {
       return i;
     }
@@ -315,14 +315,14 @@
   return CountPages(pPages, &visited_pages);
 }
 
-FX_DWORD CPDF_Document::GetUserPermissions(FX_BOOL bCheckRevision) const {
+uint32_t CPDF_Document::GetUserPermissions(FX_BOOL bCheckRevision) const {
   if (!m_pParser) {
-    return (FX_DWORD)-1;
+    return (uint32_t)-1;
   }
   return m_pParser->GetPermissions(bCheckRevision);
 }
 
-FX_BOOL CPDF_Document::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const {
+FX_BOOL CPDF_Document::IsFormStream(uint32_t objnum, FX_BOOL& bForm) const {
   auto it = m_IndirectObjs.find(objnum);
   if (it != m_IndirectObjs.end()) {
     CPDF_Stream* pStream = it->second->AsStream();
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
index eafda43..dd2be01 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
@@ -30,7 +30,7 @@
   m_dwIdentifierArray.RemoveAll();
 }
 
-FX_DWORD CPDF_HintTables::GetItemLength(
+uint32_t CPDF_HintTables::GetItemLength(
     int index,
     const std::vector<FX_FILESIZE>& szArray) {
   if (index < 0 || szArray.size() < 2 ||
@@ -50,17 +50,17 @@
   if (nStreamOffset < 0 || nStreamLen < 1)
     return FALSE;
 
-  const FX_DWORD kHeaderSize = 288;
+  const uint32_t kHeaderSize = 288;
   if (hStream->BitsRemaining() < kHeaderSize)
     return FALSE;
 
   // Item 1: The least number of objects in a page.
-  FX_DWORD dwObjLeastNum = hStream->GetBits(32);
+  uint32_t dwObjLeastNum = hStream->GetBits(32);
 
   // Item 2: The location of the first page's page object.
-  FX_DWORD dwFirstObjLoc = hStream->GetBits(32);
+  uint32_t dwFirstObjLoc = hStream->GetBits(32);
   if (dwFirstObjLoc > nStreamOffset) {
-    FX_SAFE_DWORD safeLoc = pdfium::base::checked_cast<FX_DWORD>(nStreamLen);
+    FX_SAFE_DWORD safeLoc = pdfium::base::checked_cast<uint32_t>(nStreamLen);
     safeLoc += dwFirstObjLoc;
     if (!safeLoc.IsValid())
       return FALSE;
@@ -73,31 +73,31 @@
 
   // Item 3: The number of bits needed to represent the difference
   // between the greatest and least number of objects in a page.
-  FX_DWORD dwDeltaObjectsBits = hStream->GetBits(16);
+  uint32_t dwDeltaObjectsBits = hStream->GetBits(16);
 
   // Item 4: The least length of a page in bytes.
-  FX_DWORD dwPageLeastLen = hStream->GetBits(32);
+  uint32_t dwPageLeastLen = hStream->GetBits(32);
 
   // Item 5: The number of bits needed to represent the difference
   // between the greatest and least length of a page, in bytes.
-  FX_DWORD dwDeltaPageLenBits = hStream->GetBits(16);
+  uint32_t dwDeltaPageLenBits = hStream->GetBits(16);
 
   // Skip Item 6, 7, 8, 9 total 96 bits.
   hStream->SkipBits(96);
 
   // Item 10: The number of bits needed to represent the greatest
   // number of shared object references.
-  FX_DWORD dwSharedObjBits = hStream->GetBits(16);
+  uint32_t dwSharedObjBits = hStream->GetBits(16);
 
   // Item 11: The number of bits needed to represent the numerically
   // greatest shared object identifier used by the pages.
-  FX_DWORD dwSharedIdBits = hStream->GetBits(16);
+  uint32_t dwSharedIdBits = hStream->GetBits(16);
 
   // Item 12: The number of bits needed to represent the numerator of
   // the fractional position for each shared object reference. For each
   // shared object referenced from a page, there is an indication of
   // where in the page's content stream the object is first referenced.
-  FX_DWORD dwSharedNumeratorBits = hStream->GetBits(16);
+  uint32_t dwSharedNumeratorBits = hStream->GetBits(16);
 
   // Item 13: Skip Item 13 which has 16 bits.
   hStream->SkipBits(16);
@@ -108,7 +108,7 @@
     return FALSE;
 
   FX_SAFE_DWORD required_bits = dwDeltaObjectsBits;
-  required_bits *= pdfium::base::checked_cast<FX_DWORD>(nPages);
+  required_bits *= pdfium::base::checked_cast<uint32_t>(nPages);
   if (!CanReadFromBitStream(hStream, required_bits))
     return FALSE;
 
@@ -122,11 +122,11 @@
   hStream->ByteAlign();
 
   required_bits = dwDeltaPageLenBits;
-  required_bits *= pdfium::base::checked_cast<FX_DWORD>(nPages);
+  required_bits *= pdfium::base::checked_cast<uint32_t>(nPages);
   if (!CanReadFromBitStream(hStream, required_bits))
     return FALSE;
 
-  CFX_ArrayTemplate<FX_DWORD> dwPageLenArray;
+  CFX_ArrayTemplate<uint32_t> dwPageLenArray;
   for (int i = 0; i < nPages; ++i) {
     FX_SAFE_DWORD safePageLen = hStream->GetBits(dwDeltaPageLenBits);
     safePageLen += dwPageLeastLen;
@@ -170,7 +170,7 @@
 
   // Number of shared objects.
   required_bits = dwSharedObjBits;
-  required_bits *= pdfium::base::checked_cast<FX_DWORD>(nPages);
+  required_bits *= pdfium::base::checked_cast<uint32_t>(nPages);
   if (!CanReadFromBitStream(hStream, required_bits))
     return FALSE;
 
@@ -200,7 +200,7 @@
   }
   hStream->ByteAlign();
 
-  FX_SAFE_DWORD safeTotalPageLen = pdfium::base::checked_cast<FX_DWORD>(nPages);
+  FX_SAFE_DWORD safeTotalPageLen = pdfium::base::checked_cast<uint32_t>(nPages);
   safeTotalPageLen *= dwDeltaPageLenBits;
   if (!CanReadFromBitStream(hStream, safeTotalPageLen))
     return FALSE;
@@ -211,7 +211,7 @@
 }
 
 FX_BOOL CPDF_HintTables::ReadSharedObjHintTable(CFX_BitStream* hStream,
-                                                FX_DWORD offset) {
+                                                uint32_t offset) {
   if (!hStream || hStream->IsEOF())
     return FALSE;
 
@@ -226,16 +226,16 @@
     return FALSE;
   hStream->SkipBits(bit_offset.ValueOrDie() - hStream->GetPos());
 
-  const FX_DWORD kHeaderSize = 192;
+  const uint32_t kHeaderSize = 192;
   if (hStream->BitsRemaining() < kHeaderSize)
     return FALSE;
 
   // Item 1: The object number of the first object in the shared objects
   // section.
-  FX_DWORD dwFirstSharedObjNum = hStream->GetBits(32);
+  uint32_t dwFirstSharedObjNum = hStream->GetBits(32);
 
   // Item 2: The location of the first object in the shared objects section.
-  FX_DWORD dwFirstSharedObjLoc = hStream->GetBits(32);
+  uint32_t dwFirstSharedObjLoc = hStream->GetBits(32);
   if (dwFirstSharedObjLoc > nStreamOffset)
     dwFirstSharedObjLoc += nStreamLen;
 
@@ -244,31 +244,31 @@
 
   // Item 4: The number of shared object entries for the shared objects
   // section, including the number of shared object entries for the first page.
-  FX_DWORD dwSharedObjTotal = hStream->GetBits(32);
+  uint32_t dwSharedObjTotal = hStream->GetBits(32);
 
   // Item 5: The number of bits needed to represent the greatest number of
   // objects in a shared object group. Skipped.
   hStream->SkipBits(16);
 
   // Item 6: The least length of a shared object group in bytes.
-  FX_DWORD dwGroupLeastLen = hStream->GetBits(32);
+  uint32_t dwGroupLeastLen = hStream->GetBits(32);
 
   // Item 7: The number of bits needed to represent the difference between the
   // greatest and least length of a shared object group, in bytes.
-  FX_DWORD dwDeltaGroupLen = hStream->GetBits(16);
+  uint32_t dwDeltaGroupLen = hStream->GetBits(16);
   CPDF_Object* pFirstPageObj = m_pLinearizedDict->GetElementValue("O");
   int nFirstPageObjNum = pFirstPageObj ? pFirstPageObj->GetInteger() : -1;
   if (nFirstPageObjNum < 0)
     return FALSE;
 
-  FX_DWORD dwPrevObjLen = 0;
-  FX_DWORD dwCurObjLen = 0;
+  uint32_t dwPrevObjLen = 0;
+  uint32_t dwCurObjLen = 0;
   FX_SAFE_DWORD required_bits = dwSharedObjTotal;
   required_bits *= dwDeltaGroupLen;
   if (!CanReadFromBitStream(hStream, required_bits))
     return FALSE;
 
-  for (FX_DWORD i = 0; i < dwSharedObjTotal; ++i) {
+  for (uint32_t i = 0; i < dwSharedObjTotal; ++i) {
     dwPrevObjLen = dwCurObjLen;
     FX_SAFE_DWORD safeObjLen = hStream->GetBits(dwDeltaGroupLen);
     safeObjLen += dwGroupLeastLen;
@@ -324,7 +324,7 @@
 FX_BOOL CPDF_HintTables::GetPagePos(int index,
                                     FX_FILESIZE& szPageStartPos,
                                     FX_FILESIZE& szPageLength,
-                                    FX_DWORD& dwObjNum) {
+                                    uint32_t& dwObjNum) {
   if (!m_pLinearizedDict)
     return FALSE;
 
@@ -365,7 +365,7 @@
   if (index == nFirstAvailPage)
     return IPDF_DataAvail::DataAvailable;
 
-  FX_DWORD dwLength = GetItemLength(index, m_szPageOffsetArray);
+  uint32_t dwLength = GetItemLength(index, m_szPageOffsetArray);
   // If two pages have the same offset, it should be treated as an error.
   if (!dwLength)
     return IPDF_DataAvail::DataError;
@@ -374,7 +374,7 @@
     return IPDF_DataAvail::DataNotAvailable;
 
   // Download data of shared objects in the page.
-  FX_DWORD offset = 0;
+  uint32_t offset = 0;
   for (int i = 0; i < index; ++i)
     offset += m_dwNSharedObjsArray[i];
 
@@ -383,8 +383,8 @@
   if (nFirstPageObjNum < 0)
     return IPDF_DataAvail::DataError;
 
-  FX_DWORD dwIndex = 0;
-  FX_DWORD dwObjNum = 0;
+  uint32_t dwIndex = 0;
+  uint32_t dwObjNum = 0;
   for (int j = 0; j < m_dwNSharedObjsArray[index]; ++j) {
     dwIndex = m_dwIdentifierArray[offset + j];
     if (dwIndex >= m_dwSharedObjNumArray.GetSize())
@@ -422,11 +422,11 @@
   CPDF_StreamAcc acc;
   acc.LoadAllData(pHintStream);
 
-  FX_DWORD size = acc.GetSize();
+  uint32_t size = acc.GetSize();
   // The header section of page offset hint table is 36 bytes.
   // The header section of shared object hint table is 24 bytes.
   // Hint table has at least 60 bytes.
-  const FX_DWORD MIN_STREAM_LEN = 60;
+  const uint32_t MIN_STREAM_LEN = 60;
   if (size < MIN_STREAM_LEN || shared_hint_table_offset <= 0 ||
       size < shared_hint_table_offset) {
     return FALSE;
@@ -435,7 +435,7 @@
   CFX_BitStream bs;
   bs.Init(acc.GetData(), size);
   return ReadPageHintTable(&bs) &&
-         ReadSharedObjHintTable(&bs, pdfium::base::checked_cast<FX_DWORD>(
+         ReadSharedObjHintTable(&bs, pdfium::base::checked_cast<uint32_t>(
                                          shared_hint_table_offset));
 }
 
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
index f6f862f..28ccccb 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
@@ -30,7 +30,7 @@
   FX_BOOL GetPagePos(int index,
                      FX_FILESIZE& szPageStartPos,
                      FX_FILESIZE& szPageLength,
-                     FX_DWORD& dwObjNum);
+                     uint32_t& dwObjNum);
 
   IPDF_DataAvail::DocAvailStatus CheckPage(
       int index,
@@ -40,8 +40,8 @@
 
  protected:
   FX_BOOL ReadPageHintTable(CFX_BitStream* hStream);
-  FX_BOOL ReadSharedObjHintTable(CFX_BitStream* hStream, FX_DWORD offset);
-  FX_DWORD GetItemLength(int index, const std::vector<FX_FILESIZE>& szArray);
+  FX_BOOL ReadSharedObjHintTable(CFX_BitStream* hStream, uint32_t offset);
+  uint32_t GetItemLength(int index, const std::vector<FX_FILESIZE>& szArray);
 
  private:
   int ReadPrimaryHintStreamOffset() const;
@@ -49,12 +49,12 @@
 
   CPDF_Dictionary* m_pLinearizedDict;
   CPDF_DataAvail* m_pDataAvail;
-  FX_DWORD m_nFirstPageSharedObjs;
+  uint32_t m_nFirstPageSharedObjs;
   FX_FILESIZE m_szFirstPageObjOffset;
-  CFX_ArrayTemplate<FX_DWORD> m_dwDeltaNObjsArray;
-  CFX_ArrayTemplate<FX_DWORD> m_dwNSharedObjsArray;
-  CFX_ArrayTemplate<FX_DWORD> m_dwSharedObjNumArray;
-  CFX_ArrayTemplate<FX_DWORD> m_dwIdentifierArray;
+  CFX_ArrayTemplate<uint32_t> m_dwDeltaNObjsArray;
+  CFX_ArrayTemplate<uint32_t> m_dwNSharedObjsArray;
+  CFX_ArrayTemplate<uint32_t> m_dwSharedObjNumArray;
+  CFX_ArrayTemplate<uint32_t> m_dwIdentifierArray;
   std::vector<FX_FILESIZE> m_szPageOffsetArray;
   std::vector<FX_FILESIZE> m_szSharedObjOffsetArray;
 };
diff --git a/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp b/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
index 1de1ef2..14410da 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_indirect_object_holder.cpp
@@ -20,7 +20,7 @@
     pair.second->Destroy();
 }
 
-CPDF_Object* CPDF_IndirectObjectHolder::GetIndirectObject(FX_DWORD objnum) {
+CPDF_Object* CPDF_IndirectObjectHolder::GetIndirectObject(uint32_t objnum) {
   if (objnum == 0)
     return nullptr;
 
@@ -44,7 +44,7 @@
   return pObj;
 }
 
-FX_DWORD CPDF_IndirectObjectHolder::AddIndirectObject(CPDF_Object* pObj) {
+uint32_t CPDF_IndirectObjectHolder::AddIndirectObject(CPDF_Object* pObj) {
   if (pObj->m_ObjNum)
     return pObj->m_ObjNum;
 
@@ -54,7 +54,7 @@
   return m_LastObjNum;
 }
 
-void CPDF_IndirectObjectHolder::ReleaseIndirectObject(FX_DWORD objnum) {
+void CPDF_IndirectObjectHolder::ReleaseIndirectObject(uint32_t objnum) {
   auto it = m_IndirectObjs.find(objnum);
   if (it == m_IndirectObjs.end() || it->second->GetObjNum() == -1)
     return;
@@ -62,7 +62,7 @@
   m_IndirectObjs.erase(it);
 }
 
-FX_BOOL CPDF_IndirectObjectHolder::InsertIndirectObject(FX_DWORD objnum,
+FX_BOOL CPDF_IndirectObjectHolder::InsertIndirectObject(uint32_t objnum,
                                                         CPDF_Object* pObj) {
   if (!objnum || !pObj)
     return FALSE;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
index 5312e62..bebd3d6 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp
@@ -31,10 +31,10 @@
 
 // A limit on the maximum object number in the xref table. Theoretical limits
 // are higher, but this may be large enough in practice.
-const FX_DWORD kMaxObjectNumber = 1048576;
+const uint32_t kMaxObjectNumber = 1048576;
 
-FX_DWORD GetVarInt(const uint8_t* p, int32_t n) {
-  FX_DWORD result = 0;
+uint32_t GetVarInt(const uint8_t* p, int32_t n) {
+  uint32_t result = 0;
   for (int32_t i = 0; i < n; ++i)
     result = result * 256 + p[i];
   return result;
@@ -67,32 +67,32 @@
   CloseParser();
 }
 
-FX_DWORD CPDF_Parser::GetLastObjNum() const {
+uint32_t CPDF_Parser::GetLastObjNum() const {
   return m_ObjectInfo.empty() ? 0 : m_ObjectInfo.rbegin()->first;
 }
 
-bool CPDF_Parser::IsValidObjectNumber(FX_DWORD objnum) const {
+bool CPDF_Parser::IsValidObjectNumber(uint32_t objnum) const {
   return !m_ObjectInfo.empty() && objnum <= m_ObjectInfo.rbegin()->first;
 }
 
-FX_FILESIZE CPDF_Parser::GetObjectPositionOrZero(FX_DWORD objnum) const {
+FX_FILESIZE CPDF_Parser::GetObjectPositionOrZero(uint32_t objnum) const {
   auto it = m_ObjectInfo.find(objnum);
   return it != m_ObjectInfo.end() ? it->second.pos : 0;
 }
 
-uint8_t CPDF_Parser::GetObjectType(FX_DWORD objnum) const {
+uint8_t CPDF_Parser::GetObjectType(uint32_t objnum) const {
   ASSERT(IsValidObjectNumber(objnum));
   auto it = m_ObjectInfo.find(objnum);
   return it != m_ObjectInfo.end() ? it->second.type : 0;
 }
 
-uint16_t CPDF_Parser::GetObjectGenNum(FX_DWORD objnum) const {
+uint16_t CPDF_Parser::GetObjectGenNum(uint32_t objnum) const {
   ASSERT(IsValidObjectNumber(objnum));
   auto it = m_ObjectInfo.find(objnum);
   return it != m_ObjectInfo.end() ? it->second.gennum : 0;
 }
 
-bool CPDF_Parser::IsObjectFreeOrNull(FX_DWORD objnum) const {
+bool CPDF_Parser::IsObjectFreeOrNull(uint32_t objnum) const {
   uint8_t type = GetObjectType(objnum);
   return type == 0 || type == 255;
 }
@@ -109,7 +109,7 @@
   return m_pSyntax->m_pFileAccess;
 }
 
-void CPDF_Parser::ShrinkObjectMap(FX_DWORD objnum) {
+void CPDF_Parser::ShrinkObjectMap(uint32_t objnum) {
   if (objnum == 0) {
     m_ObjectInfo.clear();
     return;
@@ -302,7 +302,7 @@
   m_pSecurityHandler.reset();
 }
 
-FX_FILESIZE CPDF_Parser::GetObjectOffset(FX_DWORD objnum) const {
+FX_FILESIZE CPDF_Parser::GetObjectOffset(uint32_t objnum) const {
   if (!IsValidObjectNumber(objnum))
     return 0;
 
@@ -371,7 +371,7 @@
 }
 
 FX_BOOL CPDF_Parser::LoadLinearizedAllCrossRefV4(FX_FILESIZE xrefpos,
-                                                 FX_DWORD dwObjCount) {
+                                                 uint32_t dwObjCount) {
   if (!LoadLinearizedCrossRefV4(xrefpos, dwObjCount))
     return FALSE;
 
@@ -424,14 +424,14 @@
 }
 
 FX_BOOL CPDF_Parser::LoadLinearizedCrossRefV4(FX_FILESIZE pos,
-                                              FX_DWORD dwObjCount) {
+                                              uint32_t dwObjCount) {
   FX_FILESIZE dwStartPos = pos - m_pSyntax->m_HeaderOffset;
 
   m_pSyntax->RestorePos(dwStartPos);
   m_SortedOffset.insert(pos);
 
-  FX_DWORD start_objnum = 0;
-  FX_DWORD count = dwObjCount;
+  uint32_t start_objnum = 0;
+  uint32_t count = dwObjCount;
   FX_FILESIZE SavedPos = m_pSyntax->SavePos();
 
   const int32_t recordsize = 20;
@@ -441,7 +441,7 @@
   int32_t nBlocks = count / 1024 + 1;
   for (int32_t block = 0; block < nBlocks; block++) {
     int32_t block_size = block == nBlocks - 1 ? count % 1024 : 1024;
-    FX_DWORD dwReadSize = block_size * recordsize;
+    uint32_t dwReadSize = block_size * recordsize;
     if ((FX_FILESIZE)(dwStartPos + dwReadSize) > m_pSyntax->m_FileLen)
       return FALSE;
 
@@ -451,7 +451,7 @@
     }
 
     for (int32_t i = 0; i < block_size; i++) {
-      FX_DWORD objnum = start_objnum + block * 1024 + i;
+      uint32_t objnum = start_objnum + block * 1024 + i;
       char* pEntry = &buf[i * recordsize];
       if (pEntry[17] == 'f') {
         m_ObjectInfo[objnum].pos = 0;
@@ -505,11 +505,11 @@
       break;
     }
 
-    FX_DWORD start_objnum = FXSYS_atoui(word);
+    uint32_t start_objnum = FXSYS_atoui(word);
     if (start_objnum >= kMaxObjectNumber)
       return false;
 
-    FX_DWORD count = m_pSyntax->GetDirectNum();
+    uint32_t count = m_pSyntax->GetDirectNum();
     m_pSyntax->ToNextWord();
     SavedPos = m_pSyntax->SavePos();
     const int32_t recordsize = 20;
@@ -526,7 +526,7 @@
                              block_size * recordsize);
 
         for (int32_t i = 0; i < block_size; i++) {
-          FX_DWORD objnum = start_objnum + block * 1024 + i;
+          uint32_t objnum = start_objnum + block * 1024 + i;
           char* pEntry = &buf[i * recordsize];
           if (pEntry[17] == 'f') {
             m_ObjectInfo[objnum].pos = 0;
@@ -589,11 +589,11 @@
   ParserState state = ParserState::kDefault;
 
   int32_t inside_index = 0;
-  FX_DWORD objnum = 0;
-  FX_DWORD gennum = 0;
+  uint32_t objnum = 0;
+  uint32_t gennum = 0;
   int32_t depth = 0;
 
-  const FX_DWORD kBufferSize = 4096;
+  const uint32_t kBufferSize = 4096;
   std::vector<uint8_t> buffer(kBufferSize);
 
   FX_FILESIZE pos = m_pSyntax->m_HeaderOffset;
@@ -606,12 +606,12 @@
   while (pos < m_pSyntax->m_FileLen) {
     const FX_FILESIZE saved_pos = pos;
     bool bOverFlow = false;
-    FX_DWORD size =
-        std::min((FX_DWORD)(m_pSyntax->m_FileLen - pos), kBufferSize);
+    uint32_t size =
+        std::min((uint32_t)(m_pSyntax->m_FileLen - pos), kBufferSize);
     if (!m_pSyntax->m_pFileAccess->ReadBlock(buffer.data(), pos, size))
       break;
 
-    for (FX_DWORD i = 0; i < size; i++) {
+    for (uint32_t i = 0; i < size; i++) {
       uint8_t byte = buffer[i];
       switch (state) {
         case ParserState::kDefault:
@@ -763,17 +763,17 @@
                   offset += 3;
 
                 FX_FILESIZE nLen = obj_end - obj_pos - offset;
-                if ((FX_DWORD)nLen > size - i) {
+                if ((uint32_t)nLen > size - i) {
                   pos = obj_end + m_pSyntax->m_HeaderOffset;
                   bOverFlow = true;
                 } else {
-                  i += (FX_DWORD)nLen;
+                  i += (uint32_t)nLen;
                 }
 
                 if (!m_ObjectInfo.empty() && IsValidObjectNumber(objnum) &&
                     m_ObjectInfo[objnum].pos) {
                   if (pObject) {
-                    FX_DWORD oldgen = GetObjectGenNum(objnum);
+                    uint32_t oldgen = GetObjectGenNum(objnum);
                     m_ObjectInfo[objnum].pos = obj_pos;
                     m_ObjectInfo[objnum].gennum = gennum;
                     if (oldgen != gennum)
@@ -819,7 +819,7 @@
                           const CFX_ByteString& key = it->first;
                           CPDF_Object* pElement = it->second;
                           ++it;
-                          FX_DWORD dwObjNum =
+                          uint32_t dwObjNum =
                               pElement ? pElement->GetObjNum() : 0;
                           if (dwObjNum) {
                             m_pTrailer->SetAtReference(key, m_pDocument,
@@ -987,8 +987,8 @@
   std::vector<std::pair<int32_t, int32_t>> arrIndex;
   CPDF_Array* pArray = pStream->GetDict()->GetArrayBy("Index");
   if (pArray) {
-    FX_DWORD nPairSize = pArray->GetCount() / 2;
-    for (FX_DWORD i = 0; i < nPairSize; i++) {
+    uint32_t nPairSize = pArray->GetCount() / 2;
+    for (uint32_t i = 0; i < nPairSize; i++) {
       CPDF_Object* pStartNumObj = pArray->GetElement(i * 2);
       CPDF_Object* pCountObj = pArray->GetElement(i * 2 + 1);
 
@@ -1010,9 +1010,9 @@
     return FALSE;
   }
 
-  CFX_ArrayTemplate<FX_DWORD> WidthArray;
+  CFX_ArrayTemplate<uint32_t> WidthArray;
   FX_SAFE_DWORD dwAccWidth = 0;
-  for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+  for (uint32_t i = 0; i < pArray->GetCount(); i++) {
     WidthArray.Add(pArray->GetIntegerAt(i));
     dwAccWidth += WidthArray[i];
   }
@@ -1022,22 +1022,22 @@
     return FALSE;
   }
 
-  FX_DWORD totalWidth = dwAccWidth.ValueOrDie();
+  uint32_t totalWidth = dwAccWidth.ValueOrDie();
   CPDF_StreamAcc acc;
   acc.LoadAllData(pStream);
 
   const uint8_t* pData = acc.GetData();
-  FX_DWORD dwTotalSize = acc.GetSize();
-  FX_DWORD segindex = 0;
-  for (FX_DWORD i = 0; i < arrIndex.size(); i++) {
+  uint32_t dwTotalSize = acc.GetSize();
+  uint32_t segindex = 0;
+  for (uint32_t i = 0; i < arrIndex.size(); i++) {
     int32_t startnum = arrIndex[i].first;
     if (startnum < 0)
       continue;
 
     m_dwXrefStartObjNum =
-        pdfium::base::checked_cast<FX_DWORD, int32_t>(startnum);
-    FX_DWORD count =
-        pdfium::base::checked_cast<FX_DWORD, int32_t>(arrIndex[i].second);
+        pdfium::base::checked_cast<uint32_t, int32_t>(startnum);
+    uint32_t count =
+        pdfium::base::checked_cast<uint32_t, int32_t>(arrIndex[i].second);
     FX_SAFE_DWORD dwCaculatedSize = segindex;
     dwCaculatedSize += count;
     dwCaculatedSize *= totalWidth;
@@ -1049,11 +1049,11 @@
     const uint8_t* segstart = pData + segindex * totalWidth;
     FX_SAFE_DWORD dwMaxObjNum = startnum;
     dwMaxObjNum += count;
-    FX_DWORD dwV5Size = m_ObjectInfo.empty() ? 0 : GetLastObjNum() + 1;
+    uint32_t dwV5Size = m_ObjectInfo.empty() ? 0 : GetLastObjNum() + 1;
     if (!dwMaxObjNum.IsValid() || dwMaxObjNum.ValueOrDie() > dwV5Size)
       continue;
 
-    for (FX_DWORD j = 0; j < count; j++) {
+    for (uint32_t j = 0; j < count; j++) {
       int32_t type = 1;
       const uint8_t* entrystart = segstart + j * totalWidth;
       if (WidthArray[0])
@@ -1106,19 +1106,19 @@
   return ToArray(pID);
 }
 
-FX_DWORD CPDF_Parser::GetRootObjNum() {
+uint32_t CPDF_Parser::GetRootObjNum() {
   CPDF_Reference* pRef =
       ToReference(m_pTrailer ? m_pTrailer->GetElement("Root") : nullptr);
   return pRef ? pRef->GetRefObjNum() : 0;
 }
 
-FX_DWORD CPDF_Parser::GetInfoObjNum() {
+uint32_t CPDF_Parser::GetInfoObjNum() {
   CPDF_Reference* pRef =
       ToReference(m_pTrailer ? m_pTrailer->GetElement("Info") : nullptr);
   return pRef ? pRef->GetRefObjNum() : 0;
 }
 
-FX_BOOL CPDF_Parser::IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) {
+FX_BOOL CPDF_Parser::IsFormStream(uint32_t objnum, FX_BOOL& bForm) {
   bForm = FALSE;
   if (!IsValidObjectNumber(objnum))
     return TRUE;
@@ -1150,7 +1150,7 @@
 
 CPDF_Object* CPDF_Parser::ParseIndirectObject(
     CPDF_IndirectObjectHolder* pObjList,
-    FX_DWORD objnum) {
+    uint32_t objnum) {
   if (!IsValidObjectNumber(objnum))
     return nullptr;
 
@@ -1158,7 +1158,7 @@
   if (pdfium::ContainsKey(m_ParsingObjNums, objnum))
     return nullptr;
 
-  pdfium::ScopedSetInsertion<FX_DWORD> local_insert(&m_ParsingObjNums, objnum);
+  pdfium::ScopedSetInsertion<uint32_t> local_insert(&m_ParsingObjNums, objnum);
   if (GetObjectType(objnum) == 1 || GetObjectType(objnum) == 255) {
     FX_FILESIZE pos = m_ObjectInfo[objnum].pos;
     if (pos <= 0)
@@ -1181,8 +1181,8 @@
   // Read object numbers from |pObjStream| into a cache.
   if (!pdfium::ContainsKey(m_ObjCache, pObjStream)) {
     for (int32_t i = GetStreamNCount(pObjStream); i > 0; --i) {
-      FX_DWORD thisnum = syntax.GetDirectNum();
-      FX_DWORD thisoff = syntax.GetDirectNum();
+      uint32_t thisnum = syntax.GetDirectNum();
+      uint32_t thisoff = syntax.GetDirectNum();
       m_ObjCache[pObjStream][thisnum] = thisoff;
     }
   }
@@ -1195,7 +1195,7 @@
   return syntax.GetObject(pObjList, 0, 0, true);
 }
 
-CPDF_StreamAcc* CPDF_Parser::GetObjectStream(FX_DWORD objnum) {
+CPDF_StreamAcc* CPDF_Parser::GetObjectStream(uint32_t objnum) {
   auto it = m_ObjectStreamMap.find(objnum);
   if (it != m_ObjectStreamMap.end())
     return it->second.get();
@@ -1213,7 +1213,7 @@
   return pStreamAcc;
 }
 
-FX_FILESIZE CPDF_Parser::GetObjectSize(FX_DWORD objnum) const {
+FX_FILESIZE CPDF_Parser::GetObjectSize(uint32_t objnum) const {
   if (!IsValidObjectNumber(objnum))
     return 0;
 
@@ -1234,9 +1234,9 @@
   return *it - offset;
 }
 
-void CPDF_Parser::GetIndirectBinary(FX_DWORD objnum,
+void CPDF_Parser::GetIndirectBinary(uint32_t objnum,
                                     uint8_t*& pBuffer,
-                                    FX_DWORD& size) {
+                                    uint32_t& size) {
   pBuffer = nullptr;
   size = 0;
   if (!IsValidObjectNumber(objnum))
@@ -1249,15 +1249,15 @@
 
     int32_t offset = GetStreamFirst(pObjStream);
     const uint8_t* pData = pObjStream->GetData();
-    FX_DWORD totalsize = pObjStream->GetSize();
+    uint32_t totalsize = pObjStream->GetSize();
     ScopedFileStream file(
         FX_CreateMemoryStream((uint8_t*)pData, (size_t)totalsize, FALSE));
 
     CPDF_SyntaxParser syntax;
     syntax.InitParser(file.get(), 0);
     for (int i = GetStreamNCount(pObjStream); i > 0; --i) {
-      FX_DWORD thisnum = syntax.GetDirectNum();
-      FX_DWORD thisoff = syntax.GetDirectNum();
+      uint32_t thisnum = syntax.GetDirectNum();
+      uint32_t thisoff = syntax.GetDirectNum();
       if (thisnum != objnum)
         continue;
 
@@ -1265,7 +1265,7 @@
         size = totalsize - (thisoff + offset);
       } else {
         syntax.GetDirectNum();  // Skip nextnum.
-        FX_DWORD nextoff = syntax.GetDirectNum();
+        uint32_t nextoff = syntax.GetDirectNum();
         size = nextoff - thisoff;
       }
 
@@ -1293,7 +1293,7 @@
     return;
   }
 
-  FX_DWORD parser_objnum = FXSYS_atoui(word);
+  uint32_t parser_objnum = FXSYS_atoui(word);
   if (parser_objnum && parser_objnum != objnum) {
     m_pSyntax->RestorePos(SavedPos);
     return;
@@ -1343,7 +1343,7 @@
     nextoff = m_pSyntax->SavePos();
   }
 
-  size = (FX_DWORD)(nextoff - pos);
+  size = (uint32_t)(nextoff - pos);
   pBuffer = FX_Alloc(uint8_t, size);
   m_pSyntax->RestorePos(pos);
   m_pSyntax->ReadBlock(pBuffer, size);
@@ -1353,7 +1353,7 @@
 CPDF_Object* CPDF_Parser::ParseIndirectObjectAt(
     CPDF_IndirectObjectHolder* pObjList,
     FX_FILESIZE pos,
-    FX_DWORD objnum) {
+    uint32_t objnum) {
   FX_FILESIZE SavedPos = m_pSyntax->SavePos();
   m_pSyntax->RestorePos(pos);
   bool bIsNumber;
@@ -1365,7 +1365,7 @@
 
   FX_FILESIZE objOffset = m_pSyntax->SavePos();
   objOffset -= word.GetLength();
-  FX_DWORD parser_objnum = FXSYS_atoui(word);
+  uint32_t parser_objnum = FXSYS_atoui(word);
   if (objnum && parser_objnum != objnum) {
     m_pSyntax->RestorePos(SavedPos);
     return nullptr;
@@ -1377,7 +1377,7 @@
     return nullptr;
   }
 
-  FX_DWORD parser_gennum = FXSYS_atoui(word);
+  uint32_t parser_gennum = FXSYS_atoui(word);
   if (m_pSyntax->GetKeyword() != "obj") {
     m_pSyntax->RestorePos(SavedPos);
     return nullptr;
@@ -1403,7 +1403,7 @@
 CPDF_Object* CPDF_Parser::ParseIndirectObjectAtByStrict(
     CPDF_IndirectObjectHolder* pObjList,
     FX_FILESIZE pos,
-    FX_DWORD objnum,
+    uint32_t objnum,
     FX_FILESIZE* pResultPos) {
   FX_FILESIZE SavedPos = m_pSyntax->SavePos();
   m_pSyntax->RestorePos(pos);
@@ -1415,7 +1415,7 @@
     return nullptr;
   }
 
-  FX_DWORD parser_objnum = FXSYS_atoui(word);
+  uint32_t parser_objnum = FXSYS_atoui(word);
   if (objnum && parser_objnum != objnum) {
     m_pSyntax->RestorePos(SavedPos);
     return nullptr;
@@ -1427,7 +1427,7 @@
     return nullptr;
   }
 
-  FX_DWORD gennum = FXSYS_atoui(word);
+  uint32_t gennum = FXSYS_atoui(word);
   if (m_pSyntax->GetKeyword() != "obj") {
     m_pSyntax->RestorePos(SavedPos);
     return nullptr;
@@ -1452,11 +1452,11 @@
   return pObj.release()->AsDictionary();
 }
 
-FX_DWORD CPDF_Parser::GetPermissions(FX_BOOL bCheckRevision) {
+uint32_t CPDF_Parser::GetPermissions(FX_BOOL bCheckRevision) {
   if (!m_pSecurityHandler)
-    return (FX_DWORD)-1;
+    return (uint32_t)-1;
 
-  FX_DWORD dwPermission = m_pSecurityHandler->GetPermissions();
+  uint32_t dwPermission = m_pSecurityHandler->GetPermissions();
   if (m_pEncryptDict && m_pEncryptDict->GetStringBy("Filter") == "Standard") {
     dwPermission &= 0xFFFFFFFC;
     dwPermission |= 0xFFFFF0C0;
@@ -1467,7 +1467,7 @@
 }
 
 FX_BOOL CPDF_Parser::IsLinearizedFile(IFX_FileRead* pFileAccess,
-                                      FX_DWORD offset) {
+                                      uint32_t offset) {
   m_pSyntax->InitParser(pFileAccess, offset);
   m_pSyntax->RestorePos(m_pSyntax->m_HeaderOffset + 9);
 
@@ -1477,12 +1477,12 @@
   if (!bIsNumber)
     return FALSE;
 
-  FX_DWORD objnum = FXSYS_atoui(word);
+  uint32_t objnum = FXSYS_atoui(word);
   word = m_pSyntax->GetNextWord(&bIsNumber);
   if (!bIsNumber)
     return FALSE;
 
-  FX_DWORD gennum = FXSYS_atoui(word);
+  uint32_t gennum = FXSYS_atoui(word);
   if (m_pSyntax->GetKeyword() != "obj") {
     m_pSyntax->RestorePos(SavedPos);
     return FALSE;
@@ -1617,7 +1617,7 @@
 }
 
 CPDF_Parser::Error CPDF_Parser::LoadLinearizedMainXRefTable() {
-  FX_DWORD dwSaveMetadataObjnum = m_pSyntax->m_MetadataObjnum;
+  uint32_t dwSaveMetadataObjnum = m_pSyntax->m_MetadataObjnum;
   m_pSyntax->m_MetadataObjnum = 0;
   if (m_pTrailer) {
     m_pTrailer->Release();
@@ -1626,7 +1626,7 @@
 
   m_pSyntax->RestorePos(m_LastXRefOffset - m_pSyntax->m_HeaderOffset);
   uint8_t ch = 0;
-  FX_DWORD dwCount = 0;
+  uint32_t dwCount = 0;
   m_pSyntax->GetNextChar(ch);
   while (PDFCharIsWhitespace(ch)) {
     ++dwCount;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_reference.cpp b/core/fpdfapi/fpdf_parser/cpdf_reference.cpp
index 6aa8fe9..9053d08 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_reference.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_reference.cpp
@@ -62,7 +62,7 @@
   return new CPDF_Reference(m_pObjList, m_RefObjNum);
 }
 
-void CPDF_Reference::SetRef(CPDF_IndirectObjectHolder* pDoc, FX_DWORD objnum) {
+void CPDF_Reference::SetRef(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum) {
   m_pObjList = pDoc;
   m_RefObjNum = objnum;
 }
diff --git a/core/fpdfapi/fpdf_parser/cpdf_simple_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_simple_parser.cpp
index a13fb0f..e32021e 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_simple_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_simple_parser.cpp
@@ -8,13 +8,13 @@
 
 #include "core/fpdfapi/fpdf_parser/fpdf_parser_utility.h"
 
-CPDF_SimpleParser::CPDF_SimpleParser(const uint8_t* pData, FX_DWORD dwSize)
+CPDF_SimpleParser::CPDF_SimpleParser(const uint8_t* pData, uint32_t dwSize)
     : m_pData(pData), m_dwSize(dwSize), m_dwCurPos(0) {}
 
 CPDF_SimpleParser::CPDF_SimpleParser(const CFX_ByteStringC& str)
     : m_pData(str.GetPtr()), m_dwSize(str.GetLength()), m_dwCurPos(0) {}
 
-void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart, FX_DWORD& dwSize) {
+void CPDF_SimpleParser::ParseWord(const uint8_t*& pStart, uint32_t& dwSize) {
   pStart = nullptr;
   dwSize = 0;
   uint8_t ch;
@@ -40,7 +40,7 @@
     }
   }
 
-  FX_DWORD start_pos = m_dwCurPos - 1;
+  uint32_t start_pos = m_dwCurPos - 1;
   pStart = m_pData + start_pos;
   if (PDFCharIsDelimiter(ch)) {
     if (ch == '/') {
@@ -93,7 +93,7 @@
 
 CFX_ByteStringC CPDF_SimpleParser::GetWord() {
   const uint8_t* pStart;
-  FX_DWORD dwSize;
+  uint32_t dwSize;
   ParseWord(pStart, dwSize);
   if (dwSize == 1 && pStart[0] == '<') {
     while (m_dwCurPos < m_dwSize && m_pData[m_dwCurPos] != '>') {
@@ -139,7 +139,7 @@
 bool CPDF_SimpleParser::FindTagParamFromStart(const CFX_ByteStringC& token,
                                               int nParams) {
   nParams++;
-  FX_DWORD* pBuf = FX_Alloc(FX_DWORD, nParams);
+  uint32_t* pBuf = FX_Alloc(uint32_t, nParams);
   int buf_index = 0;
   int buf_count = 0;
   m_dwCurPos = 0;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.cpp b/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.cpp
index 17ef914..4638424 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.cpp
@@ -15,8 +15,8 @@
 
 IPDF_CryptoHandler::~IPDF_CryptoHandler() {}
 
-void IPDF_CryptoHandler::Decrypt(FX_DWORD objnum,
-                                 FX_DWORD gennum,
+void IPDF_CryptoHandler::Decrypt(uint32_t objnum,
+                                 uint32_t gennum,
                                  CFX_ByteString& str) {
   CFX_BinaryBuf dest_buf;
   void* context = DecryptStart(objnum, gennum);
@@ -26,12 +26,12 @@
 }
 
 void CPDF_StandardCryptoHandler::CryptBlock(FX_BOOL bEncrypt,
-                                            FX_DWORD objnum,
-                                            FX_DWORD gennum,
+                                            uint32_t objnum,
+                                            uint32_t gennum,
                                             const uint8_t* src_buf,
-                                            FX_DWORD src_size,
+                                            uint32_t src_size,
                                             uint8_t* dest_buf,
-                                            FX_DWORD& dest_size) {
+                                            uint32_t& dest_size) {
   if (m_Cipher == FXCIPHER_NONE) {
     FXSYS_memcpy(dest_buf, src_buf, src_size);
     return;
@@ -96,11 +96,11 @@
   uint8_t m_Context[2048];
   FX_BOOL m_bIV;
   uint8_t m_Block[16];
-  FX_DWORD m_BlockOffset;
+  uint32_t m_BlockOffset;
 };
 
-void* CPDF_StandardCryptoHandler::CryptStart(FX_DWORD objnum,
-                                             FX_DWORD gennum,
+void* CPDF_StandardCryptoHandler::CryptStart(uint32_t objnum,
+                                             uint32_t gennum,
                                              FX_BOOL bEncrypt) {
   if (m_Cipher == FXCIPHER_NONE) {
     return this;
@@ -151,7 +151,7 @@
 }
 FX_BOOL CPDF_StandardCryptoHandler::CryptStream(void* context,
                                                 const uint8_t* src_buf,
-                                                FX_DWORD src_size,
+                                                uint32_t src_size,
                                                 CFX_BinaryBuf& dest_buf,
                                                 FX_BOOL bEncrypt) {
   if (!context) {
@@ -172,10 +172,10 @@
     dest_buf.AppendBlock(pContext->m_Block, 16);
     pContext->m_bIV = FALSE;
   }
-  FX_DWORD src_off = 0;
-  FX_DWORD src_left = src_size;
+  uint32_t src_off = 0;
+  uint32_t src_left = src_size;
   while (1) {
-    FX_DWORD copy_size = 16 - pContext->m_BlockOffset;
+    uint32_t copy_size = 16 - pContext->m_BlockOffset;
     if (copy_size > src_left) {
       copy_size = src_left;
     }
@@ -244,11 +244,11 @@
   FX_Free(pContext);
   return TRUE;
 }
-void* CPDF_StandardCryptoHandler::DecryptStart(FX_DWORD objnum,
-                                               FX_DWORD gennum) {
+void* CPDF_StandardCryptoHandler::DecryptStart(uint32_t objnum,
+                                               uint32_t gennum) {
   return CryptStart(objnum, gennum, FALSE);
 }
-FX_DWORD CPDF_StandardCryptoHandler::DecryptGetSize(FX_DWORD src_size) {
+uint32_t CPDF_StandardCryptoHandler::DecryptGetSize(uint32_t src_size) {
   return m_Cipher == FXCIPHER_AES ? src_size - 16 : src_size;
 }
 
@@ -306,7 +306,7 @@
 }
 FX_BOOL CPDF_StandardCryptoHandler::DecryptStream(void* context,
                                                   const uint8_t* src_buf,
-                                                  FX_DWORD src_size,
+                                                  uint32_t src_size,
                                                   CFX_BinaryBuf& dest_buf) {
   return CryptStream(context, src_buf, src_size, dest_buf, FALSE);
 }
@@ -314,21 +314,21 @@
                                                   CFX_BinaryBuf& dest_buf) {
   return CryptFinish(context, dest_buf, FALSE);
 }
-FX_DWORD CPDF_StandardCryptoHandler::EncryptGetSize(FX_DWORD objnum,
-                                                    FX_DWORD version,
+uint32_t CPDF_StandardCryptoHandler::EncryptGetSize(uint32_t objnum,
+                                                    uint32_t version,
                                                     const uint8_t* src_buf,
-                                                    FX_DWORD src_size) {
+                                                    uint32_t src_size) {
   if (m_Cipher == FXCIPHER_AES) {
     return src_size + 32;
   }
   return src_size;
 }
-FX_BOOL CPDF_StandardCryptoHandler::EncryptContent(FX_DWORD objnum,
-                                                   FX_DWORD gennum,
+FX_BOOL CPDF_StandardCryptoHandler::EncryptContent(uint32_t objnum,
+                                                   uint32_t gennum,
                                                    const uint8_t* src_buf,
-                                                   FX_DWORD src_size,
+                                                   uint32_t src_size,
                                                    uint8_t* dest_buf,
-                                                   FX_DWORD& dest_size) {
+                                                   uint32_t& dest_size) {
   CryptBlock(TRUE, objnum, gennum, src_buf, src_size, dest_buf, dest_size);
   return TRUE;
 }
diff --git a/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h b/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h
index c40fa7d..689d44b 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_standard_crypto_handler.h
@@ -17,38 +17,38 @@
   // IPDF_CryptoHandler
   FX_BOOL Init(CPDF_Dictionary* pEncryptDict,
                IPDF_SecurityHandler* pSecurityHandler) override;
-  FX_DWORD DecryptGetSize(FX_DWORD src_size) override;
-  void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) override;
+  uint32_t DecryptGetSize(uint32_t src_size) override;
+  void* DecryptStart(uint32_t objnum, uint32_t gennum) override;
   FX_BOOL DecryptStream(void* context,
                         const uint8_t* src_buf,
-                        FX_DWORD src_size,
+                        uint32_t src_size,
                         CFX_BinaryBuf& dest_buf) override;
   FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) override;
-  FX_DWORD EncryptGetSize(FX_DWORD objnum,
-                          FX_DWORD version,
+  uint32_t EncryptGetSize(uint32_t objnum,
+                          uint32_t version,
                           const uint8_t* src_buf,
-                          FX_DWORD src_size) override;
-  FX_BOOL EncryptContent(FX_DWORD objnum,
-                         FX_DWORD version,
+                          uint32_t src_size) override;
+  FX_BOOL EncryptContent(uint32_t objnum,
+                         uint32_t version,
                          const uint8_t* src_buf,
-                         FX_DWORD src_size,
+                         uint32_t src_size,
                          uint8_t* dest_buf,
-                         FX_DWORD& dest_size) override;
+                         uint32_t& dest_size) override;
 
   FX_BOOL Init(int cipher, const uint8_t* key, int keylen);
 
  protected:
   virtual void CryptBlock(FX_BOOL bEncrypt,
-                          FX_DWORD objnum,
-                          FX_DWORD gennum,
+                          uint32_t objnum,
+                          uint32_t gennum,
                           const uint8_t* src_buf,
-                          FX_DWORD src_size,
+                          uint32_t src_size,
                           uint8_t* dest_buf,
-                          FX_DWORD& dest_size);
-  virtual void* CryptStart(FX_DWORD objnum, FX_DWORD gennum, FX_BOOL bEncrypt);
+                          uint32_t& dest_size);
+  virtual void* CryptStart(uint32_t objnum, uint32_t gennum, FX_BOOL bEncrypt);
   virtual FX_BOOL CryptStream(void* context,
                               const uint8_t* src_buf,
-                              FX_DWORD src_size,
+                              uint32_t src_size,
                               CFX_BinaryBuf& dest_buf,
                               FX_BOOL bEncrypt);
   virtual FX_BOOL CryptFinish(void* context,
diff --git a/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.cpp b/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.cpp
index 14e7ed6..ac7667c 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.cpp
@@ -24,14 +24,14 @@
 
 void CalcEncryptKey(CPDF_Dictionary* pEncrypt,
                     const uint8_t* password,
-                    FX_DWORD pass_size,
+                    uint32_t pass_size,
                     uint8_t* key,
                     int keylen,
                     FX_BOOL bIgnoreMeta,
                     CPDF_Array* pIdArray) {
   int revision = pEncrypt->GetIntegerBy("R");
   uint8_t passcode[32];
-  for (FX_DWORD i = 0; i < 32; i++) {
+  for (uint32_t i = 0; i < 32; i++) {
     passcode[i] = i < pass_size ? password[i] : defpasscode[i - pass_size];
   }
   uint8_t md5[100];
@@ -39,7 +39,7 @@
   CRYPT_MD5Update(md5, passcode, 32);
   CFX_ByteString okey = pEncrypt->GetStringBy("O");
   CRYPT_MD5Update(md5, (uint8_t*)okey.c_str(), okey.GetLength());
-  FX_DWORD perm = pEncrypt->GetIntegerBy("P");
+  uint32_t perm = pEncrypt->GetIntegerBy("P");
   CRYPT_MD5Update(md5, (uint8_t*)&perm, 4);
   if (pIdArray) {
     CFX_ByteString id = pIdArray->GetStringAt(0);
@@ -47,12 +47,12 @@
   }
   if (!bIgnoreMeta && revision >= 3 &&
       !pEncrypt->GetIntegerBy("EncryptMetadata", 1)) {
-    FX_DWORD tag = (FX_DWORD)-1;
+    uint32_t tag = (uint32_t)-1;
     CRYPT_MD5Update(md5, (uint8_t*)&tag, 4);
   }
   uint8_t digest[16];
   CRYPT_MD5Finish(md5, digest);
-  FX_DWORD copy_len = keylen;
+  uint32_t copy_len = keylen;
   if (copy_len > sizeof(digest)) {
     copy_len = sizeof(digest);
   }
@@ -111,7 +111,7 @@
   return CheckPassword(password, password.GetLength(), FALSE, m_EncryptKey,
                        key_len);
 }
-FX_DWORD CPDF_StandardSecurityHandler::GetPermissions() {
+uint32_t CPDF_StandardSecurityHandler::GetPermissions() {
   return m_Permissions;
 }
 static FX_BOOL _LoadCryptInfo(CPDF_Dictionary* pEncryptDict,
@@ -180,7 +180,7 @@
 }
 
 FX_BOOL CPDF_StandardSecurityHandler::LoadDict(CPDF_Dictionary* pEncryptDict,
-                                               FX_DWORD type,
+                                               uint32_t type,
                                                int& cipher,
                                                int& key_len) {
   m_pEncryptDict = pEncryptDict;
@@ -213,14 +213,14 @@
 }
 #define FX_GET_32WORD(n, b, i)                                        \
   {                                                                   \
-    (n) = (FX_DWORD)(                                                 \
+    (n) = (uint32_t)(                                                 \
         ((uint64_t)(b)[(i)] << 24) | ((uint64_t)(b)[(i) + 1] << 16) | \
         ((uint64_t)(b)[(i) + 2] << 8) | ((uint64_t)(b)[(i) + 3]));    \
   }
 int BigOrder64BitsMod3(uint8_t* data) {
   uint64_t ret = 0;
   for (int i = 0; i < 4; ++i) {
-    FX_DWORD value;
+    uint32_t value;
     FX_GET_32WORD(value, data, 4 * i);
     ret <<= 32;
     ret |= value;
@@ -229,7 +229,7 @@
   return (int)ret;
 }
 void Revision6_Hash(const uint8_t* password,
-                    FX_DWORD size,
+                    uint32_t size,
                     const uint8_t* salt,
                     const uint8_t* vector,
                     uint8_t* hash) {
@@ -306,7 +306,7 @@
 }
 FX_BOOL CPDF_StandardSecurityHandler::AES256_CheckPassword(
     const uint8_t* password,
-    FX_DWORD size,
+    uint32_t size,
     FX_BOOL bOwner,
     uint8_t* key) {
   CFX_ByteString okey =
@@ -372,8 +372,8 @@
   }
   uint8_t perms_buf[16];
   FXSYS_memset(perms_buf, 0, sizeof(perms_buf));
-  FX_DWORD copy_len = sizeof(perms_buf);
-  if (copy_len > (FX_DWORD)perms.GetLength()) {
+  uint32_t copy_len = sizeof(perms_buf);
+  if (copy_len > (uint32_t)perms.GetLength()) {
     copy_len = perms.GetLength();
   }
   FXSYS_memcpy(perms_buf, (const uint8_t*)perms, copy_len);
@@ -394,7 +394,7 @@
 }
 
 int CPDF_StandardSecurityHandler::CheckPassword(const uint8_t* password,
-                                                FX_DWORD size,
+                                                uint32_t size,
                                                 FX_BOOL bOwner,
                                                 uint8_t* key,
                                                 int32_t key_len) {
@@ -413,7 +413,7 @@
 }
 FX_BOOL CPDF_StandardSecurityHandler::CheckUserPassword(
     const uint8_t* password,
-    FX_DWORD pass_size,
+    uint32_t pass_size,
     FX_BOOL bIgnoreEncryptMeta,
     uint8_t* key,
     int32_t key_len) {
@@ -430,8 +430,8 @@
     CRYPT_ArcFourCryptBlock(ukeybuf, 32, key, key_len);
   } else {
     uint8_t test[32], tmpkey[32];
-    FX_DWORD copy_len = sizeof(test);
-    if (copy_len > (FX_DWORD)ukey.GetLength()) {
+    uint32_t copy_len = sizeof(test);
+    if (copy_len > (uint32_t)ukey.GetLength()) {
       copy_len = ukey.GetLength();
     }
     FXSYS_memset(test, 0, sizeof(test));
@@ -461,11 +461,11 @@
 }
 CFX_ByteString CPDF_StandardSecurityHandler::GetUserPassword(
     const uint8_t* owner_pass,
-    FX_DWORD pass_size,
+    uint32_t pass_size,
     int32_t key_len) {
   CFX_ByteString okey = m_pEncryptDict->GetStringBy("O");
   uint8_t passcode[32];
-  FX_DWORD i;
+  uint32_t i;
   for (i = 0; i < 32; i++) {
     passcode[i] = i < pass_size ? owner_pass[i] : defpasscode[i - pass_size];
   }
@@ -478,7 +478,7 @@
   }
   uint8_t enckey[32];
   FXSYS_memset(enckey, 0, sizeof(enckey));
-  FX_DWORD copy_len = key_len;
+  uint32_t copy_len = key_len;
   if (copy_len > sizeof(digest)) {
     copy_len = sizeof(digest);
   }
@@ -510,7 +510,7 @@
 }
 FX_BOOL CPDF_StandardSecurityHandler::CheckOwnerPassword(
     const uint8_t* password,
-    FX_DWORD pass_size,
+    uint32_t pass_size,
     uint8_t* key,
     int32_t key_len) {
   CFX_ByteString user_pass = GetUserPassword(password, pass_size, key_len);
@@ -528,11 +528,11 @@
 void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict,
                                             CPDF_Array* pIdArray,
                                             const uint8_t* user_pass,
-                                            FX_DWORD user_size,
+                                            uint32_t user_size,
                                             const uint8_t* owner_pass,
-                                            FX_DWORD owner_size,
+                                            uint32_t owner_size,
                                             FX_BOOL bDefault,
-                                            FX_DWORD type) {
+                                            uint32_t type) {
   int cipher = 0, key_len = 0;
   if (!LoadDict(pEncryptDict, type, cipher, key_len)) {
     return;
@@ -561,7 +561,7 @@
   }
   if (bDefault) {
     uint8_t passcode[32];
-    FX_DWORD i;
+    uint32_t i;
     for (i = 0; i < 32; i++) {
       passcode[i] =
           i < owner_size ? owner_pass[i] : defpasscode[i - owner_size];
@@ -622,24 +622,24 @@
 void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict,
                                             CPDF_Array* pIdArray,
                                             const uint8_t* user_pass,
-                                            FX_DWORD user_size,
+                                            uint32_t user_size,
                                             const uint8_t* owner_pass,
-                                            FX_DWORD owner_size,
-                                            FX_DWORD type) {
+                                            uint32_t owner_size,
+                                            uint32_t type) {
   OnCreate(pEncryptDict, pIdArray, user_pass, user_size, owner_pass, owner_size,
            TRUE, type);
 }
 void CPDF_StandardSecurityHandler::OnCreate(CPDF_Dictionary* pEncryptDict,
                                             CPDF_Array* pIdArray,
                                             const uint8_t* user_pass,
-                                            FX_DWORD user_size,
-                                            FX_DWORD type) {
+                                            uint32_t user_size,
+                                            uint32_t type) {
   OnCreate(pEncryptDict, pIdArray, user_pass, user_size, NULL, 0, FALSE, type);
 }
 void CPDF_StandardSecurityHandler::AES256_SetPassword(
     CPDF_Dictionary* pEncryptDict,
     const uint8_t* password,
-    FX_DWORD size,
+    uint32_t size,
     FX_BOOL bOwner,
     const uint8_t* key) {
   uint8_t sha[128];
@@ -687,7 +687,7 @@
 }
 void CPDF_StandardSecurityHandler::AES256_SetPerms(
     CPDF_Dictionary* pEncryptDict,
-    FX_DWORD permissions,
+    uint32_t permissions,
     FX_BOOL bEncryptMetadata,
     const uint8_t* key) {
   uint8_t buf[16];
diff --git a/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h b/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h
index 8c1629c..dfbf6a3 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_standard_security_handler.h
@@ -22,7 +22,7 @@
 
   // IPDF_SecurityHandler:
   FX_BOOL OnInit(CPDF_Parser* pParser, CPDF_Dictionary* pEncryptDict) override;
-  FX_DWORD GetPermissions() override;
+  uint32_t GetPermissions() override;
   FX_BOOL GetCryptInfo(int& cipher,
                        const uint8_t*& buffer,
                        int& keylen) override;
@@ -32,22 +32,22 @@
   void OnCreate(CPDF_Dictionary* pEncryptDict,
                 CPDF_Array* pIdArray,
                 const uint8_t* user_pass,
-                FX_DWORD user_size,
+                uint32_t user_size,
                 const uint8_t* owner_pass,
-                FX_DWORD owner_size,
-                FX_DWORD type = PDF_ENCRYPT_CONTENT);
+                uint32_t owner_size,
+                uint32_t type = PDF_ENCRYPT_CONTENT);
 
   void OnCreate(CPDF_Dictionary* pEncryptDict,
                 CPDF_Array* pIdArray,
                 const uint8_t* user_pass,
-                FX_DWORD user_size,
-                FX_DWORD type = PDF_ENCRYPT_CONTENT);
+                uint32_t user_size,
+                uint32_t type = PDF_ENCRYPT_CONTENT);
 
   CFX_ByteString GetUserPassword(const uint8_t* owner_pass,
-                                 FX_DWORD pass_size,
+                                 uint32_t pass_size,
                                  int32_t key_len);
   int CheckPassword(const uint8_t* password,
-                    FX_DWORD pass_size,
+                    uint32_t pass_size,
                     FX_BOOL bOwner,
                     uint8_t* key,
                     int key_len);
@@ -55,48 +55,48 @@
  private:
   FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict);
   FX_BOOL LoadDict(CPDF_Dictionary* pEncryptDict,
-                   FX_DWORD type,
+                   uint32_t type,
                    int& cipher,
                    int& key_len);
 
   FX_BOOL CheckUserPassword(const uint8_t* password,
-                            FX_DWORD pass_size,
+                            uint32_t pass_size,
                             FX_BOOL bIgnoreEncryptMeta,
                             uint8_t* key,
                             int32_t key_len);
 
   FX_BOOL CheckOwnerPassword(const uint8_t* password,
-                             FX_DWORD pass_size,
+                             uint32_t pass_size,
                              uint8_t* key,
                              int32_t key_len);
   FX_BOOL AES256_CheckPassword(const uint8_t* password,
-                               FX_DWORD size,
+                               uint32_t size,
                                FX_BOOL bOwner,
                                uint8_t* key);
   void AES256_SetPassword(CPDF_Dictionary* pEncryptDict,
                           const uint8_t* password,
-                          FX_DWORD size,
+                          uint32_t size,
                           FX_BOOL bOwner,
                           const uint8_t* key);
   void AES256_SetPerms(CPDF_Dictionary* pEncryptDict,
-                       FX_DWORD permission,
+                       uint32_t permission,
                        FX_BOOL bEncryptMetadata,
                        const uint8_t* key);
   void OnCreate(CPDF_Dictionary* pEncryptDict,
                 CPDF_Array* pIdArray,
                 const uint8_t* user_pass,
-                FX_DWORD user_size,
+                uint32_t user_size,
                 const uint8_t* owner_pass,
-                FX_DWORD owner_size,
+                uint32_t owner_size,
                 FX_BOOL bDefault,
-                FX_DWORD type);
+                uint32_t type);
   FX_BOOL CheckSecurity(int32_t key_len);
 
   int m_Version;
   int m_Revision;
   CPDF_Parser* m_pParser;
   CPDF_Dictionary* m_pEncryptDict;
-  FX_DWORD m_Permissions;
+  uint32_t m_Permissions;
   int m_Cipher;
   uint8_t m_EncryptKey[32];
   int m_KeyLen;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_stream.cpp b/core/fpdfapi/fpdf_parser/cpdf_stream.cpp
index 72ecb7e..108f487 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_stream.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_stream.cpp
@@ -10,7 +10,7 @@
 #include "core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h"
 #include "core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h"
 
-CPDF_Stream::CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict)
+CPDF_Stream::CPDF_Stream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict)
     : m_pDict(pDict),
       m_dwSize(size),
       m_GenNum(kMemoryBasedGenNum),
@@ -58,7 +58,7 @@
 }
 
 void CPDF_Stream::InitStream(uint8_t* pData,
-                             FX_DWORD size,
+                             uint32_t size,
                              CPDF_Dictionary* pDict) {
   InitStreamInternal(pDict);
   m_GenNum = kMemoryBasedGenNum;
@@ -74,7 +74,7 @@
 CPDF_Object* CPDF_Stream::Clone(FX_BOOL bDirect) const {
   CPDF_StreamAcc acc;
   acc.LoadAllData(this, TRUE);
-  FX_DWORD streamSize = acc.GetSize();
+  uint32_t streamSize = acc.GetSize();
   CPDF_Dictionary* pDict = GetDict();
   if (pDict)
     pDict = ToDictionary(pDict->Clone(bDirect));
@@ -83,7 +83,7 @@
 }
 
 void CPDF_Stream::SetData(const uint8_t* pData,
-                          FX_DWORD size,
+                          uint32_t size,
                           FX_BOOL bCompressed,
                           FX_BOOL bKeepBuf) {
   if (IsMemoryBased())
@@ -110,7 +110,7 @@
 
 FX_BOOL CPDF_Stream::ReadRawData(FX_FILESIZE offset,
                                  uint8_t* buf,
-                                 FX_DWORD size) const {
+                                 uint32_t size) const {
   if (!IsMemoryBased() && m_pFile)
     return m_pFile->ReadBlock(buf, offset, size);
 
@@ -124,7 +124,7 @@
                                      CPDF_Dictionary* pDict) {
   InitStreamInternal(pDict);
   m_pFile = pFile;
-  m_dwSize = (FX_DWORD)pFile->GetSize();
+  m_dwSize = (uint32_t)pFile->GetSize();
   if (m_pDict)
     m_pDict->SetAtInteger("Length", m_dwSize);
 }
diff --git a/core/fpdfapi/fpdf_parser/cpdf_stream_acc.cpp b/core/fpdfapi/fpdf_parser/cpdf_stream_acc.cpp
index f10e337..afac3eb 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_stream_acc.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_stream_acc.cpp
@@ -18,7 +18,7 @@
 
 void CPDF_StreamAcc::LoadAllData(const CPDF_Stream* pStream,
                                  FX_BOOL bRawAccess,
-                                 FX_DWORD estimated_size,
+                                 uint32_t estimated_size,
                                  FX_BOOL bImageAcc) {
   if (!pStream)
     return;
@@ -31,7 +31,7 @@
     return;
   }
   uint8_t* pSrcData;
-  FX_DWORD dwSrcSize = pStream->GetRawSize();
+  uint32_t dwSrcSize = pStream->GetRawSize();
   if (dwSrcSize == 0)
     return;
 
@@ -43,7 +43,7 @@
     pSrcData = pStream->GetRawData();
   }
   uint8_t* pDecryptedData = pSrcData;
-  FX_DWORD dwDecryptedSize = dwSrcSize;
+  uint32_t dwDecryptedSize = dwSrcSize;
   if (!pStream->GetDict()->KeyExist("Filter") || bRawAccess) {
     m_pData = pDecryptedData;
     m_dwSize = dwDecryptedSize;
@@ -83,7 +83,7 @@
   return m_pStream->GetRawData();
 }
 
-FX_DWORD CPDF_StreamAcc::GetSize() const {
+uint32_t CPDF_StreamAcc::GetSize() const {
   if (m_bNewBuf) {
     return m_dwSize;
   }
diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
index 00e2ee6..d14eeb9 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.cpp
@@ -28,8 +28,8 @@
 
 struct SearchTagRecord {
   const char* m_pTag;
-  FX_DWORD m_Len;
-  FX_DWORD m_Offset;
+  uint32_t m_Len;
+  uint32_t m_Offset;
 };
 
 }  // namespace
@@ -60,14 +60,14 @@
 
   if (m_BufOffset >= pos || (FX_FILESIZE)(m_BufOffset + m_BufSize) <= pos) {
     FX_FILESIZE read_pos = pos;
-    FX_DWORD read_size = m_BufSize;
+    uint32_t read_size = m_BufSize;
     if ((FX_FILESIZE)read_size > m_FileLen)
-      read_size = (FX_DWORD)m_FileLen;
+      read_size = (uint32_t)m_FileLen;
 
     if ((FX_FILESIZE)(read_pos + read_size) > m_FileLen) {
       if (m_FileLen < (FX_FILESIZE)read_size) {
         read_pos = 0;
-        read_size = (FX_DWORD)m_FileLen;
+        read_size = (uint32_t)m_FileLen;
       } else {
         read_pos = m_FileLen - read_size;
       }
@@ -95,11 +95,11 @@
     else
       read_pos = pos - m_BufSize + 1;
 
-    FX_DWORD read_size = m_BufSize;
+    uint32_t read_size = m_BufSize;
     if ((FX_FILESIZE)(read_pos + read_size) > m_FileLen) {
       if (m_FileLen < (FX_FILESIZE)read_size) {
         read_pos = 0;
-        read_size = (FX_DWORD)m_FileLen;
+        read_size = (uint32_t)m_FileLen;
       } else {
         read_pos = m_FileLen - read_size;
       }
@@ -114,7 +114,7 @@
   return TRUE;
 }
 
-FX_BOOL CPDF_SyntaxParser::ReadBlock(uint8_t* pBuf, FX_DWORD size) {
+FX_BOOL CPDF_SyntaxParser::ReadBlock(uint8_t* pBuf, uint32_t size) {
   if (!m_pFileAccess->ReadBlock(pBuf, m_Pos + m_HeaderOffset, size))
     return FALSE;
   m_Pos += size;
@@ -375,8 +375,8 @@
 }
 
 CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjectHolder* pObjList,
-                                          FX_DWORD objnum,
-                                          FX_DWORD gennum,
+                                          uint32_t objnum,
+                                          uint32_t gennum,
                                           FX_BOOL bDecrypt) {
   CFX_AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
   if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth)
@@ -394,7 +394,7 @@
     if (bIsNumber) {
       CFX_ByteString nextword2 = GetNextWord(nullptr);
       if (nextword2 == "R") {
-        FX_DWORD objnum = FXSYS_atoui(word);
+        uint32_t objnum = FXSYS_atoui(word);
         return new CPDF_Reference(pObjList, objnum);
       }
     }
@@ -500,8 +500,8 @@
 
 CPDF_Object* CPDF_SyntaxParser::GetObjectByStrict(
     CPDF_IndirectObjectHolder* pObjList,
-    FX_DWORD objnum,
-    FX_DWORD gennum) {
+    uint32_t objnum,
+    uint32_t gennum) {
   CFX_AutoRestorer<int> restorer(&s_CurrentRecursionDepth);
   if (++s_CurrentRecursionDepth > kParserMaxRecursionDepth)
     return nullptr;
@@ -628,8 +628,8 @@
 }
 
 CPDF_Stream* CPDF_SyntaxParser::ReadStream(CPDF_Dictionary* pDict,
-                                           FX_DWORD objnum,
-                                           FX_DWORD gennum) {
+                                           uint32_t objnum,
+                                           uint32_t gennum) {
   CPDF_Object* pLenObj = pDict->GetElement("Length");
   FX_FILESIZE len = -1;
   CPDF_Reference* pLenObjRef = ToReference(pLenObj);
@@ -647,7 +647,7 @@
   const CFX_ByteStringC kEndObjStr("endobj");
 
   IPDF_CryptoHandler* pCryptoHandler =
-      objnum == (FX_DWORD)m_MetadataObjnum ? nullptr : m_pCryptoHandler.get();
+      objnum == (uint32_t)m_MetadataObjnum ? nullptr : m_pCryptoHandler.get();
   if (!pCryptoHandler) {
     FX_BOOL bSearchForKeyword = TRUE;
     if (len >= 0) {
@@ -782,7 +782,7 @@
 }
 
 void CPDF_SyntaxParser::InitParser(IFX_FileRead* pFileAccess,
-                                   FX_DWORD HeaderOffset) {
+                                   uint32_t HeaderOffset) {
   FX_Free(m_pFileBuf);
 
   m_pFileBuf = FX_Alloc(uint8_t, m_BufSize);
@@ -810,7 +810,7 @@
                                     FX_FILESIZE limit,
                                     const CFX_ByteStringC& tag,
                                     FX_BOOL checkKeyword) {
-  const FX_DWORD taglen = tag.GetLength();
+  const uint32_t taglen = tag.GetLength();
 
   bool bCheckLeft = !PDFCharIsDelimiter(tag[0]) && !PDFCharIsWhitespace(tag[0]);
   bool bCheckRight = !PDFCharIsDelimiter(tag[taglen - 1]) &&
@@ -914,12 +914,12 @@
   }
 
   std::vector<SearchTagRecord> patterns(ntags);
-  FX_DWORD start = 0;
-  FX_DWORD itag = 0;
-  FX_DWORD max_len = 0;
+  uint32_t start = 0;
+  uint32_t itag = 0;
+  uint32_t max_len = 0;
   for (int i = 0; i <= tags.GetLength(); ++i) {
     if (tags[i] == 0) {
-      FX_DWORD len = i - start;
+      uint32_t len = i - start;
       max_len = std::max(len, max_len);
       patterns[itag].m_pTag = tags.GetCStr() + start;
       patterns[itag].m_Len = len;
diff --git a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
index 2e613d5..26b6a8d 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_syntax_parser.h
@@ -23,18 +23,18 @@
   CPDF_SyntaxParser();
   ~CPDF_SyntaxParser();
 
-  void InitParser(IFX_FileRead* pFileAccess, FX_DWORD HeaderOffset);
+  void InitParser(IFX_FileRead* pFileAccess, uint32_t HeaderOffset);
 
   FX_FILESIZE SavePos() const { return m_Pos; }
   void RestorePos(FX_FILESIZE pos) { m_Pos = pos; }
 
   CPDF_Object* GetObject(CPDF_IndirectObjectHolder* pObjList,
-                         FX_DWORD objnum,
-                         FX_DWORD gennum,
+                         uint32_t objnum,
+                         uint32_t gennum,
                          FX_BOOL bDecrypt);
   CPDF_Object* GetObjectByStrict(CPDF_IndirectObjectHolder* pObjList,
-                                 FX_DWORD objnum,
-                                 FX_DWORD gennum);
+                                 uint32_t objnum,
+                                 uint32_t gennum);
   CFX_ByteString GetKeyword();
 
   void ToNextLine();
@@ -51,7 +51,7 @@
 
   void SetEncrypt(std::unique_ptr<IPDF_CryptoHandler> pCryptoHandler);
 
-  FX_BOOL ReadBlock(uint8_t* pBuf, FX_DWORD size);
+  FX_BOOL ReadBlock(uint8_t* pBuf, uint32_t size);
   FX_BOOL GetCharAt(FX_FILESIZE pos, uint8_t& ch);
   CFX_ByteString GetNextWord(bool* bIsNumber);
 
@@ -77,20 +77,20 @@
   CFX_ByteString ReadHexString();
   unsigned int ReadEOLMarkers(FX_FILESIZE pos);
   CPDF_Stream* ReadStream(CPDF_Dictionary* pDict,
-                          FX_DWORD objnum,
-                          FX_DWORD gennum);
+                          uint32_t objnum,
+                          uint32_t gennum);
 
   FX_FILESIZE m_Pos;
   int m_MetadataObjnum;
   IFX_FileRead* m_pFileAccess;
-  FX_DWORD m_HeaderOffset;
+  uint32_t m_HeaderOffset;
   FX_FILESIZE m_FileLen;
   uint8_t* m_pFileBuf;
-  FX_DWORD m_BufSize;
+  uint32_t m_BufSize;
   FX_FILESIZE m_BufOffset;
   std::unique_ptr<IPDF_CryptoHandler> m_pCryptoHandler;
   uint8_t m_WordBuffer[257];
-  FX_DWORD m_WordSize;
+  uint32_t m_WordSize;
 };
 
 #endif  // CORE_FPDFAPI_FPDF_PARSER_CPDF_SYNTAX_PARSER_H_
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index e6f531d..219a725 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -50,18 +50,18 @@
     0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 0x00f8, 0x00f9, 0x00fa, 0x00fb,
     0x00fc, 0x00fd, 0x00fe, 0x00ff};
 
-FX_DWORD A85Decode(const uint8_t* src_buf,
-                   FX_DWORD src_size,
+uint32_t A85Decode(const uint8_t* src_buf,
+                   uint32_t src_size,
                    uint8_t*& dest_buf,
-                   FX_DWORD& dest_size) {
+                   uint32_t& dest_size) {
   dest_size = 0;
   dest_buf = nullptr;
   if (src_size == 0)
     return 0;
 
   // Count legal characters and zeros.
-  FX_DWORD zcount = 0;
-  FX_DWORD pos = 0;
+  uint32_t zcount = 0;
+  uint32_t pos = 0;
   while (pos < src_size) {
     uint8_t ch = src_buf[pos];
     if (ch == 'z') {
@@ -78,9 +78,9 @@
 
   // Count the space needed to contain non-zero characters. The encoding ratio
   // of Ascii85 is 4:5.
-  FX_DWORD space_for_non_zeroes = (pos - zcount) / 5 * 4 + 4;
+  uint32_t space_for_non_zeroes = (pos - zcount) / 5 * 4 + 4;
   if (zcount > (UINT_MAX - space_for_non_zeroes) / 4) {
-    return (FX_DWORD)-1;
+    return (uint32_t)-1;
   }
   dest_buf = FX_Alloc(uint8_t, zcount * 4 + space_for_non_zeroes);
   size_t state = 0;
@@ -123,17 +123,17 @@
   return pos;
 }
 
-FX_DWORD HexDecode(const uint8_t* src_buf,
-                   FX_DWORD src_size,
+uint32_t HexDecode(const uint8_t* src_buf,
+                   uint32_t src_size,
                    uint8_t*& dest_buf,
-                   FX_DWORD& dest_size) {
+                   uint32_t& dest_size) {
   dest_size = 0;
   if (src_size == 0) {
     dest_buf = nullptr;
     return 0;
   }
 
-  FX_DWORD i = 0;
+  uint32_t i = 0;
   // Find the end of data.
   while (i < src_size && src_buf[i] != '>')
     i++;
@@ -165,26 +165,26 @@
   return i;
 }
 
-FX_DWORD RunLengthDecode(const uint8_t* src_buf,
-                         FX_DWORD src_size,
+uint32_t RunLengthDecode(const uint8_t* src_buf,
+                         uint32_t src_size,
                          uint8_t*& dest_buf,
-                         FX_DWORD& dest_size) {
-  FX_DWORD i = 0;
-  FX_DWORD old;
+                         uint32_t& dest_size) {
+  uint32_t i = 0;
+  uint32_t old;
   dest_size = 0;
   while (i < src_size) {
     if (src_buf[i] < 128) {
       old = dest_size;
       dest_size += src_buf[i] + 1;
       if (dest_size < old) {
-        return static_cast<FX_DWORD>(-1);
+        return static_cast<uint32_t>(-1);
       }
       i += src_buf[i] + 2;
     } else if (src_buf[i] > 128) {
       old = dest_size;
       dest_size += 257 - src_buf[i];
       if (dest_size < old) {
-        return static_cast<FX_DWORD>(-1);
+        return static_cast<uint32_t>(-1);
       }
       i += 2;
     } else {
@@ -192,17 +192,17 @@
     }
   }
   if (dest_size >= _STREAM_MAX_SIZE_) {
-    return static_cast<FX_DWORD>(-1);
+    return static_cast<uint32_t>(-1);
   }
   dest_buf = FX_Alloc(uint8_t, dest_size);
   i = 0;
   int dest_count = 0;
   while (i < src_size) {
     if (src_buf[i] < 128) {
-      FX_DWORD copy_len = src_buf[i] + 1;
-      FX_DWORD buf_left = src_size - i - 1;
+      uint32_t copy_len = src_buf[i] + 1;
+      uint32_t buf_left = src_size - i - 1;
       if (buf_left < copy_len) {
-        FX_DWORD delta = copy_len - buf_left;
+        uint32_t delta = copy_len - buf_left;
         copy_len = buf_left;
         FXSYS_memset(dest_buf + dest_count + copy_len, '\0', delta);
       }
@@ -221,7 +221,7 @@
       break;
     }
   }
-  FX_DWORD ret = i + 1;
+  uint32_t ret = i + 1;
   if (ret > src_size) {
     ret = src_size;
   }
@@ -230,7 +230,7 @@
 
 ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     const CPDF_Dictionary* pParams) {
@@ -283,7 +283,7 @@
 
 ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     int nComps,
@@ -305,13 +305,13 @@
       BitsPerComponent, Columns);
 }
 
-FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW,
+uint32_t FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW,
                                   const uint8_t* src_buf,
-                                  FX_DWORD src_size,
+                                  uint32_t src_size,
                                   CPDF_Dictionary* pParams,
-                                  FX_DWORD estimated_size,
+                                  uint32_t estimated_size,
                                   uint8_t*& dest_buf,
-                                  FX_DWORD& dest_size) {
+                                  uint32_t& dest_size) {
   int predictor = 0;
   FX_BOOL bEarlyChange = TRUE;
   int Colors = 0, BitsPerComponent = 0, Columns = 0;
@@ -322,7 +322,7 @@
     BitsPerComponent = pParams->GetIntegerBy("BitsPerComponent", 8);
     Columns = pParams->GetIntegerBy("Columns", 1);
     if (!CheckFlateDecodeParams(Colors, BitsPerComponent, Columns)) {
-      return (FX_DWORD)-1;
+      return (uint32_t)-1;
     }
   }
   return CPDF_ModuleMgr::Get()->GetFlateModule()->FlateOrLZWDecode(
@@ -331,13 +331,13 @@
 }
 
 FX_BOOL PDF_DataDecode(const uint8_t* src_buf,
-                       FX_DWORD src_size,
+                       uint32_t src_size,
                        const CPDF_Dictionary* pDict,
                        uint8_t*& dest_buf,
-                       FX_DWORD& dest_size,
+                       uint32_t& dest_size,
                        CFX_ByteString& ImageEncoding,
                        CPDF_Dictionary*& pImageParms,
-                       FX_DWORD last_estimated_size,
+                       uint32_t last_estimated_size,
                        FX_BOOL bImageAcc) {
   CPDF_Object* pDecoder = pDict ? pDict->GetElementValue("Filter") : nullptr;
   if (!pDecoder || (!pDecoder->IsArray() && !pDecoder->IsName()))
@@ -352,7 +352,7 @@
     if (!pParamsArray)
       pParams = nullptr;
 
-    for (FX_DWORD i = 0; i < pDecoders->GetCount(); i++) {
+    for (uint32_t i = 0; i < pDecoders->GetCount(); i++) {
       DecoderList.push_back(pDecoders->GetConstStringAt(i));
       ParamList.Add(pParams ? pParamsArray->GetDictAt(i) : nullptr);
     }
@@ -361,7 +361,7 @@
     ParamList.Add(pParams ? pParams->GetDict() : nullptr);
   }
   uint8_t* last_buf = (uint8_t*)src_buf;
-  FX_DWORD last_size = src_size;
+  uint32_t last_size = src_size;
   int nSize = pdfium::CollectionSize<int>(DecoderList);
   for (int i = 0; i < nSize; i++) {
     int estimated_size = i == nSize - 1 ? last_estimated_size : 0;
@@ -369,7 +369,7 @@
     // Use ToDictionary here because we can push nullptr into the ParamList.
     CPDF_Dictionary* pParam = ToDictionary(ParamList[i]);
     uint8_t* new_buf = nullptr;
-    FX_DWORD new_size = (FX_DWORD)-1;
+    uint32_t new_size = (uint32_t)-1;
     int offset = -1;
     if (decoder == "FlateDecode" || decoder == "Fl") {
       if (bImageAcc && i == nSize - 1) {
@@ -431,12 +431,12 @@
   return TRUE;
 }
 
-CFX_WideString PDF_DecodeText(const uint8_t* src_data, FX_DWORD src_len) {
+CFX_WideString PDF_DecodeText(const uint8_t* src_data, uint32_t src_len) {
   CFX_WideString result;
   if (src_len >= 2 && ((src_data[0] == 0xfe && src_data[1] == 0xff) ||
                        (src_data[0] == 0xff && src_data[1] == 0xfe))) {
     bool bBE = src_data[0] == 0xfe;
-    FX_DWORD max_chars = (src_len - 2) / 2;
+    uint32_t max_chars = (src_len - 2) / 2;
     if (!max_chars) {
       return result;
     }
@@ -446,7 +446,7 @@
     FX_WCHAR* dest_buf = result.GetBuffer(max_chars);
     const uint8_t* uni_str = src_data + 2;
     int dest_pos = 0;
-    for (FX_DWORD i = 0; i < max_chars * 2; i += 2) {
+    for (uint32_t i = 0; i < max_chars * 2; i += 2) {
       uint16_t unicode = bBE ? (uni_str[i] << 8 | uni_str[i + 1])
                              : (uni_str[i + 1] << 8 | uni_str[i]);
       if (unicode == 0x1b) {
@@ -466,7 +466,7 @@
     result.ReleaseBuffer(dest_pos);
   } else {
     FX_WCHAR* dest_buf = result.GetBuffer(src_len);
-    for (FX_DWORD i = 0; i < src_len; i++)
+    for (uint32_t i = 0; i < src_len; i++)
       dest_buf[i] = PDFDocEncoding[src_data[i]];
     result.ReleaseBuffer(src_len);
   }
@@ -554,9 +554,9 @@
 }
 
 void FlateEncode(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  uint8_t*& dest_buf,
-                 FX_DWORD& dest_size) {
+                 uint32_t& dest_size) {
   CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
   if (pEncoders) {
     pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf, dest_size);
@@ -564,13 +564,13 @@
 }
 
 void FlateEncode(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  int predictor,
                  int Colors,
                  int BitsPerComponent,
                  int Columns,
                  uint8_t*& dest_buf,
-                 FX_DWORD& dest_size) {
+                 uint32_t& dest_size) {
   CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
   if (pEncoders) {
     pEncoders->GetFlateModule()->Encode(src_buf, src_size, predictor, Colors,
@@ -579,10 +579,10 @@
   }
 }
 
-FX_DWORD FlateDecode(const uint8_t* src_buf,
-                     FX_DWORD src_size,
+uint32_t FlateDecode(const uint8_t* src_buf,
+                     uint32_t src_size,
                      uint8_t*& dest_buf,
-                     FX_DWORD& dest_size) {
+                     uint32_t& dest_size) {
   CCodec_ModuleMgr* pEncoders = CPDF_ModuleMgr::Get()->GetCodecModule();
   if (pEncoders) {
     return pEncoders->GetFlateModule()->FlateOrLZWDecode(
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp
index 81f8cae..352e4ee 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_decode_unittest.cpp
@@ -29,7 +29,7 @@
   for (size_t i = 0; i < FX_ArraySize(test_data); ++i) {
     pdfium::DecodeTestData* ptr = &test_data[i];
     uint8_t* result = nullptr;
-    FX_DWORD result_size;
+    uint32_t result_size;
     EXPECT_EQ(ptr->processed_size,
               A85Decode(ptr->input, ptr->input_size, result, result_size))
         << "for case " << i;
@@ -64,7 +64,7 @@
   for (size_t i = 0; i < FX_ArraySize(test_data); ++i) {
     pdfium::DecodeTestData* ptr = &test_data[i];
     uint8_t* result = nullptr;
-    FX_DWORD result_size;
+    uint32_t result_size;
     EXPECT_EQ(ptr->processed_size,
               HexDecode(ptr->input, ptr->input_size, result, result_size))
         << "for case " << i;
diff --git a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
index caffb68..5bfbfae 100644
--- a/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
+++ b/core/fpdfapi/fpdf_parser/fpdf_parser_utility.cpp
@@ -179,7 +179,7 @@
     case CPDF_Object::ARRAY: {
       const CPDF_Array* p = pObj->AsArray();
       buf << "[";
-      for (FX_DWORD i = 0; i < p->GetCount(); i++) {
+      for (uint32_t i = 0; i < p->GetCount(); i++) {
         CPDF_Object* pElement = p->GetElement(i);
         if (pElement->GetObjNum()) {
           buf << " " << pElement->GetObjNum() << " 0 R";
diff --git a/core/fpdfapi/fpdf_parser/include/cfdf_document.h b/core/fpdfapi/fpdf_parser/include/cfdf_document.h
index f01039c..18b9442 100644
--- a/core/fpdfapi/fpdf_parser/include/cfdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cfdf_document.h
@@ -18,7 +18,7 @@
   static CFDF_Document* CreateNewDoc();
   static CFDF_Document* ParseFile(IFX_FileRead* pFile,
                                   FX_BOOL bOwnFile = FALSE);
-  static CFDF_Document* ParseMemory(const uint8_t* pData, FX_DWORD size);
+  static CFDF_Document* ParseMemory(const uint8_t* pData, uint32_t size);
   ~CFDF_Document();
 
   FX_BOOL WriteBuf(CFX_ByteTextBuf& buf) const;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_array.h b/core/fpdfapi/fpdf_parser/include/cpdf_array.h
index 2ee7760..3efa03e 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_array.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_array.h
@@ -24,34 +24,34 @@
   CPDF_Array* AsArray() override;
   const CPDF_Array* AsArray() const override;
 
-  FX_DWORD GetCount() const { return m_Objects.GetSize(); }
-  CPDF_Object* GetElement(FX_DWORD index) const;
-  CPDF_Object* GetElementValue(FX_DWORD index) const;
+  uint32_t GetCount() const { return m_Objects.GetSize(); }
+  CPDF_Object* GetElement(uint32_t index) const;
+  CPDF_Object* GetElementValue(uint32_t index) const;
   CFX_Matrix GetMatrix();
   CFX_FloatRect GetRect();
-  CFX_ByteString GetStringAt(FX_DWORD index) const;
-  CFX_ByteStringC GetConstStringAt(FX_DWORD index) const;
-  int GetIntegerAt(FX_DWORD index) const;
-  FX_FLOAT GetNumberAt(FX_DWORD index) const;
-  CPDF_Dictionary* GetDictAt(FX_DWORD index) const;
-  CPDF_Stream* GetStreamAt(FX_DWORD index) const;
-  CPDF_Array* GetArrayAt(FX_DWORD index) const;
-  FX_FLOAT GetFloatAt(FX_DWORD index) const { return GetNumberAt(index); }
+  CFX_ByteString GetStringAt(uint32_t index) const;
+  CFX_ByteStringC GetConstStringAt(uint32_t index) const;
+  int GetIntegerAt(uint32_t index) const;
+  FX_FLOAT GetNumberAt(uint32_t index) const;
+  CPDF_Dictionary* GetDictAt(uint32_t index) const;
+  CPDF_Stream* GetStreamAt(uint32_t index) const;
+  CPDF_Array* GetArrayAt(uint32_t index) const;
+  FX_FLOAT GetFloatAt(uint32_t index) const { return GetNumberAt(index); }
 
-  void SetAt(FX_DWORD index,
+  void SetAt(uint32_t index,
              CPDF_Object* pObj,
              CPDF_IndirectObjectHolder* pObjs = nullptr);
-  void InsertAt(FX_DWORD index,
+  void InsertAt(uint32_t index,
                 CPDF_Object* pObj,
                 CPDF_IndirectObjectHolder* pObjs = nullptr);
-  void RemoveAt(FX_DWORD index, int nCount = 1);
+  void RemoveAt(uint32_t index, int nCount = 1);
 
   void Add(CPDF_Object* pObj, CPDF_IndirectObjectHolder* pObjs = nullptr);
   void AddNumber(FX_FLOAT f);
   void AddInteger(int i);
   void AddString(const CFX_ByteString& str);
   void AddName(const CFX_ByteString& str);
-  void AddReference(CPDF_IndirectObjectHolder* pDoc, FX_DWORD objnum);
+  void AddReference(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum);
   void AddReference(CPDF_IndirectObjectHolder* pDoc, CPDF_Object* obj) {
     AddReference(pDoc, obj->GetObjNum());
   }
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
index ebc5cee..73eabf9 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_dictionary.h
@@ -65,7 +65,7 @@
   void SetAtNumber(const CFX_ByteStringC& key, FX_FLOAT f);
   void SetAtReference(const CFX_ByteStringC& key,
                       CPDF_IndirectObjectHolder* pDoc,
-                      FX_DWORD objnum);
+                      uint32_t objnum);
   void SetAtReference(const CFX_ByteStringC& key,
                       CPDF_IndirectObjectHolder* pDoc,
                       CPDF_Object* obj) {
@@ -77,7 +77,7 @@
 
   void AddReference(const CFX_ByteStringC& key,
                     CPDF_IndirectObjectHolder* pDoc,
-                    FX_DWORD objnum);
+                    uint32_t objnum);
 
   // Invalidates iterators for the element with the key |key|.
   void RemoveAt(const CFX_ByteStringC& key);
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_document.h b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
index 21b9d25..bbccf59 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_document.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_document.h
@@ -50,8 +50,8 @@
 
   int GetPageCount() const;
   CPDF_Dictionary* GetPage(int iPage);
-  int GetPageIndex(FX_DWORD objnum);
-  FX_DWORD GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const;
+  int GetPageIndex(uint32_t objnum);
+  uint32_t GetUserPermissions(FX_BOOL bCheckRevision = FALSE) const;
   CPDF_DocPageData* GetPageData() { return GetValidatePageData(); }
   void ClearPageData();
   void RemoveColorSpaceFromPageData(CPDF_Object* pObject);
@@ -60,7 +60,7 @@
   void ClearRenderData();
   void ClearRenderFont();
 
-  FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm) const;
+  FX_BOOL IsFormStream(uint32_t objnum, FX_BOOL& bForm) const;
 
   // |pFontDict| must not be null.
   CPDF_Font* LoadFont(CPDF_Dictionary* pFontDict);
@@ -110,8 +110,8 @@
                                 int nPagesToGo,
                                 int level);
   int _FindPageIndex(CPDF_Dictionary* pNode,
-                     FX_DWORD& skip_count,
-                     FX_DWORD objnum,
+                     uint32_t& skip_count,
+                     uint32_t objnum,
                      int& index,
                      int level = 0);
   FX_BOOL CheckOCGVisible(CPDF_Dictionary* pOCG, FX_BOOL bPrinting);
@@ -127,9 +127,9 @@
   CFX_ByteString m_ID1;
   CFX_ByteString m_ID2;
   FX_BOOL m_bLinearized;
-  FX_DWORD m_dwFirstPageNo;
-  FX_DWORD m_dwFirstPageObjNum;
-  CFX_ArrayTemplate<FX_DWORD> m_PageList;
+  uint32_t m_dwFirstPageNo;
+  uint32_t m_dwFirstPageObjNum;
+  CFX_ArrayTemplate<uint32_t> m_PageList;
   CPDF_DocPageData* m_pDocPage;
   CPDF_DocRenderData* m_pDocRender;
 };
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h
index 373159d..a219181 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_indirect_object_holder.h
@@ -16,20 +16,20 @@
 
 class CPDF_IndirectObjectHolder {
  public:
-  using iterator = std::map<FX_DWORD, CPDF_Object*>::iterator;
-  using const_iterator = std::map<FX_DWORD, CPDF_Object*>::const_iterator;
+  using iterator = std::map<uint32_t, CPDF_Object*>::iterator;
+  using const_iterator = std::map<uint32_t, CPDF_Object*>::const_iterator;
 
   explicit CPDF_IndirectObjectHolder(CPDF_Parser* pParser);
   ~CPDF_IndirectObjectHolder();
 
-  CPDF_Object* GetIndirectObject(FX_DWORD objnum);
-  FX_DWORD AddIndirectObject(CPDF_Object* pObj);
-  void ReleaseIndirectObject(FX_DWORD objnum);
+  CPDF_Object* GetIndirectObject(uint32_t objnum);
+  uint32_t AddIndirectObject(CPDF_Object* pObj);
+  void ReleaseIndirectObject(uint32_t objnum);
 
   // Takes ownership of |pObj|.
-  FX_BOOL InsertIndirectObject(FX_DWORD objnum, CPDF_Object* pObj);
+  FX_BOOL InsertIndirectObject(uint32_t objnum, CPDF_Object* pObj);
 
-  FX_DWORD GetLastObjNum() const { return m_LastObjNum; }
+  uint32_t GetLastObjNum() const { return m_LastObjNum; }
   iterator begin() { return m_IndirectObjs.begin(); }
   const_iterator begin() const { return m_IndirectObjs.begin(); }
   iterator end() { return m_IndirectObjs.end(); }
@@ -37,8 +37,8 @@
 
  protected:
   CPDF_Parser* m_pParser;
-  FX_DWORD m_LastObjNum;
-  std::map<FX_DWORD, CPDF_Object*> m_IndirectObjs;
+  uint32_t m_LastObjNum;
+  std::map<uint32_t, CPDF_Object*> m_IndirectObjs;
 };
 
 #endif  // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_INDIRECT_OBJECT_HOLDER_H_
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_object.h b/core/fpdfapi/fpdf_parser/include/cpdf_object.h
index cc461d6..1ba38a9 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_object.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_object.h
@@ -35,8 +35,8 @@
   };
 
   virtual Type GetType() const = 0;
-  FX_DWORD GetObjNum() const { return m_ObjNum; }
-  FX_DWORD GetGenNum() const { return m_GenNum; }
+  uint32_t GetObjNum() const { return m_ObjNum; }
+  uint32_t GetGenNum() const { return m_GenNum; }
 
   virtual CPDF_Object* Clone(FX_BOOL bDirect = FALSE) const = 0;
   virtual CPDF_Object* GetDirect() const;
@@ -85,8 +85,8 @@
   virtual ~CPDF_Object();
   void Destroy() { delete this; }
 
-  FX_DWORD m_ObjNum;
-  FX_DWORD m_GenNum;
+  uint32_t m_ObjNum;
+  uint32_t m_GenNum;
 
   friend class CPDF_IndirectObjectHolder;
   friend class CPDF_Parser;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h
index 933ab1c..45aca8f 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_parser.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_parser.h
@@ -38,7 +38,7 @@
   ~CPDF_Parser();
 
   Error StartParse(IFX_FileRead* pFile);
-  FX_DWORD GetPermissions(FX_BOOL bCheckRevision = FALSE);
+  uint32_t GetPermissions(FX_BOOL bCheckRevision = FALSE);
 
   void SetPassword(const FX_CHAR* password) { m_Password = password; }
   CFX_ByteString GetPassword() { return m_Password; }
@@ -46,46 +46,46 @@
   FX_FILESIZE GetLastXRefOffset() const { return m_LastXRefOffset; }
   CPDF_Document* GetDocument() const { return m_pDocument; }
 
-  FX_DWORD GetRootObjNum();
-  FX_DWORD GetInfoObjNum();
+  uint32_t GetRootObjNum();
+  uint32_t GetInfoObjNum();
   CPDF_Array* GetIDArray();
 
   CPDF_Dictionary* GetEncryptDict() const { return m_pEncryptDict; }
 
   CPDF_Object* ParseIndirectObject(CPDF_IndirectObjectHolder* pObjList,
-                                   FX_DWORD objnum);
+                                   uint32_t objnum);
 
-  FX_DWORD GetLastObjNum() const;
-  bool IsValidObjectNumber(FX_DWORD objnum) const;
-  FX_FILESIZE GetObjectPositionOrZero(FX_DWORD objnum) const;
-  uint8_t GetObjectType(FX_DWORD objnum) const;
-  uint16_t GetObjectGenNum(FX_DWORD objnum) const;
+  uint32_t GetLastObjNum() const;
+  bool IsValidObjectNumber(uint32_t objnum) const;
+  FX_FILESIZE GetObjectPositionOrZero(uint32_t objnum) const;
+  uint8_t GetObjectType(uint32_t objnum) const;
+  uint16_t GetObjectGenNum(uint32_t objnum) const;
   bool IsVersionUpdated() const { return m_bVersionUpdated; }
-  bool IsObjectFreeOrNull(FX_DWORD objnum) const;
-  FX_BOOL IsFormStream(FX_DWORD objnum, FX_BOOL& bForm);
+  bool IsObjectFreeOrNull(uint32_t objnum) const;
+  FX_BOOL IsFormStream(uint32_t objnum, FX_BOOL& bForm);
   IPDF_CryptoHandler* GetCryptoHandler();
   IFX_FileRead* GetFileAccess() const;
 
-  FX_FILESIZE GetObjectOffset(FX_DWORD objnum) const;
-  FX_FILESIZE GetObjectSize(FX_DWORD objnum) const;
+  FX_FILESIZE GetObjectOffset(uint32_t objnum) const;
+  FX_FILESIZE GetObjectSize(uint32_t objnum) const;
 
-  void GetIndirectBinary(FX_DWORD objnum, uint8_t*& pBuffer, FX_DWORD& size);
+  void GetIndirectBinary(uint32_t objnum, uint8_t*& pBuffer, uint32_t& size);
   int GetFileVersion() const { return m_FileVersion; }
   FX_BOOL IsXRefStream() const { return m_bXRefStream; }
 
   CPDF_Object* ParseIndirectObjectAt(CPDF_IndirectObjectHolder* pObjList,
                                      FX_FILESIZE pos,
-                                     FX_DWORD objnum);
+                                     uint32_t objnum);
 
   CPDF_Object* ParseIndirectObjectAtByStrict(
       CPDF_IndirectObjectHolder* pObjList,
       FX_FILESIZE pos,
-      FX_DWORD objnum,
+      uint32_t objnum,
       FX_FILESIZE* pResultPos);
 
   Error StartAsyncParse(IFX_FileRead* pFile);
 
-  FX_DWORD GetFirstPageNo() const { return m_dwFirstPageNo; }
+  uint32_t GetFirstPageNo() const { return m_dwFirstPageNo; }
 
  protected:
   struct ObjectInfo {
@@ -106,14 +106,14 @@
   FX_BOOL RebuildCrossRef();
   Error SetEncryptHandler();
   void ReleaseEncryptHandler();
-  FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
-  FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, FX_DWORD dwObjCount);
+  FX_BOOL LoadLinearizedAllCrossRefV4(FX_FILESIZE pos, uint32_t dwObjCount);
+  FX_BOOL LoadLinearizedCrossRefV4(FX_FILESIZE pos, uint32_t dwObjCount);
   FX_BOOL LoadLinearizedAllCrossRefV5(FX_FILESIZE pos);
   Error LoadLinearizedMainXRefTable();
-  CPDF_StreamAcc* GetObjectStream(FX_DWORD number);
-  FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, FX_DWORD offset);
+  CPDF_StreamAcc* GetObjectStream(uint32_t number);
+  FX_BOOL IsLinearizedFile(IFX_FileRead* pFileAccess, uint32_t offset);
   void SetEncryptDictionary(CPDF_Dictionary* pDict);
-  void ShrinkObjectMap(FX_DWORD size);
+  void ShrinkObjectMap(uint32_t size);
 
   CPDF_Document* m_pDocument;
   std::unique_ptr<CPDF_SyntaxParser> m_pSyntax;
@@ -127,27 +127,27 @@
   CFX_ByteString m_bsRecipient;
   CFX_ByteString m_FilePath;
   CFX_ByteString m_Password;
-  std::map<FX_DWORD, ObjectInfo> m_ObjectInfo;
+  std::map<uint32_t, ObjectInfo> m_ObjectInfo;
   std::set<FX_FILESIZE> m_SortedOffset;
   CFX_ArrayTemplate<CPDF_Dictionary*> m_Trailers;
   bool m_bVersionUpdated;
   CPDF_Object* m_pLinearized;
-  FX_DWORD m_dwFirstPageNo;
-  FX_DWORD m_dwXrefStartObjNum;
+  uint32_t m_dwFirstPageNo;
+  uint32_t m_dwXrefStartObjNum;
 
   // A map of object numbers to indirect streams. Map owns the streams.
-  std::map<FX_DWORD, std::unique_ptr<CPDF_StreamAcc>> m_ObjectStreamMap;
+  std::map<uint32_t, std::unique_ptr<CPDF_StreamAcc>> m_ObjectStreamMap;
 
   // Mapping of object numbers to offsets. The offsets are relative to the first
   // object in the stream.
-  using StreamObjectCache = std::map<FX_DWORD, FX_DWORD>;
+  using StreamObjectCache = std::map<uint32_t, uint32_t>;
 
   // Mapping of streams to their object caches. This is valid as long as the
   // streams in |m_ObjectStreamMap| are valid.
   std::map<CPDF_StreamAcc*, StreamObjectCache> m_ObjCache;
 
   // All indirect object numbers that are being parsed.
-  std::set<FX_DWORD> m_ParsingObjNums;
+  std::set<uint32_t> m_ParsingObjNums;
 
   friend class CPDF_DataAvail;
 
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_reference.h b/core/fpdfapi/fpdf_parser/include/cpdf_reference.h
index f44f1e4..b7d8269 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_reference.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_reference.h
@@ -31,9 +31,9 @@
   const CPDF_Reference* AsReference() const override;
 
   CPDF_IndirectObjectHolder* GetObjList() const { return m_pObjList; }
-  FX_DWORD GetRefObjNum() const { return m_RefObjNum; }
+  uint32_t GetRefObjNum() const { return m_RefObjNum; }
 
-  void SetRef(CPDF_IndirectObjectHolder* pDoc, FX_DWORD objnum);
+  void SetRef(CPDF_IndirectObjectHolder* pDoc, uint32_t objnum);
 
  protected:
   ~CPDF_Reference() override;
@@ -45,7 +45,7 @@
   }
 
   CPDF_IndirectObjectHolder* m_pObjList;
-  FX_DWORD m_RefObjNum;
+  uint32_t m_RefObjNum;
 };
 
 #endif  // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_REFERENCE_H_
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h b/core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h
index 0bd3b8d..c9aa12e 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_simple_parser.h
@@ -12,7 +12,7 @@
 
 class CPDF_SimpleParser {
  public:
-  CPDF_SimpleParser(const uint8_t* pData, FX_DWORD dwSize);
+  CPDF_SimpleParser(const uint8_t* pData, uint32_t dwSize);
   CPDF_SimpleParser(const CFX_ByteStringC& str);
 
   CFX_ByteStringC GetWord();
@@ -22,14 +22,14 @@
   bool FindTagParamFromStart(const CFX_ByteStringC& token, int nParams);
 
   // For testing only.
-  FX_DWORD GetCurPos() const { return m_dwCurPos; }
+  uint32_t GetCurPos() const { return m_dwCurPos; }
 
  private:
-  void ParseWord(const uint8_t*& pStart, FX_DWORD& dwSize);
+  void ParseWord(const uint8_t*& pStart, uint32_t& dwSize);
 
   const uint8_t* m_pData;
-  FX_DWORD m_dwSize;
-  FX_DWORD m_dwCurPos;
+  uint32_t m_dwSize;
+  uint32_t m_dwCurPos;
 };
 
 #endif  // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_CPDF_SIMPLE_PARSER_H_
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_stream.h b/core/fpdfapi/fpdf_parser/include/cpdf_stream.h
index 20045d7..0010a15 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_stream.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_stream.h
@@ -13,7 +13,7 @@
 
 class CPDF_Stream : public CPDF_Object {
  public:
-  CPDF_Stream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict);
+  CPDF_Stream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict);
 
   // CPDF_Object.
   Type GetType() const override;
@@ -24,33 +24,33 @@
   CPDF_Stream* AsStream() override;
   const CPDF_Stream* AsStream() const override;
 
-  FX_DWORD GetRawSize() const { return m_dwSize; }
+  uint32_t GetRawSize() const { return m_dwSize; }
   uint8_t* GetRawData() const { return m_pDataBuf; }
 
   void SetData(const uint8_t* pData,
-               FX_DWORD size,
+               uint32_t size,
                FX_BOOL bCompressed,
                FX_BOOL bKeepBuf);
 
-  void InitStream(uint8_t* pData, FX_DWORD size, CPDF_Dictionary* pDict);
+  void InitStream(uint8_t* pData, uint32_t size, CPDF_Dictionary* pDict);
   void InitStreamFromFile(IFX_FileRead* pFile, CPDF_Dictionary* pDict);
 
   FX_BOOL ReadRawData(FX_FILESIZE start_pos,
                       uint8_t* pBuf,
-                      FX_DWORD buf_size) const;
+                      uint32_t buf_size) const;
 
   bool IsMemoryBased() const { return m_GenNum == kMemoryBasedGenNum; }
 
  protected:
-  static const FX_DWORD kMemoryBasedGenNum = (FX_DWORD)-1;
+  static const uint32_t kMemoryBasedGenNum = (uint32_t)-1;
 
   ~CPDF_Stream() override;
 
   void InitStreamInternal(CPDF_Dictionary* pDict);
 
   CPDF_Dictionary* m_pDict;
-  FX_DWORD m_dwSize;
-  FX_DWORD m_GenNum;
+  uint32_t m_dwSize;
+  uint32_t m_GenNum;
 
   union {
     uint8_t* m_pDataBuf;
diff --git a/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h b/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h
index 8fad265..6176753 100644
--- a/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h
+++ b/core/fpdfapi/fpdf_parser/include/cpdf_stream_acc.h
@@ -19,7 +19,7 @@
 
   void LoadAllData(const CPDF_Stream* pStream,
                    FX_BOOL bRawAccess = FALSE,
-                   FX_DWORD estimated_size = 0,
+                   uint32_t estimated_size = 0,
                    FX_BOOL bImageAcc = FALSE);
 
   const CPDF_Stream* GetStream() const { return m_pStream; }
@@ -28,14 +28,14 @@
   }
 
   const uint8_t* GetData() const;
-  FX_DWORD GetSize() const;
+  uint32_t GetSize() const;
   const CFX_ByteString& GetImageDecoder() const { return m_ImageDecoder; }
   const CPDF_Dictionary* GetImageParam() const { return m_pImageParam; }
   uint8_t* DetachData();
 
  protected:
   uint8_t* m_pData;
-  FX_DWORD m_dwSize;
+  uint32_t m_dwSize;
   FX_BOOL m_bNewBuf;
   CFX_ByteString m_ImageDecoder;
   CPDF_Dictionary* m_pImageParam;
diff --git a/core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h b/core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h
index 4a1d66c..1f1095b 100644
--- a/core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h
+++ b/core/fpdfapi/fpdf_parser/include/fpdf_parser_decode.h
@@ -19,58 +19,58 @@
 CFX_ByteString PDF_NameEncode(const CFX_ByteString& orig);
 CFX_ByteString PDF_EncodeString(const CFX_ByteString& src,
                                 FX_BOOL bHex = FALSE);
-CFX_WideString PDF_DecodeText(const uint8_t* pData, FX_DWORD size);
+CFX_WideString PDF_DecodeText(const uint8_t* pData, uint32_t size);
 CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr);
 CFX_ByteString PDF_EncodeText(const FX_WCHAR* pString, int len = -1);
 CFX_ByteString PDF_EncodeText(const CFX_WideString& str);
 
 void FlateEncode(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  uint8_t*& dest_buf,
-                 FX_DWORD& dest_size);
+                 uint32_t& dest_size);
 void FlateEncode(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  int predictor,
                  int Colors,
                  int BitsPerComponent,
                  int Columns,
                  uint8_t*& dest_buf,
-                 FX_DWORD& dest_size);
-FX_DWORD FlateDecode(const uint8_t* src_buf,
-                     FX_DWORD src_size,
+                 uint32_t& dest_size);
+uint32_t FlateDecode(const uint8_t* src_buf,
+                     uint32_t src_size,
                      uint8_t*& dest_buf,
-                     FX_DWORD& dest_size);
-FX_DWORD RunLengthDecode(const uint8_t* src_buf,
-                         FX_DWORD src_size,
+                     uint32_t& dest_size);
+uint32_t RunLengthDecode(const uint8_t* src_buf,
+                         uint32_t src_size,
                          uint8_t*& dest_buf,
-                         FX_DWORD& dest_size);
+                         uint32_t& dest_size);
 
 // Public for testing.
-FX_DWORD A85Decode(const uint8_t* src_buf,
-                   FX_DWORD src_size,
+uint32_t A85Decode(const uint8_t* src_buf,
+                   uint32_t src_size,
                    uint8_t*& dest_buf,
-                   FX_DWORD& dest_size);
+                   uint32_t& dest_size);
 // Public for testing.
-FX_DWORD HexDecode(const uint8_t* src_buf,
-                   FX_DWORD src_size,
+uint32_t HexDecode(const uint8_t* src_buf,
+                   uint32_t src_size,
                    uint8_t*& dest_buf,
-                   FX_DWORD& dest_size);
+                   uint32_t& dest_size);
 // Public for testing.
-FX_DWORD FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW,
+uint32_t FPDFAPI_FlateOrLZWDecode(FX_BOOL bLZW,
                                   const uint8_t* src_buf,
-                                  FX_DWORD src_size,
+                                  uint32_t src_size,
                                   CPDF_Dictionary* pParams,
-                                  FX_DWORD estimated_size,
+                                  uint32_t estimated_size,
                                   uint8_t*& dest_buf,
-                                  FX_DWORD& dest_size);
+                                  uint32_t& dest_size);
 FX_BOOL PDF_DataDecode(const uint8_t* src_buf,
-                       FX_DWORD src_size,
+                       uint32_t src_size,
                        const CPDF_Dictionary* pDict,
                        uint8_t*& dest_buf,
-                       FX_DWORD& dest_size,
+                       uint32_t& dest_size,
                        CFX_ByteString& ImageEncoding,
                        CPDF_Dictionary*& pImageParms,
-                       FX_DWORD estimated_size,
+                       uint32_t estimated_size,
                        FX_BOOL bImageAcc);
 
 #endif  // CORE_FPDFAPI_FPDF_PARSER_INCLUDE_FPDF_PARSER_DECODE_H_
diff --git a/core/fpdfapi/fpdf_parser/include/ipdf_data_avail.h b/core/fpdfapi/fpdf_parser/include/ipdf_data_avail.h
index d92c06d..e34761a 100644
--- a/core/fpdfapi/fpdf_parser/include/ipdf_data_avail.h
+++ b/core/fpdfapi/fpdf_parser/include/ipdf_data_avail.h
@@ -46,13 +46,13 @@
   class FileAvail {
    public:
     virtual ~FileAvail();
-    virtual FX_BOOL IsDataAvail(FX_FILESIZE offset, FX_DWORD size) = 0;
+    virtual FX_BOOL IsDataAvail(FX_FILESIZE offset, uint32_t size) = 0;
   };
 
   class DownloadHints {
    public:
     virtual ~DownloadHints();
-    virtual void AddSegment(FX_FILESIZE offset, FX_DWORD size) = 0;
+    virtual void AddSegment(FX_FILESIZE offset, uint32_t size) = 0;
   };
 
   static IPDF_DataAvail* Create(FileAvail* pFileAvail, IFX_FileRead* pFileRead);
@@ -68,7 +68,7 @@
   virtual DocFormStatus IsFormAvail(DownloadHints* pHints) = 0;
   virtual DocLinearizationStatus IsLinearizedPDF() = 0;
   virtual void GetLinearizedMainXRefInfo(FX_FILESIZE* pPos,
-                                         FX_DWORD* pSize) = 0;
+                                         uint32_t* pSize) = 0;
 
  protected:
   IPDF_DataAvail(FileAvail* pFileAvail, IFX_FileRead* pFileRead);
diff --git a/core/fpdfapi/fpdf_parser/ipdf_crypto_handler.h b/core/fpdfapi/fpdf_parser/ipdf_crypto_handler.h
index 8e83589..ea45a6b 100644
--- a/core/fpdfapi/fpdf_parser/ipdf_crypto_handler.h
+++ b/core/fpdfapi/fpdf_parser/ipdf_crypto_handler.h
@@ -19,27 +19,27 @@
   virtual FX_BOOL Init(CPDF_Dictionary* pEncryptDict,
                        IPDF_SecurityHandler* pSecurityHandler) = 0;
 
-  virtual FX_DWORD DecryptGetSize(FX_DWORD src_size) = 0;
-  virtual void* DecryptStart(FX_DWORD objnum, FX_DWORD gennum) = 0;
+  virtual uint32_t DecryptGetSize(uint32_t src_size) = 0;
+  virtual void* DecryptStart(uint32_t objnum, uint32_t gennum) = 0;
   virtual FX_BOOL DecryptStream(void* context,
                                 const uint8_t* src_buf,
-                                FX_DWORD src_size,
+                                uint32_t src_size,
                                 CFX_BinaryBuf& dest_buf) = 0;
 
   virtual FX_BOOL DecryptFinish(void* context, CFX_BinaryBuf& dest_buf) = 0;
-  virtual FX_DWORD EncryptGetSize(FX_DWORD objnum,
-                                  FX_DWORD version,
+  virtual uint32_t EncryptGetSize(uint32_t objnum,
+                                  uint32_t version,
                                   const uint8_t* src_buf,
-                                  FX_DWORD src_size) = 0;
+                                  uint32_t src_size) = 0;
 
-  virtual FX_BOOL EncryptContent(FX_DWORD objnum,
-                                 FX_DWORD version,
+  virtual FX_BOOL EncryptContent(uint32_t objnum,
+                                 uint32_t version,
                                  const uint8_t* src_buf,
-                                 FX_DWORD src_size,
+                                 uint32_t src_size,
                                  uint8_t* dest_buf,
-                                 FX_DWORD& dest_size) = 0;
+                                 uint32_t& dest_size) = 0;
 
-  void Decrypt(FX_DWORD objnum, FX_DWORD version, CFX_ByteString& str);
+  void Decrypt(uint32_t objnum, uint32_t version, CFX_ByteString& str);
 };
 
 #endif  // CORE_FPDFAPI_FPDF_PARSER_IPDF_CRYPTO_HANDLER_H_
diff --git a/core/fpdfapi/fpdf_parser/ipdf_security_handler.h b/core/fpdfapi/fpdf_parser/ipdf_security_handler.h
index fd70b1f..e7eb822 100644
--- a/core/fpdfapi/fpdf_parser/ipdf_security_handler.h
+++ b/core/fpdfapi/fpdf_parser/ipdf_security_handler.h
@@ -24,7 +24,7 @@
   virtual FX_BOOL OnInit(CPDF_Parser* pParser,
                          CPDF_Dictionary* pEncryptDict) = 0;
 
-  virtual FX_DWORD GetPermissions() = 0;
+  virtual uint32_t GetPermissions() = 0;
   virtual FX_BOOL GetCryptInfo(int& cipher,
                                const uint8_t*& buffer,
                                int& keylen) = 0;
diff --git a/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
index 578700c..4e47e01 100644
--- a/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
+++ b/core/fpdfapi/fpdf_render/cpdf_pagerendercache.h
@@ -30,17 +30,17 @@
   ~CPDF_PageRenderCache();
   void ClearImageData();
 
-  FX_DWORD EstimateSize();
+  uint32_t EstimateSize();
   void CacheOptimization(int32_t dwLimitCacheSize);
-  FX_DWORD GetTimeCount() const { return m_nTimeCount; }
-  void SetTimeCount(FX_DWORD dwTimeCount) { m_nTimeCount = dwTimeCount; }
+  uint32_t GetTimeCount() const { return m_nTimeCount; }
+  void SetTimeCount(uint32_t dwTimeCount) { m_nTimeCount = dwTimeCount; }
 
   void GetCachedBitmap(CPDF_Stream* pStream,
                        CFX_DIBSource*& pBitmap,
                        CFX_DIBSource*& pMask,
-                       FX_DWORD& MatteColor,
+                       uint32_t& MatteColor,
                        FX_BOOL bStdCS = FALSE,
-                       FX_DWORD GroupFamily = 0,
+                       uint32_t GroupFamily = 0,
                        FX_BOOL bLoadMask = FALSE,
                        CPDF_RenderStatus* pRenderStatus = NULL,
                        int32_t downsampleWidth = 0,
@@ -55,7 +55,7 @@
 
   FX_BOOL StartGetCachedBitmap(CPDF_Stream* pStream,
                                FX_BOOL bStdCS = FALSE,
-                               FX_DWORD GroupFamily = 0,
+                               uint32_t GroupFamily = 0,
                                FX_BOOL bLoadMask = FALSE,
                                CPDF_RenderStatus* pRenderStatus = NULL,
                                int32_t downsampleWidth = 0,
@@ -69,8 +69,8 @@
   CPDF_Page* const m_pPage;
   CPDF_ImageCacheEntry* m_pCurImageCacheEntry;
   std::map<CPDF_Stream*, CPDF_ImageCacheEntry*> m_ImageCache;
-  FX_DWORD m_nTimeCount;
-  FX_DWORD m_nCacheSize;
+  uint32_t m_nTimeCount;
+  uint32_t m_nCacheSize;
   FX_BOOL m_bCurFindCache;
 };
 
diff --git a/core/fpdfapi/fpdf_render/fpdf_render.cpp b/core/fpdfapi/fpdf_render/fpdf_render.cpp
index 24ca282..216613c 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render.cpp
@@ -208,7 +208,7 @@
                                       FX_BOOL bStdCS,
                                       CPDF_Type3Char* pType3Char,
                                       FX_ARGB fill_color,
-                                      FX_DWORD GroupFamily,
+                                      uint32_t GroupFamily,
                                       FX_BOOL bLoadMask) {
   m_pContext = pContext;
   m_pDevice = pDevice;
@@ -508,11 +508,11 @@
   if (FillType == 0 && !bStroke) {
     return TRUE;
   }
-  FX_DWORD fill_argb = 0;
+  uint32_t fill_argb = 0;
   if (FillType) {
     fill_argb = GetFillArgb(pPathObj);
   }
-  FX_DWORD stroke_argb = 0;
+  uint32_t stroke_argb = 0;
   if (bStroke) {
     stroke_argb = GetStrokeArgb(pPathObj);
   }
@@ -569,7 +569,7 @@
                      m_InitialStates.m_ColorState;
   }
   FX_COLORREF rgb = pColorData->m_FillRGB;
-  if (rgb == (FX_DWORD)-1) {
+  if (rgb == (uint32_t)-1) {
     return 0;
   }
   const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState;
@@ -603,7 +603,7 @@
                      m_InitialStates.m_ColorState;
   }
   FX_COLORREF rgb = pColorData->m_StrokeRGB;
-  if (rgb == (FX_DWORD)-1) {
+  if (rgb == (uint32_t)-1) {
     return 0;
   }
   const CPDF_GeneralStateData* pGeneralData = pObj->m_GeneralState;
@@ -847,7 +847,7 @@
     pTextMask->Clear(0);
     CFX_FxgeDevice text_device;
     text_device.Attach(pTextMask.get());
-    for (FX_DWORD i = 0; i < pPageObj->m_ClipPath.GetTextCount(); i++) {
+    for (uint32_t i = 0; i < pPageObj->m_ClipPath.GetTextCount(); i++) {
       CPDF_TextObject* textobj = pPageObj->m_ClipPath.GetText(i);
       if (!textobj) {
         break;
@@ -1156,7 +1156,7 @@
     if (pArray->GetCount() < 3)
       return nullptr;
 
-    for (FX_DWORD i = 0; i < 3; ++i) {
+    for (uint32_t i = 0; i < 3; ++i) {
       pFuncs[2 - i].reset(CPDF_Function::Load(pArray->GetElementValue(i)));
       if (!pFuncs[2 - i])
         return nullptr;
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp
index 15c7dcf..f5bc584 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_cache.cpp
@@ -15,7 +15,7 @@
 #include "core/include/fxge/fx_ge.h"
 
 struct CACHEINFO {
-  FX_DWORD time;
+  uint32_t time;
   CPDF_Stream* pStream;
 };
 
@@ -30,7 +30,7 @@
     delete it.second;
 }
 void CPDF_PageRenderCache::CacheOptimization(int32_t dwLimitCacheSize) {
-  if (m_nCacheSize <= (FX_DWORD)dwLimitCacheSize)
+  if (m_nCacheSize <= (uint32_t)dwLimitCacheSize)
     return;
 
   size_t nCount = m_ImageCache.size();
@@ -41,10 +41,10 @@
     pCACHEINFO[i++].pStream = it.second->GetStream();
   }
   FXSYS_qsort(pCACHEINFO, nCount, sizeof(CACHEINFO), compare);
-  FX_DWORD nTimeCount = m_nTimeCount;
+  uint32_t nTimeCount = m_nTimeCount;
 
   // Check if time value is about to roll over and reset all entries.
-  // The comparision is legal because FX_DWORD is an unsigned type.
+  // The comparision is legal because uint32_t is an unsigned type.
   if (nTimeCount + 1 < nTimeCount) {
     for (i = 0; i < nCount; i++)
       m_ImageCache[pCACHEINFO[i].pStream]->m_dwTimeCount = i;
@@ -55,7 +55,7 @@
   while (i + 15 < nCount)
     ClearImageCacheEntry(pCACHEINFO[i++].pStream);
 
-  while (i < nCount && m_nCacheSize > (FX_DWORD)dwLimitCacheSize)
+  while (i < nCount && m_nCacheSize > (uint32_t)dwLimitCacheSize)
     ClearImageCacheEntry(pCACHEINFO[i++].pStream);
 
   FX_Free(pCACHEINFO);
@@ -69,8 +69,8 @@
   delete it->second;
   m_ImageCache.erase(it);
 }
-FX_DWORD CPDF_PageRenderCache::EstimateSize() {
-  FX_DWORD dwSize = 0;
+uint32_t CPDF_PageRenderCache::EstimateSize() {
+  uint32_t dwSize = 0;
   for (const auto& it : m_ImageCache)
     dwSize += it.second->EstimateSize();
 
@@ -80,9 +80,9 @@
 void CPDF_PageRenderCache::GetCachedBitmap(CPDF_Stream* pStream,
                                            CFX_DIBSource*& pBitmap,
                                            CFX_DIBSource*& pMask,
-                                           FX_DWORD& MatteColor,
+                                           uint32_t& MatteColor,
                                            FX_BOOL bStdCS,
-                                           FX_DWORD GroupFamily,
+                                           uint32_t GroupFamily,
                                            FX_BOOL bLoadMask,
                                            CPDF_RenderStatus* pRenderStatus,
                                            int32_t downsampleWidth,
@@ -109,7 +109,7 @@
 FX_BOOL CPDF_PageRenderCache::StartGetCachedBitmap(
     CPDF_Stream* pStream,
     FX_BOOL bStdCS,
-    FX_DWORD GroupFamily,
+    uint32_t GroupFamily,
     FX_BOOL bLoadMask,
     CPDF_RenderStatus* pRenderStatus,
     int32_t downsampleWidth,
@@ -197,18 +197,18 @@
     ((CPDF_DIBSource*)m_pCachedBitmap)->ClearImageData();
   }
 }
-static FX_DWORD FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB) {
+static uint32_t FPDF_ImageCache_EstimateImageSize(const CFX_DIBSource* pDIB) {
   return pDIB && pDIB->GetBuffer()
-             ? (FX_DWORD)pDIB->GetHeight() * pDIB->GetPitch() +
-                   (FX_DWORD)pDIB->GetPaletteSize() * 4
+             ? (uint32_t)pDIB->GetHeight() * pDIB->GetPitch() +
+                   (uint32_t)pDIB->GetPaletteSize() * 4
              : 0;
 }
 FX_BOOL CPDF_ImageCacheEntry::GetCachedBitmap(CFX_DIBSource*& pBitmap,
                                               CFX_DIBSource*& pMask,
-                                              FX_DWORD& MatteColor,
+                                              uint32_t& MatteColor,
                                               CPDF_Dictionary* pPageResources,
                                               FX_BOOL bStdCS,
-                                              FX_DWORD GroupFamily,
+                                              uint32_t GroupFamily,
                                               FX_BOOL bLoadMask,
                                               CPDF_RenderStatus* pRenderStatus,
                                               int32_t downsampleWidth,
@@ -264,7 +264,7 @@
 int CPDF_ImageCacheEntry::StartGetCachedBitmap(CPDF_Dictionary* pFormResources,
                                                CPDF_Dictionary* pPageResources,
                                                FX_BOOL bStdCS,
-                                               FX_DWORD GroupFamily,
+                                               uint32_t GroupFamily,
                                                FX_BOOL bLoadMask,
                                                CPDF_RenderStatus* pRenderStatus,
                                                int32_t downsampleWidth,
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
index b28aee6..ef452da 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -57,7 +57,7 @@
         return;
       }
     } else {
-      FX_DWORD fill_argb = m_Options.TranslateColor(mask_argb);
+      uint32_t fill_argb = m_Options.TranslateColor(mask_argb);
       if (bitmap_alpha < 255) {
         ((uint8_t*)&fill_argb)[3] =
             ((uint8_t*)&fill_argb)[3] * bitmap_alpha / 255;
@@ -137,7 +137,7 @@
   std::unique_ptr<CFX_DIBitmap> pBackdrop1(new CFX_DIBitmap);
   pBackdrop1->Create(pBackdrop->GetWidth(), pBackdrop->GetHeight(),
                      FXDIB_Rgb32);
-  pBackdrop1->Clear((FX_DWORD)-1);
+  pBackdrop1->Clear((uint32_t)-1);
   pBackdrop1->CompositeBitmap(0, 0, pBackdrop->GetWidth(),
                               pBackdrop->GetHeight(), pBackdrop.get(), 0, 0);
   pBackdrop = std::move(pBackdrop1);
@@ -221,7 +221,7 @@
           *dest_buf++ = m_RampG[FXARGB_G(src_argb)];
           *dest_buf++ = m_RampR[FXARGB_B(src_argb)];
         } else {
-          FX_DWORD src_byte = *src_buf;
+          uint32_t src_byte = *src_buf;
           *dest_buf++ = m_RampB[src_byte];
           *dest_buf++ = m_RampG[src_byte];
           *dest_buf++ = m_RampR[src_byte];
@@ -417,7 +417,7 @@
           m_Flags |= FXRENDER_IMAGE_LOSSY;
         }
       } else if (CPDF_Array* pArray = pFilters->AsArray()) {
-        for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+        for (uint32_t i = 0; i < pArray->GetCount(); i++) {
           CFX_ByteStringC bsDecodeType = pArray->GetConstStringAt(i);
           if (bsDecodeType == "DCTDecode" || bsDecodeType == "JPXDecode") {
             m_Flags |= FXRENDER_IMAGE_LOSSY;
@@ -494,7 +494,7 @@
                                   FX_ARGB bitmap_argb,
                                   int bitmap_alpha,
                                   const CFX_Matrix* pImage2Device,
-                                  FX_DWORD flags,
+                                  uint32_t flags,
                                   FX_BOOL bStdCS,
                                   int blendType) {
   m_pRenderStatus = pStatus;
@@ -788,7 +788,7 @@
     CFX_PathData path;
     path.AppendRect(0, 0, 1, 1);
     path.Transform(&m_ImageMatrix);
-    FX_DWORD fill_color =
+    uint32_t fill_color =
         ArgbEncode(0xff, m_BitmapAlpha, m_BitmapAlpha, m_BitmapAlpha);
     m_pRenderStatus->m_pDevice->DrawPath(&path, NULL, NULL, fill_color, 0,
                                          FXFILL_WINDING);
@@ -868,7 +868,7 @@
 }
 ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     int nComps,
@@ -925,7 +925,7 @@
       pCS = m_pContext->GetDocument()->LoadColorSpace(pCSObj);
       if (pCS) {
         FX_FLOAT R, G, B;
-        FX_DWORD comps = 8;
+        uint32_t comps = 8;
         if (pCS->CountComponents() > comps) {
           comps = pCS->CountComponents();
         }
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 1ad091e..6ed50ea 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -38,7 +38,7 @@
   return (byte >> (8 - nbits - (bitpos % 8))) & ((1 << nbits) - 1);
 }
 
-FX_SAFE_DWORD CalculatePitch8(FX_DWORD bpc, FX_DWORD components, int width) {
+FX_SAFE_DWORD CalculatePitch8(uint32_t bpc, uint32_t components, int width) {
   FX_SAFE_DWORD pitch = bpc;
   pitch *= components;
   pitch *= width;
@@ -147,11 +147,11 @@
 FX_BOOL CPDF_DIBSource::Load(CPDF_Document* pDoc,
                              const CPDF_Stream* pStream,
                              CPDF_DIBSource** ppMask,
-                             FX_DWORD* pMatteColor,
+                             uint32_t* pMatteColor,
                              CPDF_Dictionary* pFormResources,
                              CPDF_Dictionary* pPageResources,
                              FX_BOOL bStdCS,
-                             FX_DWORD GroupFamily,
+                             uint32_t GroupFamily,
                              FX_BOOL bLoadMask) {
   if (!pStream) {
     return FALSE;
@@ -274,7 +274,7 @@
                                        CPDF_Dictionary* pFormResources,
                                        CPDF_Dictionary* pPageResources,
                                        FX_BOOL bStdCS,
-                                       FX_DWORD GroupFamily,
+                                       uint32_t GroupFamily,
                                        FX_BOOL bLoadMask) {
   if (!pStream) {
     return 0;
@@ -480,7 +480,7 @@
   int max_data = (1 << m_bpc) - 1;
   CPDF_Array* pDecode = m_pDict->GetArrayBy("Decode");
   if (pDecode) {
-    for (FX_DWORD i = 0; i < m_nComponents; i++) {
+    for (uint32_t i = 0; i < m_nComponents; i++) {
       pCompData[i].m_DecodeMin = pDecode->GetNumberAt(i * 2);
       FX_FLOAT max = pDecode->GetNumberAt(i * 2 + 1);
       pCompData[i].m_DecodeStep = (max - pCompData[i].m_DecodeMin) / max_data;
@@ -496,7 +496,7 @@
       }
     }
   } else {
-    for (FX_DWORD i = 0; i < m_nComponents; i++) {
+    for (uint32_t i = 0; i < m_nComponents; i++) {
       FX_FLOAT def_value;
       m_pColorSpace->GetDefaultValue(i, def_value, pCompData[i].m_DecodeMin,
                                      pCompData[i].m_DecodeStep);
@@ -514,7 +514,7 @@
     }
     if (CPDF_Array* pArray = pMask->AsArray()) {
       if (pArray->GetCount() >= m_nComponents * 2) {
-        for (FX_DWORD i = 0; i < m_nComponents; i++) {
+        for (uint32_t i = 0; i < m_nComponents; i++) {
           int min_num = pArray->GetIntegerAt(i * 2);
           int max_num = pArray->GetIntegerAt(i * 2 + 1);
           pCompData[i].m_ColorKeyMin = std::max(min_num, 0);
@@ -529,14 +529,14 @@
 
 ICodec_ScanlineDecoder* FPDFAPI_CreateFaxDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     const CPDF_Dictionary* pParams);
 
 ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     int nComps,
@@ -552,7 +552,7 @@
     return 0;
   }
   const uint8_t* src_data = m_pStreamAcc->GetData();
-  FX_DWORD src_size = m_pStreamAcc->GetSize();
+  uint32_t src_size = m_pStreamAcc->GetSize();
   const CPDF_Dictionary* pParams = m_pStreamAcc->GetImageParam();
   if (decoder == "CCITTFaxDecode") {
     m_pDecoder.reset(FPDFAPI_CreateFaxDecoder(src_data, src_size, m_Width,
@@ -568,9 +568,9 @@
       ICodec_JpegModule* pJpegModule = CPDF_ModuleMgr::Get()->GetJpegModule();
       if (pJpegModule->LoadInfo(src_data, src_size, m_Width, m_Height, comps,
                                 bpc, bTransform)) {
-        if (m_nComponents != static_cast<FX_DWORD>(comps)) {
+        if (m_nComponents != static_cast<uint32_t>(comps)) {
           FX_Free(m_pCompData);
-          m_nComponents = static_cast<FX_DWORD>(comps);
+          m_nComponents = static_cast<uint32_t>(comps);
           if (m_Family == PDFCS_LAB && m_nComponents != 3) {
             m_pCompData = nullptr;
             return 0;
@@ -638,9 +638,9 @@
   if (!context->decoder())
     return;
 
-  FX_DWORD width = 0;
-  FX_DWORD height = 0;
-  FX_DWORD components = 0;
+  uint32_t width = 0;
+  uint32_t height = 0;
+  uint32_t components = 0;
   pJpxModule->GetImageInfo(context->decoder(), &width, &height, &components);
   if (static_cast<int>(width) < m_Width || static_cast<int>(height) < m_Height)
     return;
@@ -682,7 +682,7 @@
   }
   m_pCachedBitmap->Clear(0xFFFFFFFF);
   std::vector<uint8_t> output_offsets(components);
-  for (FX_DWORD i = 0; i < components; ++i)
+  for (uint32_t i = 0; i < components; ++i)
     output_offsets[i] = i;
   if (bSwapRGB) {
     output_offsets[0] = 2;
@@ -696,10 +696,10 @@
   if (m_pColorSpace && m_pColorSpace->GetFamily() == PDFCS_INDEXED &&
       m_bpc < 8) {
     int scale = 8 - m_bpc;
-    for (FX_DWORD row = 0; row < height; ++row) {
+    for (uint32_t row = 0; row < height; ++row) {
       uint8_t* scanline =
           const_cast<uint8_t*>(m_pCachedBitmap->GetScanline(row));
-      for (FX_DWORD col = 0; col < width; ++col) {
+      for (uint32_t col = 0; col < width; ++col) {
         *scanline = (*scanline) >> scale;
         ++scanline;
       }
@@ -708,7 +708,7 @@
   m_bpc = 8;
 }
 
-CPDF_DIBSource* CPDF_DIBSource::LoadMask(FX_DWORD& MatteColor) {
+CPDF_DIBSource* CPDF_DIBSource::LoadMask(uint32_t& MatteColor) {
   MatteColor = 0xFFFFFFFF;
   CPDF_Stream* pSoftMask = m_pDict->GetStreamBy("SMask");
   if (pSoftMask) {
@@ -716,7 +716,7 @@
     if (pMatte && m_pColorSpace &&
         m_pColorSpace->CountComponents() <= m_nComponents) {
       std::vector<FX_FLOAT> colors(m_nComponents);
-      for (FX_DWORD i = 0; i < m_nComponents; i++) {
+      for (uint32_t i = 0; i < m_nComponents; i++) {
         colors[i] = pMatte->GetFloatAt(i);
       }
       FX_FLOAT R, G, B;
@@ -742,7 +742,7 @@
         m_pColorSpace->CountComponents() <= m_nComponents) {
       FX_FLOAT R, G, B;
       std::vector<FX_FLOAT> colors(m_nComponents);
-      for (FX_DWORD i = 0; i < m_nComponents; i++) {
+      for (uint32_t i = 0; i < m_nComponents; i++) {
         colors[i] = pMatte->GetFloatAt(i);
       }
       m_pColorSpace->GetRGB(colors.data(), R, G, B);
@@ -853,7 +853,7 @@
     FX_FLOAT* color_value = color_values;
     for (int i = 0; i < palette_count; i++) {
       int color_data = i;
-      for (FX_DWORD j = 0; j < m_nComponents; j++) {
+      for (uint32_t j = 0; j < m_nComponents; j++) {
         int encoded_component = color_data % (1 << m_bpc);
         color_data /= 1 << m_bpc;
         color_value[j] = m_pCompData[j].m_DecodeMin +
@@ -972,7 +972,7 @@
     uint64_t src_byte_pos = 0;
     size_t dest_byte_pos = 0;
     for (int column = 0; column < m_Width; column++) {
-      for (FX_DWORD color = 0; color < m_nComponents; color++) {
+      for (uint32_t color = 0; color < m_nComponents; color++) {
         uint8_t data = src_scan[src_byte_pos++];
         color_values[color] = m_pCompData[color].m_DecodeMin +
                               m_pCompData[color].m_DecodeStep * data;
@@ -997,7 +997,7 @@
     uint64_t src_bit_pos = 0;
     size_t dest_byte_pos = 0;
     for (int column = 0; column < m_Width; column++) {
-      for (FX_DWORD color = 0; color < m_nComponents; color++) {
+      for (uint32_t color = 0; color < m_nComponents; color++) {
         unsigned int data = GetBits8(src_scan, src_bit_pos, m_bpc);
         color_values[color] = m_pCompData[color].m_DecodeMin +
                               m_pCompData[color].m_DecodeStep * data;
@@ -1033,7 +1033,7 @@
   FX_SAFE_DWORD src_pitch = CalculatePitch8(m_bpc, m_nComponents, m_Width);
   if (!src_pitch.IsValid())
     return nullptr;
-  FX_DWORD src_pitch_value = src_pitch.ValueOrDie();
+  uint32_t src_pitch_value = src_pitch.ValueOrDie();
   const uint8_t* pSrcLine = nullptr;
   if (m_pCachedBitmap && src_pitch_value <= m_pCachedBitmap->GetPitch()) {
     if (line >= m_pCachedBitmap->GetHeight()) {
@@ -1054,11 +1054,11 @@
   }
   if (m_bpc * m_nComponents == 1) {
     if (m_bImageMask && m_bDefaultDecode) {
-      for (FX_DWORD i = 0; i < src_pitch_value; i++) {
+      for (uint32_t i = 0; i < src_pitch_value; i++) {
         m_pLineBuf[i] = ~pSrcLine[i];
       }
     } else if (m_bColorKey) {
-      FX_DWORD reset_argb, set_argb;
+      uint32_t reset_argb, set_argb;
       reset_argb = m_pPalette ? m_pPalette[0] : 0xFF000000;
       set_argb = m_pPalette ? m_pPalette[1] : 0xFFFFFFFF;
       if (m_pCompData[0].m_ColorKeyMin == 0) {
@@ -1069,7 +1069,7 @@
       }
       set_argb = FXARGB_TODIB(set_argb);
       reset_argb = FXARGB_TODIB(reset_argb);
-      FX_DWORD* dest_scan = reinterpret_cast<FX_DWORD*>(m_pMaskedLine);
+      uint32_t* dest_scan = reinterpret_cast<uint32_t*>(m_pMaskedLine);
       for (int col = 0; col < m_Width; col++) {
         if (pSrcLine[col / 8] & (1 << (7 - col % 8))) {
           *dest_scan = set_argb;
@@ -1091,7 +1091,7 @@
       uint64_t src_bit_pos = 0;
       for (int col = 0; col < m_Width; col++) {
         unsigned int color_index = 0;
-        for (FX_DWORD color = 0; color < m_nComponents; color++) {
+        for (uint32_t color = 0; color < m_nComponents; color++) {
           unsigned int data = GetBits8(pSrcLine, src_bit_pos, m_bpc);
           color_index |= data << (color * m_bpc);
           src_bit_pos += m_bpc;
@@ -1175,7 +1175,7 @@
     return;
   }
 
-  FX_DWORD src_width = m_Width;
+  uint32_t src_width = m_Width;
   FX_SAFE_DWORD pitch = CalculatePitch8(m_bpc, m_nComponents, m_Width);
   if (!pitch.IsValid())
     return;
@@ -1186,7 +1186,7 @@
   } else if (m_pDecoder) {
     pSrcLine = m_pDecoder->GetScanline(line);
   } else {
-    FX_DWORD src_pitch = pitch.ValueOrDie();
+    uint32_t src_pitch = pitch.ValueOrDie();
     pitch *= (line + 1);
     if (!pitch.IsValid()) {
       return;
@@ -1224,19 +1224,19 @@
 
 void CPDF_DIBSource::DownSampleScanline1Bit(int orig_Bpp,
                                             int dest_Bpp,
-                                            FX_DWORD src_width,
+                                            uint32_t src_width,
                                             const uint8_t* pSrcLine,
                                             uint8_t* dest_scan,
                                             int dest_width,
                                             FX_BOOL bFlipX,
                                             int clip_left,
                                             int clip_width) const {
-  FX_DWORD set_argb = (FX_DWORD)-1;
-  FX_DWORD reset_argb = 0;
+  uint32_t set_argb = (uint32_t)-1;
+  uint32_t reset_argb = 0;
   if (m_bImageMask) {
     if (m_bDefaultDecode) {
       set_argb = 0;
-      reset_argb = (FX_DWORD)-1;
+      reset_argb = (uint32_t)-1;
     }
   } else if (m_bColorKey) {
     reset_argb = m_pPalette ? m_pPalette[0] : 0xFF000000;
@@ -1249,9 +1249,9 @@
     }
     set_argb = FXARGB_TODIB(set_argb);
     reset_argb = FXARGB_TODIB(reset_argb);
-    FX_DWORD* dest_scan_dword = reinterpret_cast<FX_DWORD*>(dest_scan);
+    uint32_t* dest_scan_dword = reinterpret_cast<uint32_t*>(dest_scan);
     for (int i = 0; i < clip_width; i++) {
-      FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+      uint32_t src_x = (clip_left + i) * src_width / dest_width;
       if (bFlipX) {
         src_x = src_width - src_x - 1;
       }
@@ -1271,7 +1271,7 @@
     }
   }
   for (int i = 0; i < clip_width; i++) {
-    FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+    uint32_t src_x = (clip_left + i) * src_width / dest_width;
     if (bFlipX) {
       src_x = src_width - src_x - 1;
     }
@@ -1285,7 +1285,7 @@
         dest_scan[dest_pos + 1] = FXARGB_G(set_argb);
         dest_scan[dest_pos + 2] = FXARGB_R(set_argb);
       } else {
-        *reinterpret_cast<FX_DWORD*>(dest_scan + dest_pos) = set_argb;
+        *reinterpret_cast<uint32_t*>(dest_scan + dest_pos) = set_argb;
       }
     } else {
       if (dest_Bpp == 1) {
@@ -1295,7 +1295,7 @@
         dest_scan[dest_pos + 1] = FXARGB_G(reset_argb);
         dest_scan[dest_pos + 2] = FXARGB_R(reset_argb);
       } else {
-        *reinterpret_cast<FX_DWORD*>(dest_scan + dest_pos) = reset_argb;
+        *reinterpret_cast<uint32_t*>(dest_scan + dest_pos) = reset_argb;
       }
     }
   }
@@ -1303,7 +1303,7 @@
 
 void CPDF_DIBSource::DownSampleScanline8Bit(int orig_Bpp,
                                             int dest_Bpp,
-                                            FX_DWORD src_width,
+                                            uint32_t src_width,
                                             const uint8_t* pSrcLine,
                                             uint8_t* dest_scan,
                                             int dest_width,
@@ -1312,9 +1312,9 @@
                                             int clip_width) const {
   if (m_bpc < 8) {
     uint64_t src_bit_pos = 0;
-    for (FX_DWORD col = 0; col < src_width; col++) {
+    for (uint32_t col = 0; col < src_width; col++) {
       unsigned int color_index = 0;
-      for (FX_DWORD color = 0; color < m_nComponents; color++) {
+      for (uint32_t color = 0; color < m_nComponents; color++) {
         unsigned int data = GetBits8(pSrcLine, src_bit_pos, m_bpc);
         color_index |= data << (color * m_bpc);
         src_bit_pos += m_bpc;
@@ -1325,7 +1325,7 @@
   }
   if (m_bColorKey) {
     for (int i = 0; i < clip_width; i++) {
-      FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+      uint32_t src_x = (clip_left + i) * src_width / dest_width;
       if (bFlipX) {
         src_x = src_width - src_x - 1;
       }
@@ -1349,7 +1349,7 @@
     return;
   }
   for (int i = 0; i < clip_width; i++) {
-    FX_DWORD src_x = (clip_left + i) * src_width / dest_width;
+    uint32_t src_x = (clip_left + i) * src_width / dest_width;
     if (bFlipX) {
       src_x = src_width - src_x - 1;
     }
@@ -1369,7 +1369,7 @@
 
 void CPDF_DIBSource::DownSampleScanline32Bit(int orig_Bpp,
                                              int dest_Bpp,
-                                             FX_DWORD src_width,
+                                             uint32_t src_width,
                                              const uint8_t* pSrcLine,
                                              uint8_t* dest_scan,
                                              int dest_width,
@@ -1378,12 +1378,12 @@
                                              int clip_width) const {
   // last_src_x used to store the last seen src_x position which should be
   // in [0, src_width). Set the initial value to be an invalid src_x value.
-  FX_DWORD last_src_x = src_width;
+  uint32_t last_src_x = src_width;
   FX_ARGB last_argb = FXARGB_MAKE(0xFF, 0xFF, 0xFF, 0xFF);
   FX_FLOAT unit_To8Bpc = 255.0f / ((1 << m_bpc) - 1);
   for (int i = 0; i < clip_width; i++) {
     int dest_x = clip_left + i;
-    FX_DWORD src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) *
+    uint32_t src_x = (bFlipX ? (dest_width - dest_x - 1) : dest_x) *
                      (int64_t)src_width / dest_width;
     src_x %= src_width;
 
@@ -1401,7 +1401,7 @@
         size_t num_bits = src_x * m_bpc * m_nComponents;
         uint64_t src_bit_pos = num_bits % 8;
         pSrcPixel = pSrcLine + num_bits / 8;
-        for (FX_DWORD j = 0; j < m_nComponents; ++j) {
+        for (uint32_t j = 0; j < m_nComponents; ++j) {
           extracted_components[j] = static_cast<uint8_t>(
               GetBits8(pSrcPixel, src_bit_pos, m_bpc) * unit_To8Bpc);
           src_bit_pos += m_bpc;
@@ -1410,7 +1410,7 @@
       } else {
         pSrcPixel = pSrcLine + src_x * orig_Bpp;
         if (m_bpc == 16) {
-          for (FX_DWORD j = 0; j < m_nComponents; ++j)
+          for (uint32_t j = 0; j < m_nComponents; ++j)
             extracted_components[j] = pSrcPixel[j * 2];
           pSrcPixel = extracted_components;
         }
@@ -1423,7 +1423,7 @@
           m_pColorSpace->TranslateImageLine(color, pSrcPixel, 1, 0, 0,
                                             bTransMask);
         } else {
-          for (FX_DWORD j = 0; j < m_nComponents; ++j) {
+          for (uint32_t j = 0; j < m_nComponents; ++j) {
             FX_FLOAT component_value =
                 static_cast<FX_FLOAT>(extracted_components[j]);
             int color_value = static_cast<int>(
@@ -1460,7 +1460,7 @@
       last_argb = argb;
     }
     if (dest_Bpp == 4) {
-      *reinterpret_cast<FX_DWORD*>(pDestPixel) = FXARGB_TODIB(argb);
+      *reinterpret_cast<uint32_t*>(pDestPixel) = FXARGB_TODIB(argb);
     } else {
       *pDestPixel++ = FXARGB_B(argb);
       *pDestPixel++ = FXARGB_G(argb);
@@ -1500,7 +1500,7 @@
                                       const CPDF_ImageObject* pImage,
                                       CPDF_PageRenderCache* pCache,
                                       FX_BOOL bStdCS,
-                                      FX_DWORD GroupFamily,
+                                      uint32_t GroupFamily,
                                       FX_BOOL bLoadMask,
                                       CPDF_RenderStatus* pRenderStatus,
                                       int32_t nDownsampleWidth,
@@ -1565,7 +1565,7 @@
                                 CPDF_PageRenderCache* pCache,
                                 CPDF_ImageLoaderHandle*& LoadHandle,
                                 FX_BOOL bStdCS,
-                                FX_DWORD GroupFamily,
+                                uint32_t GroupFamily,
                                 FX_BOOL bLoadMask,
                                 CPDF_RenderStatus* pRenderStatus,
                                 int32_t nDownsampleWidth,
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
index 94f38c5..9c1fa36 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_pattern.cpp
@@ -70,7 +70,7 @@
   CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
   FX_FLOAT* pResults = result_array;
   FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT));
-  FX_DWORD rgb_array[SHADING_STEPS];
+  uint32_t rgb_array[SHADING_STEPS];
   for (int i = 0; i < SHADING_STEPS; i++) {
     FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min;
     int offset = 0;
@@ -90,7 +90,7 @@
   }
   int pitch = pBitmap->GetPitch();
   for (int row = 0; row < height; row++) {
-    FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
+    uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch);
     for (int column = 0; column < width; column++) {
       FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
       matrix.Transform(x, y);
@@ -156,7 +156,7 @@
   CFX_FixedBufGrow<FX_FLOAT, 16> result_array(total_results);
   FX_FLOAT* pResults = result_array;
   FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT));
-  FX_DWORD rgb_array[SHADING_STEPS];
+  uint32_t rgb_array[SHADING_STEPS];
   for (int i = 0; i < SHADING_STEPS; i++) {
     FX_FLOAT input = (t_max - t_min) * i / SHADING_STEPS + t_min;
     int offset = 0;
@@ -189,7 +189,7 @@
     }
   }
   for (int row = 0; row < height; row++) {
-    FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
+    uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch);
     for (int column = 0; column < width; column++) {
       FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
       matrix.Transform(x, y);
@@ -286,7 +286,7 @@
   FX_FLOAT* pResults = result_array;
   FXSYS_memset(pResults, 0, total_results * sizeof(FX_FLOAT));
   for (int row = 0; row < height; row++) {
-    FX_DWORD* dib_buf = (FX_DWORD*)(pBitmap->GetBuffer() + row * pitch);
+    uint32_t* dib_buf = (uint32_t*)(pBitmap->GetBuffer() + row * pitch);
     for (int column = 0; column < width; column++) {
       FX_FLOAT x = (FX_FLOAT)column, y = (FX_FLOAT)row;
       matrix.Transform(x, y);
@@ -432,7 +432,7 @@
 
   while (!stream.m_BitStream.IsEOF()) {
     CPDF_MeshVertex vertex;
-    FX_DWORD flag = stream.GetVertex(vertex, pObject2Bitmap);
+    uint32_t flag = stream.GetVertex(vertex, pObject2Bitmap);
     if (flag == 0) {
       triangle[0] = vertex;
       for (int j = 1; j < 3; j++) {
@@ -782,7 +782,7 @@
   CFX_PointF coords[16];
   int point_count = bTensor ? 16 : 12;
   while (!stream.m_BitStream.IsEOF()) {
-    FX_DWORD flag = stream.GetFlag();
+    uint32_t flag = stream.GetFlag();
     int iStartPoint = 0, iStartColor = 0, i = 0;
     if (flag) {
       iStartPoint = 4;
@@ -1141,7 +1141,7 @@
     return;
   }
   screen.Clear(0);
-  FX_DWORD* src_buf = (FX_DWORD*)pPatternBitmap->GetBuffer();
+  uint32_t* src_buf = (uint32_t*)pPatternBitmap->GetBuffer();
   for (int col = min_col; col <= max_col; col++) {
     for (int row = min_row; row <= max_row; row++) {
       int start_x, start_y;
@@ -1160,8 +1160,8 @@
             start_y >= clip_box.Height()) {
           continue;
         }
-        FX_DWORD* dest_buf =
-            (FX_DWORD*)(screen.GetBuffer() + screen.GetPitch() * start_y +
+        uint32_t* dest_buf =
+            (uint32_t*)(screen.GetBuffer() + screen.GetPitch() * start_y +
                         start_x * 4);
         if (pPattern->m_bColored) {
           *dest_buf = *src_buf;
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 04b0c93..c38362f 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -29,7 +29,7 @@
   }
   m_SizeMap.clear();
 }
-CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(FX_DWORD charcode,
+CFX_GlyphBitmap* CPDF_Type3Cache::LoadGlyph(uint32_t charcode,
                                             const CFX_Matrix* pMatrix,
                                             FX_FLOAT retinaScaleX,
                                             FX_FLOAT retinaScaleY) {
@@ -130,7 +130,7 @@
   return -1;
 }
 CFX_GlyphBitmap* CPDF_Type3Cache::RenderGlyph(CPDF_Type3Glyphs* pSize,
-                                              FX_DWORD charcode,
+                                              uint32_t charcode,
                                               const CFX_Matrix* pMatrix,
                                               FX_FLOAT retinaScaleX,
                                               FX_FLOAT retinaScaleY) {
@@ -192,10 +192,10 @@
   va_start(argList, count);
   for (int i = 0; i < count; i++) {
     int p = va_arg(argList, int);
-    ((FX_DWORD*)m_Key)[i] = p;
+    ((uint32_t*)m_Key)[i] = p;
   }
   va_end(argList);
-  m_KeyLen = count * sizeof(FX_DWORD);
+  m_KeyLen = count * sizeof(uint32_t);
 }
 FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj,
                                        const CFX_Matrix* pObj2Device,
@@ -334,7 +334,7 @@
       ReleaseCachedType3(m_pType3Font);
     }
   }
-  FX_DWORD m_dwCount;
+  uint32_t m_dwCount;
   CPDF_Type3Font* m_pType3Font;
 };
 FX_BOOL CPDF_RenderStatus::ProcessType3Text(const CPDF_TextObject* textobj,
@@ -362,13 +362,13 @@
     return FALSE;
   }
   CPDF_RefType3Cache refTypeCache(pType3Font);
-  FX_DWORD* pChars = textobj->m_pCharCodes;
+  uint32_t* pChars = textobj->m_pCharCodes;
   if (textobj->m_nChars == 1) {
-    pChars = (FX_DWORD*)(&textobj->m_pCharCodes);
+    pChars = (uint32_t*)(&textobj->m_pCharCodes);
   }
   for (int iChar = 0; iChar < textobj->m_nChars; iChar++) {
-    FX_DWORD charcode = pChars[iChar];
-    if (charcode == (FX_DWORD)-1) {
+    uint32_t charcode = pChars[iChar];
+    if (charcode == (uint32_t)-1) {
       continue;
     }
     CPDF_Type3Char* pType3Char = pType3Font->LoadChar(charcode);
@@ -501,12 +501,12 @@
   CPDF_CharPosList();
   ~CPDF_CharPosList();
   void Load(int nChars,
-            FX_DWORD* pCharCodes,
+            uint32_t* pCharCodes,
             FX_FLOAT* pCharPos,
             CPDF_Font* pFont,
             FX_FLOAT font_size);
   FXTEXT_CHARPOS* m_pCharPos;
-  FX_DWORD m_nChars;
+  uint32_t m_nChars;
 };
 
 CPDF_CharPosList::CPDF_CharPosList() {
@@ -516,7 +516,7 @@
   FX_Free(m_pCharPos);
 }
 void CPDF_CharPosList::Load(int nChars,
-                            FX_DWORD* pCharCodes,
+                            uint32_t* pCharCodes,
                             FX_FLOAT* pCharPos,
                             CPDF_Font* pFont,
                             FX_FLOAT FontSize) {
@@ -525,9 +525,9 @@
   CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
   FX_BOOL bVertWriting = pCIDFont && pCIDFont->IsVertWriting();
   for (int iChar = 0; iChar < nChars; iChar++) {
-    FX_DWORD CharCode =
-        nChars == 1 ? (FX_DWORD)(uintptr_t)pCharCodes : pCharCodes[iChar];
-    if (CharCode == (FX_DWORD)-1) {
+    uint32_t CharCode =
+        nChars == 1 ? (uint32_t)(uintptr_t)pCharCodes : pCharCodes[iChar];
+    if (CharCode == (uint32_t)-1) {
       continue;
     }
     FX_BOOL bVert = FALSE;
@@ -575,7 +575,7 @@
 }
 FX_BOOL CPDF_TextRenderer::DrawTextPath(CFX_RenderDevice* pDevice,
                                         int nChars,
-                                        FX_DWORD* pCharCodes,
+                                        uint32_t* pCharCodes,
                                         FX_FLOAT* pCharPos,
                                         CPDF_Font* pFont,
                                         FX_FLOAT font_size,
@@ -629,16 +629,16 @@
   if (nChars == 0) {
     return;
   }
-  FX_DWORD charcode;
+  uint32_t charcode;
   int offset = 0;
-  FX_DWORD* pCharCodes;
+  uint32_t* pCharCodes;
   FX_FLOAT* pCharPos;
   if (nChars == 1) {
     charcode = pFont->GetNextChar(str, str.GetLength(), offset);
-    pCharCodes = (FX_DWORD*)(uintptr_t)charcode;
+    pCharCodes = (uint32_t*)(uintptr_t)charcode;
     pCharPos = NULL;
   } else {
-    pCharCodes = FX_Alloc(FX_DWORD, nChars);
+    pCharCodes = FX_Alloc(uint32_t, nChars);
     pCharPos = FX_Alloc(FX_FLOAT, nChars - 1);
     FX_FLOAT cur_pos = 0;
     for (int i = 0; i < nChars; i++) {
@@ -673,7 +673,7 @@
 }
 FX_BOOL CPDF_TextRenderer::DrawNormalText(CFX_RenderDevice* pDevice,
                                           int nChars,
-                                          FX_DWORD* pCharCodes,
+                                          uint32_t* pCharCodes,
                                           FX_FLOAT* pCharPos,
                                           CPDF_Font* pFont,
                                           FX_FLOAT font_size,
@@ -687,7 +687,7 @@
   CharPosList.Load(nChars, pCharCodes, pCharPos, pFont, font_size);
   int FXGE_flags = 0;
   if (pOptions) {
-    FX_DWORD dwFlags = pOptions->m_Flags;
+    uint32_t dwFlags = pOptions->m_Flags;
     if (dwFlags & RENDER_CLEARTYPE) {
       FXGE_flags |= FXTEXT_CLEARTYPE;
       if (dwFlags & RENDER_BGR_STRIPE) {
@@ -750,7 +750,7 @@
   CPDF_CharPosList CharPosList;
   CharPosList.Load(textobj->m_nChars, textobj->m_pCharCodes,
                    textobj->m_pCharPos, pFont, font_size);
-  for (FX_DWORD i = 0; i < CharPosList.m_nChars; i++) {
+  for (uint32_t i = 0; i < CharPosList.m_nChars; i++) {
     FXTEXT_CHARPOS& charpos = CharPosList.m_pCharPos[i];
     const CFX_PathData* pPath = pFaceCache->LoadGlyphPath(
         &pFont->m_Font, charpos.m_GlyphIndex, charpos.m_FontCharWidth);
diff --git a/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h b/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h
index 11ece71..96e3041 100644
--- a/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h
+++ b/core/fpdfapi/fpdf_render/include/cpdf_progressiverenderer.h
@@ -54,7 +54,7 @@
   const CPDF_RenderOptions* const m_pOptions;
   std::unique_ptr<CPDF_RenderStatus> m_pRenderStatus;
   CFX_FloatRect m_ClipRect;
-  FX_DWORD m_LayerIndex;
+  uint32_t m_LayerIndex;
   CPDF_RenderContext::Layer* m_pCurrentLayer;
   CPDF_PageObjectList::iterator m_LastObjectRendered;
 };
diff --git a/core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h b/core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h
index b2566ad..2974a65 100644
--- a/core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h
+++ b/core/fpdfapi/fpdf_render/include/cpdf_rendercontext.h
@@ -50,8 +50,8 @@
                      const CPDF_RenderOptions* pOptions,
                      CFX_Matrix* pFinalMatrix);
 
-  FX_DWORD CountLayers() const { return m_Layers.GetSize(); }
-  Layer* GetLayer(FX_DWORD index) { return m_Layers.GetDataPtr(index); }
+  uint32_t CountLayers() const { return m_Layers.GetSize(); }
+  Layer* GetLayer(uint32_t index) { return m_Layers.GetDataPtr(index); }
 
   CPDF_Document* GetDocument() const { return m_pDocument; }
   CPDF_Dictionary* GetPageResources() const { return m_pPageResources; }
diff --git a/core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h b/core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h
index f28fae4..a78838a 100644
--- a/core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h
+++ b/core/fpdfapi/fpdf_render/include/cpdf_renderoptions.h
@@ -41,11 +41,11 @@
   int m_ColorMode;
   FX_COLORREF m_BackColor;
   FX_COLORREF m_ForeColor;
-  FX_DWORD m_Flags;
+  uint32_t m_Flags;
   int m_Interpolation;
-  FX_DWORD m_AddFlags;
+  uint32_t m_AddFlags;
   IPDF_OCContext* m_pOCContext;
-  FX_DWORD m_dwLimitCacheSize;
+  uint32_t m_dwLimitCacheSize;
   int m_HalftoneLimit;
 };
 
diff --git a/core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h b/core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h
index 7c04e4a..2d3ce44 100644
--- a/core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h
+++ b/core/fpdfapi/fpdf_render/include/cpdf_textrenderer.h
@@ -42,7 +42,7 @@
 
   static FX_BOOL DrawTextPath(CFX_RenderDevice* pDevice,
                               int nChars,
-                              FX_DWORD* pCharCodes,
+                              uint32_t* pCharCodes,
                               FX_FLOAT* pCharPos,
                               CPDF_Font* pFont,
                               FX_FLOAT font_size,
@@ -56,7 +56,7 @@
 
   static FX_BOOL DrawNormalText(CFX_RenderDevice* pDevice,
                                 int nChars,
-                                FX_DWORD* pCharCodes,
+                                uint32_t* pCharCodes,
                                 FX_FLOAT* pCharPos,
                                 CPDF_Font* pFont,
                                 FX_FLOAT font_size,
@@ -66,7 +66,7 @@
 
   static FX_BOOL DrawType3Text(CFX_RenderDevice* pDevice,
                                int nChars,
-                               FX_DWORD* pCharCodes,
+                               uint32_t* pCharCodes,
                                FX_FLOAT* pCharPos,
                                CPDF_Font* pFont,
                                FX_FLOAT font_size,
diff --git a/core/fpdfapi/fpdf_render/render_int.h b/core/fpdfapi/fpdf_render/render_int.h
index ea1b1d8..a3b8d76 100644
--- a/core/fpdfapi/fpdf_render/render_int.h
+++ b/core/fpdfapi/fpdf_render/render_int.h
@@ -56,7 +56,7 @@
                   int& top_line,
                   int& bottom_line);
 
-  std::map<FX_DWORD, CFX_GlyphBitmap*> m_GlyphMap;
+  std::map<uint32_t, CFX_GlyphBitmap*> m_GlyphMap;
   int m_TopBlue[TYPE3_MAX_BLUES];
   int m_BottomBlue[TYPE3_MAX_BLUES];
   int m_TopBlueCount;
@@ -67,14 +67,14 @@
   explicit CPDF_Type3Cache(CPDF_Type3Font* pFont) : m_pFont(pFont) {}
   ~CPDF_Type3Cache();
 
-  CFX_GlyphBitmap* LoadGlyph(FX_DWORD charcode,
+  CFX_GlyphBitmap* LoadGlyph(uint32_t charcode,
                              const CFX_Matrix* pMatrix,
                              FX_FLOAT retinaScaleX = 1.0f,
                              FX_FLOAT retinaScaleY = 1.0f);
 
  protected:
   CFX_GlyphBitmap* RenderGlyph(CPDF_Type3Glyphs* pSize,
-                               FX_DWORD charcode,
+                               uint32_t charcode,
                                const CFX_Matrix* pMatrix,
                                FX_FLOAT retinaScaleX = 1.0f,
                                FX_FLOAT retinaScaleY = 1.0f);
@@ -148,7 +148,7 @@
                      FX_BOOL bStdCS = FALSE,
                      CPDF_Type3Char* pType3Char = NULL,
                      FX_ARGB fill_color = 0,
-                     FX_DWORD GroupFamily = 0,
+                     uint32_t GroupFamily = 0,
                      FX_BOOL bLoadMask = FALSE);
   void RenderObjectList(const CPDF_PageObjectHolder* pObjectHolder,
                         const CFX_Matrix* pObj2Device);
@@ -209,7 +209,7 @@
                           int bitmap_alpha,
                           const CFX_Matrix* pImage2Device,
                           CPDF_ImageCacheEntry* pImageCache,
-                          FX_DWORD flags);
+                          uint32_t flags);
   void CompositeDIBitmap(CFX_DIBitmap* pDIBitmap,
                          int left,
                          int top,
@@ -281,7 +281,7 @@
   int m_DitherBits;
   FX_BOOL m_bDropObjects;
   FX_BOOL m_bStdCS;
-  FX_DWORD m_GroupFamily;
+  uint32_t m_GroupFamily;
   FX_BOOL m_bLoadMask;
   CPDF_Type3Char* m_pType3Char;
   FX_ARGB m_T3FillColor;
@@ -302,7 +302,7 @@
                 CPDF_PageRenderCache* pCache,
                 CPDF_ImageLoaderHandle*& LoadHandle,
                 FX_BOOL bStdCS = FALSE,
-                FX_DWORD GroupFamily = 0,
+                uint32_t GroupFamily = 0,
                 FX_BOOL bLoadMask = FALSE,
                 CPDF_RenderStatus* pRenderStatus = NULL,
                 int32_t nDownsampleWidth = 0,
@@ -311,7 +311,7 @@
 
   CFX_DIBSource* m_pBitmap;
   CFX_DIBSource* m_pMask;
-  FX_DWORD m_MatteColor;
+  uint32_t m_MatteColor;
   FX_BOOL m_bCached;
 
  protected:
@@ -327,7 +327,7 @@
                 const CPDF_ImageObject* pImage,
                 CPDF_PageRenderCache* pCache,
                 FX_BOOL bStdCS = FALSE,
-                FX_DWORD GroupFamily = 0,
+                uint32_t GroupFamily = 0,
                 FX_BOOL bLoadMask = FALSE,
                 CPDF_RenderStatus* pRenderStatus = NULL,
                 int32_t nDownsampleWidth = 0,
@@ -360,7 +360,7 @@
                 FX_ARGB bitmap_argb,
                 int bitmap_alpha,
                 const CFX_Matrix* pImage2Device,
-                FX_DWORD flags,
+                uint32_t flags,
                 FX_BOOL bStdCS,
                 int blendType = FXDIB_BLEND_NORMAL);
 
@@ -377,7 +377,7 @@
   FX_BOOL m_bPatternColor;
   CPDF_Pattern* m_pPattern;
   FX_ARGB m_FillArgb;
-  FX_DWORD m_Flags;
+  uint32_t m_Flags;
   CFX_ImageTransformer* m_pTransformer;
   void* m_DeviceHandle;
   CPDF_ImageLoaderHandle* m_LoadHandle;
@@ -447,25 +447,25 @@
   void Reset(const CFX_DIBitmap* pBitmap);
   FX_BOOL GetCachedBitmap(CFX_DIBSource*& pBitmap,
                           CFX_DIBSource*& pMask,
-                          FX_DWORD& MatteColor,
+                          uint32_t& MatteColor,
                           CPDF_Dictionary* pPageResources,
                           FX_BOOL bStdCS = FALSE,
-                          FX_DWORD GroupFamily = 0,
+                          uint32_t GroupFamily = 0,
                           FX_BOOL bLoadMask = FALSE,
                           CPDF_RenderStatus* pRenderStatus = NULL,
                           int32_t downsampleWidth = 0,
                           int32_t downsampleHeight = 0);
-  FX_DWORD EstimateSize() const { return m_dwCacheSize; }
-  FX_DWORD GetTimeCount() const { return m_dwTimeCount; }
+  uint32_t EstimateSize() const { return m_dwCacheSize; }
+  uint32_t GetTimeCount() const { return m_dwTimeCount; }
   CPDF_Stream* GetStream() const { return m_pStream; }
-  void SetTimeCount(FX_DWORD dwTimeCount) { m_dwTimeCount = dwTimeCount; }
+  void SetTimeCount(uint32_t dwTimeCount) { m_dwTimeCount = dwTimeCount; }
   int m_dwTimeCount;
 
  public:
   int StartGetCachedBitmap(CPDF_Dictionary* pFormResources,
                            CPDF_Dictionary* pPageResources,
                            FX_BOOL bStdCS = FALSE,
-                           FX_DWORD GroupFamily = 0,
+                           uint32_t GroupFamily = 0,
                            FX_BOOL bLoadMask = FALSE,
                            CPDF_RenderStatus* pRenderStatus = NULL,
                            int32_t downsampleWidth = 0,
@@ -475,7 +475,7 @@
   CFX_DIBSource* DetachMask();
   CFX_DIBSource* m_pCurBitmap;
   CFX_DIBSource* m_pCurMask;
-  FX_DWORD m_MatteColor;
+  uint32_t m_MatteColor;
   CPDF_RenderStatus* m_pRenderStatus;
 
  protected:
@@ -485,7 +485,7 @@
   CPDF_Stream* m_pStream;
   CFX_DIBSource* m_pCachedBitmap;
   CFX_DIBSource* m_pCachedMask;
-  FX_DWORD m_dwCacheSize;
+  uint32_t m_dwCacheSize;
   void CalcSize();
 };
 typedef struct {
@@ -503,11 +503,11 @@
   FX_BOOL Load(CPDF_Document* pDoc,
                const CPDF_Stream* pStream,
                CPDF_DIBSource** ppMask,
-               FX_DWORD* pMatteColor,
+               uint32_t* pMatteColor,
                CPDF_Dictionary* pFormResources,
                CPDF_Dictionary* pPageResources,
                FX_BOOL bStdCS = FALSE,
-               FX_DWORD GroupFamily = 0,
+               uint32_t GroupFamily = 0,
                FX_BOOL bLoadMask = FALSE);
 
   // CFX_DIBSource
@@ -526,7 +526,7 @@
   CFX_DIBitmap* GetBitmap() const;
   void ReleaseBitmap(CFX_DIBitmap* pBitmap) const;
   void ClearImageData();
-  FX_DWORD GetMatteColor() const { return m_MatteColor; }
+  uint32_t GetMatteColor() const { return m_MatteColor; }
 
   int StartLoadDIBSource(CPDF_Document* pDoc,
                          const CPDF_Stream* pStream,
@@ -534,7 +534,7 @@
                          CPDF_Dictionary* pFormResources,
                          CPDF_Dictionary* pPageResources,
                          FX_BOOL bStdCS = FALSE,
-                         FX_DWORD GroupFamily = 0,
+                         uint32_t GroupFamily = 0,
                          FX_BOOL bLoadMask = FALSE);
   int ContinueLoadDIBSource(IFX_Pause* pPause);
   int StratLoadMask();
@@ -548,7 +548,7 @@
                      const CPDF_Dictionary* pPageResources);
   DIB_COMP_DATA* GetDecodeAndMaskArray(FX_BOOL& bDefaultDecode,
                                        FX_BOOL& bColorKey);
-  CPDF_DIBSource* LoadMask(FX_DWORD& MatteColor);
+  CPDF_DIBSource* LoadMask(uint32_t& MatteColor);
   CPDF_DIBSource* LoadMaskDIB(CPDF_Stream* pMask);
   void LoadJpxBitmap();
   void LoadPalette();
@@ -558,7 +558,7 @@
   void ValidateDictParam();
   void DownSampleScanline1Bit(int orig_Bpp,
                               int dest_Bpp,
-                              FX_DWORD src_width,
+                              uint32_t src_width,
                               const uint8_t* pSrcLine,
                               uint8_t* dest_scan,
                               int dest_width,
@@ -567,7 +567,7 @@
                               int clip_width) const;
   void DownSampleScanline8Bit(int orig_Bpp,
                               int dest_Bpp,
-                              FX_DWORD src_width,
+                              uint32_t src_width,
                               const uint8_t* pSrcLine,
                               uint8_t* dest_scan,
                               int dest_width,
@@ -576,7 +576,7 @@
                               int clip_width) const;
   void DownSampleScanline32Bit(int orig_Bpp,
                                int dest_Bpp,
-                               FX_DWORD src_width,
+                               uint32_t src_width,
                                const uint8_t* pSrcLine,
                                uint8_t* dest_scan,
                                int dest_width,
@@ -590,12 +590,12 @@
   std::unique_ptr<CPDF_StreamAcc> m_pStreamAcc;
   const CPDF_Dictionary* m_pDict;
   CPDF_ColorSpace* m_pColorSpace;
-  FX_DWORD m_Family;
-  FX_DWORD m_bpc;
-  FX_DWORD m_bpc_orig;
-  FX_DWORD m_nComponents;
-  FX_DWORD m_GroupFamily;
-  FX_DWORD m_MatteColor;
+  uint32_t m_Family;
+  uint32_t m_bpc;
+  uint32_t m_bpc_orig;
+  uint32_t m_nComponents;
+  uint32_t m_GroupFamily;
+  uint32_t m_MatteColor;
   FX_BOOL m_bLoadMask;
   FX_BOOL m_bDefaultDecode;
   FX_BOOL m_bImageMask;
diff --git a/core/fpdfdoc/doc_action.cpp b/core/fpdfdoc/doc_action.cpp
index d0deb19..ce37e1e 100644
--- a/core/fpdfdoc/doc_action.cpp
+++ b/core/fpdfdoc/doc_action.cpp
@@ -100,7 +100,7 @@
   }
   return csURI;
 }
-FX_DWORD CPDF_ActionFields::GetFieldsCount() const {
+uint32_t CPDF_ActionFields::GetFieldsCount() const {
   if (!m_pAction) {
     return 0;
   }
@@ -147,8 +147,8 @@
   if (pFields->IsDictionary() || pFields->IsString()) {
     fields.push_back(pFields);
   } else if (CPDF_Array* pArray = pFields->AsArray()) {
-    FX_DWORD iCount = pArray->GetCount();
-    for (FX_DWORD i = 0; i < iCount; ++i) {
+    uint32_t iCount = pArray->GetCount();
+    for (uint32_t i = 0; i < iCount; ++i) {
       CPDF_Object* pObj = pArray->GetElementValue(i);
       if (pObj) {
         fields.push_back(pObj);
@@ -158,7 +158,7 @@
   return fields;
 }
 
-CPDF_Object* CPDF_ActionFields::GetField(FX_DWORD iIndex) const {
+CPDF_Object* CPDF_ActionFields::GetField(uint32_t iIndex) const {
   if (!m_pAction) {
     return NULL;
   }
@@ -232,7 +232,7 @@
   }
   return 0;
 }
-FX_DWORD CPDF_Action::GetSubActionsCount() const {
+uint32_t CPDF_Action::GetSubActionsCount() const {
   if (!m_pDict || !m_pDict->KeyExist("Next"))
     return 0;
 
@@ -245,7 +245,7 @@
     return pArray->GetCount();
   return 0;
 }
-CPDF_Action CPDF_Action::GetSubAction(FX_DWORD iIndex) const {
+CPDF_Action CPDF_Action::GetSubAction(uint32_t iIndex) const {
   if (!m_pDict || !m_pDict->KeyExist("Next")) {
     return CPDF_Action();
   }
diff --git a/core/fpdfdoc/doc_annot.cpp b/core/fpdfdoc/doc_annot.cpp
index 9a40748..e6e441f 100644
--- a/core/fpdfdoc/doc_annot.cpp
+++ b/core/fpdfdoc/doc_annot.cpp
@@ -28,12 +28,12 @@
   CPDF_Dictionary* pAcroForm = pRoot->GetDictBy("AcroForm");
   FX_BOOL bRegenerateAP =
       pAcroForm && pAcroForm->GetBooleanBy("NeedAppearances");
-  for (FX_DWORD i = 0; i < pAnnots->GetCount(); ++i) {
+  for (uint32_t i = 0; i < pAnnots->GetCount(); ++i) {
     CPDF_Dictionary* pDict = ToDictionary(pAnnots->GetElementValue(i));
     if (!pDict)
       continue;
 
-    FX_DWORD dwObjNum = pDict->GetObjNum();
+    uint32_t dwObjNum = pDict->GetObjNum();
     if (dwObjNum == 0) {
       dwObjNum = m_pDocument->AddIndirectObject(pDict);
       CPDF_Reference* pAction = new CPDF_Reference(m_pDocument, dwObjNum);
@@ -67,7 +67,7 @@
     if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget))
       continue;
 
-    FX_DWORD annot_flags = pAnnot->GetFlags();
+    uint32_t annot_flags = pAnnot->GetFlags();
     if (annot_flags & ANNOTFLAG_HIDDEN)
       continue;
 
@@ -110,7 +110,7 @@
                                    CPDF_RenderContext* pContext,
                                    FX_BOOL bPrinting,
                                    CFX_Matrix* pUser2Device,
-                                   FX_DWORD dwAnnotFlags,
+                                   uint32_t dwAnnotFlags,
                                    CPDF_RenderOptions* pOptions,
                                    FX_RECT* pClipRect) {
   if (dwAnnotFlags & 0x01) {
@@ -148,7 +148,7 @@
   rect.Normalize();
 }
 
-FX_DWORD CPDF_Annot::GetFlags() const {
+uint32_t CPDF_Annot::GetFlags() const {
   return m_pAnnotDict->GetIntegerBy("F");
 }
 
@@ -259,7 +259,7 @@
   if (GetSubType() == "Popup") {
     return;
   }
-  FX_DWORD annot_flags = GetFlags();
+  uint32_t annot_flags = GetFlags();
   if (annot_flags & ANNOTFLAG_HIDDEN) {
     return;
   }
@@ -311,7 +311,7 @@
     return;
   }
   CPDF_Array* pColor = m_pAnnotDict->GetArrayBy("C");
-  FX_DWORD argb = 0xff000000;
+  uint32_t argb = 0xff000000;
   if (pColor) {
     int R = (int32_t)(pColor->GetNumberAt(0) * 255);
     int G = (int32_t)(pColor->GetNumberAt(1) * 255);
@@ -322,13 +322,13 @@
   graph_state.m_LineWidth = width;
   if (style_char == 'D') {
     if (pDashArray) {
-      FX_DWORD dash_count = pDashArray->GetCount();
+      uint32_t dash_count = pDashArray->GetCount();
       if (dash_count % 2) {
         dash_count++;
       }
       graph_state.m_DashArray = FX_Alloc(FX_FLOAT, dash_count);
       graph_state.m_DashCount = dash_count;
-      FX_DWORD i;
+      uint32_t i;
       for (i = 0; i < pDashArray->GetCount(); ++i) {
         graph_state.m_DashArray[i] = pDashArray->GetNumberAt(i);
       }
diff --git a/core/fpdfdoc/doc_ap.cpp b/core/fpdfdoc/doc_ap.cpp
index 06e9da8..87edcd9 100644
--- a/core/fpdfdoc/doc_ap.cpp
+++ b/core/fpdfdoc/doc_ap.cpp
@@ -26,7 +26,7 @@
     return FALSE;
   }
   CFX_ByteString field_type = FPDF_GetFieldAttr(pAnnotDict, "FT")->GetString();
-  FX_DWORD flags = FPDF_GetFieldAttr(pAnnotDict, "Ff")
+  uint32_t flags = FPDF_GetFieldAttr(pAnnotDict, "Ff")
                        ? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger()
                        : 0;
   if (field_type == "Tx") {
@@ -141,7 +141,7 @@
                                     uint16_t word,
                                     int32_t nWordStyle) {
   if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
-    FX_DWORD charcode = pPDFFont->CharCodeFromUnicode(word);
+    uint32_t charcode = pPDFFont->CharCodeFromUnicode(word);
     if (charcode != CPDF_Font::kInvalidCharCode) {
       return pPDFFont->GetCharWidthF(charcode);
     }
@@ -204,7 +204,7 @@
         pPDFFont->GetBaseFont().Compare("ZapfDingbats") == 0) {
       sWord.Format("%c", Word);
     } else {
-      FX_DWORD dwCharCode = pPDFFont->CharCodeFromUnicode(Word);
+      uint32_t dwCharCode = pPDFFont->CharCodeFromUnicode(Word);
       if (dwCharCode != CPDF_Font::kInvalidCharCode) {
         pPDFFont->AppendChar(sWord, dwCharCode);
       }
@@ -462,10 +462,10 @@
       int32_t nAlign = FPDF_GetFieldAttr(pAnnotDict, "Q")
                            ? FPDF_GetFieldAttr(pAnnotDict, "Q")->GetInteger()
                            : 0;
-      FX_DWORD dwFlags = FPDF_GetFieldAttr(pAnnotDict, "Ff")
+      uint32_t dwFlags = FPDF_GetFieldAttr(pAnnotDict, "Ff")
                              ? FPDF_GetFieldAttr(pAnnotDict, "Ff")->GetInteger()
                              : 0;
-      FX_DWORD dwMaxLen =
+      uint32_t dwMaxLen =
           FPDF_GetFieldAttr(pAnnotDict, "MaxLen")
               ? FPDF_GetFieldAttr(pAnnotDict, "MaxLen")->GetInteger()
               : 0;
@@ -625,7 +625,7 @@
 
             FX_BOOL bSelected = FALSE;
             if (pSels) {
-              for (FX_DWORD s = 0, ssz = pSels->GetCount(); s < ssz; s++) {
+              for (uint32_t s = 0, ssz = pSels->GetCount(); s < ssz; s++) {
                 if (i == pSels->GetIntegerAt(s)) {
                   bSelected = TRUE;
                   break;
diff --git a/core/fpdfdoc/doc_basic.cpp b/core/fpdfdoc/doc_basic.cpp
index cd2afab..08d07e6 100644
--- a/core/fpdfdoc/doc_basic.cpp
+++ b/core/fpdfdoc/doc_basic.cpp
@@ -31,7 +31,7 @@
     return 0;
   return pDoc->GetPageIndex(pPage->GetObjNum());
 }
-FX_DWORD CPDF_Dest::GetPageObjNum() {
+uint32_t CPDF_Dest::GetPageObjNum() {
   CPDF_Array* pArray = ToArray(m_pObj);
   if (!pArray)
     return 0;
@@ -101,8 +101,8 @@
   }
   CPDF_Array* pNames = pNode->GetArrayBy("Names");
   if (pNames) {
-    FX_DWORD dwCount = pNames->GetCount() / 2;
-    for (FX_DWORD i = 0; i < dwCount; i++) {
+    uint32_t dwCount = pNames->GetCount() / 2;
+    for (uint32_t i = 0; i < dwCount; i++) {
       CFX_ByteString csValue = pNames->GetStringAt(i * 2);
       int32_t iCompare = csValue.Compare(csName);
       if (iCompare <= 0) {
@@ -125,7 +125,7 @@
   if (!pKids) {
     return NULL;
   }
-  for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
+  for (uint32_t i = 0; i < pKids->GetCount(); i++) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid) {
       continue;
@@ -164,7 +164,7 @@
   if (!pKids) {
     return NULL;
   }
-  for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
+  for (uint32_t i = 0; i < pKids->GetCount(); i++) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid) {
       continue;
@@ -190,7 +190,7 @@
     return 0;
   }
   int nCount = 0;
-  for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
+  for (uint32_t i = 0; i < pKids->GetCount(); i++) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid) {
       continue;
diff --git a/core/fpdfdoc/doc_bookmark.cpp b/core/fpdfdoc/doc_bookmark.cpp
index 6acd247..0ad7b5b 100644
--- a/core/fpdfdoc/doc_bookmark.cpp
+++ b/core/fpdfdoc/doc_bookmark.cpp
@@ -32,7 +32,7 @@
   return pNext == bookmark.GetDict() ? CPDF_Bookmark() : CPDF_Bookmark(pNext);
 }
 
-FX_DWORD CPDF_Bookmark::GetColorRef() const {
+uint32_t CPDF_Bookmark::GetColorRef() const {
   if (!m_pDict) {
     return 0;
   }
@@ -45,7 +45,7 @@
   int b = FXSYS_round(pColor->GetNumberAt(2) * 255);
   return FXSYS_RGB(r, g, b);
 }
-FX_DWORD CPDF_Bookmark::GetFontStyle() const {
+uint32_t CPDF_Bookmark::GetFontStyle() const {
   if (!m_pDict) {
     return 0;
   }
diff --git a/core/fpdfdoc/doc_form.cpp b/core/fpdfdoc/doc_form.cpp
index eb70e2b..7642fac 100644
--- a/core/fpdfdoc/doc_form.cpp
+++ b/core/fpdfdoc/doc_form.cpp
@@ -570,8 +570,8 @@
         break;
       }
     }
-    FX_DWORD dwCount = m_pFieldTree->m_Root.CountFields();
-    for (FX_DWORD m = 0; m < dwCount; m++) {
+    uint32_t dwCount = m_pFieldTree->m_Root.CountFields();
+    for (uint32_t m = 0; m < dwCount; m++) {
       CPDF_FormField* pField = m_pFieldTree->m_Root.GetField(m);
       if (!pField) {
         continue;
@@ -669,14 +669,14 @@
   }
   return 0;
 }
-FX_DWORD CPDF_InterForm::CountFields(const CFX_WideString& csFieldName) {
+uint32_t CPDF_InterForm::CountFields(const CFX_WideString& csFieldName) {
   if (csFieldName.IsEmpty()) {
-    return (FX_DWORD)m_pFieldTree->m_Root.CountFields();
+    return (uint32_t)m_pFieldTree->m_Root.CountFields();
   }
   CFieldTree::_Node* pNode = m_pFieldTree->FindNode(csFieldName);
   return pNode ? pNode->CountFields() : 0;
 }
-CPDF_FormField* CPDF_InterForm::GetField(FX_DWORD index,
+CPDF_FormField* CPDF_InterForm::GetField(uint32_t index,
                                          const CFX_WideString& csFieldName) {
   if (csFieldName == L"") {
     return m_pFieldTree->m_Root.GetField(index);
@@ -702,8 +702,8 @@
   if (!pAnnotList)
     return nullptr;
 
-  for (FX_DWORD i = pAnnotList->GetCount(); i > 0; --i) {
-    FX_DWORD annot_index = i - 1;
+  for (uint32_t i = pAnnotList->GetCount(); i > 0; --i) {
+    uint32_t annot_index = i - 1;
     CPDF_Dictionary* pAnnot = pAnnotList->GetDictAt(annot_index);
     if (!pAnnot)
       continue;
@@ -769,7 +769,7 @@
   if (!pArray) {
     return -1;
   }
-  for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+  for (uint32_t i = 0; i < pArray->GetCount(); i++) {
     CPDF_Object* pElement = pArray->GetElementValue(i);
     if (pElement == pField->m_pDict) {
       return i;
@@ -777,10 +777,10 @@
   }
   return -1;
 }
-FX_DWORD CPDF_InterForm::CountFormFonts() {
+uint32_t CPDF_InterForm::CountFormFonts() {
   return CountInterFormFonts(m_pFormDict);
 }
-CPDF_Font* CPDF_InterForm::GetFormFont(FX_DWORD index,
+CPDF_Font* CPDF_InterForm::GetFormFont(uint32_t index,
                                        CFX_ByteString& csNameTag) {
   return GetInterFormFont(m_pFormDict, m_pDocument, index, csNameTag);
 }
@@ -888,7 +888,7 @@
   if (!pFieldDict) {
     return;
   }
-  FX_DWORD dwParentObjNum = pFieldDict->GetObjNum();
+  uint32_t dwParentObjNum = pFieldDict->GetObjNum();
   CPDF_Array* pKids = pFieldDict->GetArrayBy("Kids");
   if (!pKids) {
     AddTerminalField(pFieldDict);
@@ -899,7 +899,7 @@
     return;
   }
   if (pFirstKid->KeyExist("T") || pFirstKid->KeyExist("Kids")) {
-    for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
+    for (uint32_t i = 0; i < pKids->GetCount(); i++) {
       CPDF_Dictionary* pChildDict = pKids->GetDictAt(i);
       if (pChildDict) {
         if (pChildDict->GetObjNum() != dwParentObjNum) {
@@ -982,7 +982,7 @@
       AddControl(pField, pFieldDict);
     }
   } else {
-    for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
+    for (uint32_t i = 0; i < pKids->GetCount(); i++) {
       CPDF_Dictionary* pKid = pKids->GetDictAt(i);
       if (!pKid) {
         continue;
@@ -1022,7 +1022,7 @@
         iType == CPDF_FormField::CheckBox || iType == CPDF_FormField::ListBox) {
       continue;
     }
-    FX_DWORD dwFlags = pField->GetFieldFlags();
+    uint32_t dwFlags = pField->GetFieldFlags();
     // TODO(thestig): Look up these magic numbers and add constants for them.
     if (dwFlags & 0x04)
       continue;
@@ -1078,7 +1078,7 @@
     if (!pField || pField->GetType() == CPDF_FormField::PushButton) {
       continue;
     }
-    FX_DWORD dwFlags = pField->GetFieldFlags();
+    uint32_t dwFlags = pField->GetFieldFlags();
     if (dwFlags & 0x04)
       continue;
 
@@ -1120,7 +1120,7 @@
   name += pFieldDict->GetUnicodeTextBy("T");
   CPDF_Array* pKids = pFieldDict->GetArrayBy("Kids");
   if (pKids) {
-    for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
+    for (uint32_t i = 0; i < pKids->GetCount(); i++) {
       CPDF_Dictionary* pKid = pKids->GetDictAt(i);
       if (!pKid) {
         continue;
@@ -1192,7 +1192,7 @@
       return FALSE;
     }
   }
-  for (FX_DWORD i = 0; i < pFields->GetCount(); i++) {
+  for (uint32_t i = 0; i < pFields->GetCount(); i++) {
     CPDF_Dictionary* pField = pFields->GetDictAt(i);
     if (!pField) {
       continue;
diff --git a/core/fpdfdoc/doc_formcontrol.cpp b/core/fpdfdoc/doc_formcontrol.cpp
index 425c3a1..255b5e9 100644
--- a/core/fpdfdoc/doc_formcontrol.cpp
+++ b/core/fpdfdoc/doc_formcontrol.cpp
@@ -349,7 +349,7 @@
     return 0;
 
   FX_ARGB color = 0;
-  FX_DWORD dwCount = pEntry->GetCount();
+  uint32_t dwCount = pEntry->GetCount();
   if (dwCount == 1) {
     iColorType = COLORTYPE_GRAY;
     FX_FLOAT g = pEntry->GetNumberAt(0) * 255;
@@ -398,7 +398,7 @@
   if (!pEntry) {
     return;
   }
-  FX_DWORD dwCount = pEntry->GetCount();
+  uint32_t dwCount = pEntry->GetCount();
   if (dwCount == 1) {
     iColorType = COLORTYPE_GRAY;
     fc[0] = pEntry->GetNumberAt(0);
diff --git a/core/fpdfdoc/doc_formfield.cpp b/core/fpdfdoc/doc_formfield.cpp
index 6c3afad..88d35d8 100644
--- a/core/fpdfdoc/doc_formfield.cpp
+++ b/core/fpdfdoc/doc_formfield.cpp
@@ -18,7 +18,7 @@
   if (pField->GetType() == CPDF_FormField::CheckBox) {
     bUnison = TRUE;
   } else {
-    FX_DWORD dwFlags = pField->GetFieldFlags();
+    uint32_t dwFlags = pField->GetFieldFlags();
     bUnison = ((dwFlags & 0x2000000) != 0);
   }
   return bUnison;
@@ -36,7 +36,7 @@
   CFX_ByteString type_name = FPDF_GetFieldAttr(m_pDict, "FT")
                                  ? FPDF_GetFieldAttr(m_pDict, "FT")->GetString()
                                  : CFX_ByteString();
-  FX_DWORD flags = FPDF_GetFieldAttr(m_pDict, "Ff")
+  uint32_t flags = FPDF_GetFieldAttr(m_pDict, "Ff")
                        ? FPDF_GetFieldAttr(m_pDict, "Ff")->GetInteger()
                        : 0;
   m_Flags = 0;
@@ -261,7 +261,7 @@
   }
   return pObj->GetUnicodeText();
 }
-FX_DWORD CPDF_FormField::GetFieldFlags() {
+uint32_t CPDF_FormField::GetFieldFlags() {
   CPDF_Object* pObj = FPDF_GetFieldAttr(m_pDict, "Ff");
   if (!pObj) {
     return 0;
@@ -537,7 +537,7 @@
       break;
     }
   }
-  for (FX_DWORD i = 0; i < pArray->GetCount(); i++)
+  for (uint32_t i = 0; i < pArray->GetCount(); i++)
     if (pArray->GetElementValue(i)->GetUnicodeText() == opt_value &&
         (int)i == iPos) {
       return TRUE;
diff --git a/core/fpdfdoc/doc_link.cpp b/core/fpdfdoc/doc_link.cpp
index b1a6a73..3f97024 100644
--- a/core/fpdfdoc/doc_link.cpp
+++ b/core/fpdfdoc/doc_link.cpp
@@ -17,7 +17,7 @@
 
 const std::vector<CPDF_Dictionary*>* CPDF_LinkList::GetPageLinks(
     CPDF_Page* pPage) {
-  FX_DWORD objnum = pPage->m_pFormDict->GetObjNum();
+  uint32_t objnum = pPage->m_pFormDict->GetObjNum();
   if (objnum == 0)
     return nullptr;
 
@@ -63,7 +63,7 @@
   if (!pAnnotList)
     return;
 
-  for (FX_DWORD i = 0; i < pAnnotList->GetCount(); ++i) {
+  for (uint32_t i = 0; i < pAnnotList->GetCount(); ++i) {
     CPDF_Dictionary* pAnnot = pAnnotList->GetDictAt(i);
     bool add_link = (pAnnot && pAnnot->GetStringBy("Subtype") == "Link");
     // Add non-links as nullptrs to preserve z-order.
diff --git a/core/fpdfdoc/doc_ocg.cpp b/core/fpdfdoc/doc_ocg.cpp
index 8148b31..43ccc3f 100644
--- a/core/fpdfdoc/doc_ocg.cpp
+++ b/core/fpdfdoc/doc_ocg.cpp
@@ -14,8 +14,8 @@
     return -1;
 
   if (const CPDF_Array* pArray = pObject->AsArray()) {
-    FX_DWORD dwCount = pArray->GetCount();
-    for (FX_DWORD i = 0; i < dwCount; i++) {
+    uint32_t dwCount = pArray->GetCount();
+    for (uint32_t i = 0; i < dwCount; i++) {
       if (pArray->GetDictAt(i) == pGroupDict)
         return i;
     }
@@ -32,8 +32,8 @@
   }
   CFX_ByteString bsIntent;
   if (CPDF_Array* pArray = pIntent->AsArray()) {
-    FX_DWORD dwCount = pArray->GetCount();
-    for (FX_DWORD i = 0; i < dwCount; i++) {
+    uint32_t dwCount = pArray->GetCount();
+    for (uint32_t i = 0; i < dwCount; i++) {
       bsIntent = pArray->GetStringAt(i);
       if (bsIntent == "All" || bsIntent == csElement)
         return TRUE;
diff --git a/core/fpdfdoc/doc_tagged.cpp b/core/fpdfdoc/doc_tagged.cpp
index 1664aff..8680314 100644
--- a/core/fpdfdoc/doc_tagged.cpp
+++ b/core/fpdfdoc/doc_tagged.cpp
@@ -70,7 +70,7 @@
   if (!pArray)
     return;
 
-  for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+  for (uint32_t i = 0; i < pArray->GetCount(); i++) {
     CPDF_Dictionary* pKid = pArray->GetDictAt(i);
     CPDF_StructElementImpl* pStructElementImpl =
         new CPDF_StructElementImpl(this, nullptr, pKid);
@@ -86,7 +86,7 @@
   if (!pKids)
     return;
 
-  FX_DWORD dwKids = 0;
+  uint32_t dwKids = 0;
   if (pKids->IsDictionary())
     dwKids = 1;
   else if (CPDF_Array* pArray = pKids->AsArray())
@@ -94,7 +94,7 @@
   else
     return;
 
-  FX_DWORD i;
+  uint32_t i;
   m_Kids.SetSize(dwKids);
   for (i = 0; i < dwKids; i++) {
     m_Kids[i] = NULL;
@@ -178,7 +178,7 @@
     }
   }
   if (CPDF_Array* pTopKids = pObj->AsArray()) {
-    FX_DWORD i;
+    uint32_t i;
     FX_BOOL bSave = FALSE;
     for (i = 0; i < pTopKids->GetCount(); i++) {
       CPDF_Reference* pKidRef = ToReference(pTopKids->GetElement(i));
@@ -232,7 +232,7 @@
 }
 void CPDF_StructElementImpl::LoadKids(CPDF_Dictionary* pDict) {
   CPDF_Object* pObj = pDict->GetElement("Pg");
-  FX_DWORD PageObjNum = 0;
+  uint32_t PageObjNum = 0;
   if (CPDF_Reference* pRef = ToReference(pObj))
     PageObjNum = pRef->GetRefObjNum();
 
@@ -242,7 +242,7 @@
 
   if (CPDF_Array* pArray = pKids->AsArray()) {
     m_Kids.SetSize(pArray->GetCount());
-    for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+    for (uint32_t i = 0; i < pArray->GetCount(); i++) {
       CPDF_Object* pKid = pArray->GetElementValue(i);
       LoadKid(PageObjNum, pKid, &m_Kids[i]);
     }
@@ -251,7 +251,7 @@
     LoadKid(PageObjNum, pKids, &m_Kids[0]);
   }
 }
-void CPDF_StructElementImpl::LoadKid(FX_DWORD PageObjNum,
+void CPDF_StructElementImpl::LoadKid(uint32_t PageObjNum,
                                      CPDF_Object* pKidObj,
                                      CPDF_StructKid* pKid) {
   pKid->m_Type = CPDF_StructKid::Invalid;
@@ -324,7 +324,7 @@
   } else if (CPDF_Stream* pStream = pAttrs->AsStream()) {
     pDict = pStream->GetDict();
   } else if (CPDF_Array* pArray = pAttrs->AsArray()) {
-    for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+    for (uint32_t i = 0; i < pArray->GetCount(); i++) {
       CPDF_Object* pElement = pArray->GetElementValue(i);
       pDict = FindAttrDict(pElement, owner, nLevel + 1);
       if (pDict)
@@ -371,7 +371,7 @@
     return nullptr;
 
   if (CPDF_Array* pArray = pC->AsArray()) {
-    for (FX_DWORD i = 0; i < pArray->GetCount(); i++) {
+    for (uint32_t i = 0; i < pArray->GetCount(); i++) {
       CFX_ByteString class_name = pArray->GetStringAt(i);
       CPDF_Dictionary* pClassDict = pClassMap->GetDictBy(class_name);
       if (pClassDict && pClassDict->GetStringBy("O") == owner)
diff --git a/core/fpdfdoc/doc_utils.cpp b/core/fpdfdoc/doc_utils.cpp
index 8659a62..e2e3e13 100644
--- a/core/fpdfdoc/doc_utils.cpp
+++ b/core/fpdfdoc/doc_utils.cpp
@@ -27,8 +27,8 @@
   }
   CPDF_Array* pNumbers = pNode->GetArrayBy("Nums");
   if (pNumbers) {
-    FX_DWORD dwCount = pNumbers->GetCount() / 2;
-    for (FX_DWORD i = 0; i < dwCount; i++) {
+    uint32_t dwCount = pNumbers->GetCount() / 2;
+    for (uint32_t i = 0; i < dwCount; i++) {
       int index = pNumbers->GetIntegerAt(i * 2);
       if (num == index) {
         return pNumbers->GetElementValue(i * 2 + 1);
@@ -43,7 +43,7 @@
   if (!pKids) {
     return NULL;
   }
-  for (FX_DWORD i = 0; i < pKids->GetCount(); i++) {
+  for (uint32_t i = 0; i < pKids->GetCount(); i++) {
     CPDF_Dictionary* pKid = pKids->GetDictAt(i);
     if (!pKid) {
       continue;
@@ -274,7 +274,7 @@
   }
   if (!pFormDict) {
     pFormDict = new CPDF_Dictionary;
-    FX_DWORD dwObjNum = pDocument->AddIndirectObject(pFormDict);
+    uint32_t dwObjNum = pDocument->AddIndirectObject(pFormDict);
     CPDF_Dictionary* pRoot = pDocument->GetRoot();
     pRoot->SetAtReference("AcroForm", pDocument, dwObjNum);
   }
@@ -311,7 +311,7 @@
     pFormDict->SetAtString("DA", csDA);
   }
 }
-FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict) {
+uint32_t CountInterFormFonts(CPDF_Dictionary* pFormDict) {
   if (!pFormDict) {
     return 0;
   }
@@ -323,7 +323,7 @@
   if (!pFonts) {
     return 0;
   }
-  FX_DWORD dwCount = 0;
+  uint32_t dwCount = 0;
   for (const auto& it : *pFonts) {
     CPDF_Object* pObj = it.second;
     if (!pObj) {
@@ -339,7 +339,7 @@
 }
 CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict,
                             CPDF_Document* pDocument,
-                            FX_DWORD index,
+                            uint32_t index,
                             CFX_ByteString& csNameTag) {
   if (!pFormDict) {
     return NULL;
@@ -352,7 +352,7 @@
   if (!pFonts) {
     return NULL;
   }
-  FX_DWORD dwCount = 0;
+  uint32_t dwCount = 0;
   for (const auto& it : *pFonts) {
     const CFX_ByteString& csKey = it.first;
     CPDF_Object* pObj = it.second;
@@ -708,7 +708,7 @@
   }
   CPDF_Array* pA = m_pDict->GetArrayBy("A");
   if (pA) {
-    FX_DWORD dwCount = pA->GetCount();
+    uint32_t dwCount = pA->GetCount();
     if (dwCount > 0) {
       fLeft = pA->GetNumberAt(0);
     }
diff --git a/core/fpdfdoc/doc_utils.h b/core/fpdfdoc/doc_utils.h
index e9a11e0..35b7d2d 100644
--- a/core/fpdfdoc/doc_utils.h
+++ b/core/fpdfdoc/doc_utils.h
@@ -25,10 +25,10 @@
 
 CFX_WideString GetFullName(CPDF_Dictionary* pFieldDict);
 void InitInterFormDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument);
-FX_DWORD CountInterFormFonts(CPDF_Dictionary* pFormDict);
+uint32_t CountInterFormFonts(CPDF_Dictionary* pFormDict);
 CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict,
                             CPDF_Document* pDocument,
-                            FX_DWORD index,
+                            uint32_t index,
                             CFX_ByteString& csNameTag);
 CPDF_Font* GetInterFormFont(CPDF_Dictionary* pFormDict,
                             CPDF_Document* pDocument,
diff --git a/core/fpdfdoc/doc_vt.cpp b/core/fpdfdoc/doc_vt.cpp
index 5ccba85..028a220 100644
--- a/core/fpdfdoc/doc_vt.cpp
+++ b/core/fpdfdoc/doc_vt.cpp
@@ -423,11 +423,11 @@
           (word >= 0xFF41 && word <= 0xFF5A));
 }
 
-static bool IsDigit(FX_DWORD word) {
+static bool IsDigit(uint32_t word) {
   return word >= 0x0030 && word <= 0x0039;
 }
 
-static bool IsCJK(FX_DWORD word) {
+static bool IsCJK(uint32_t word) {
   if ((word >= 0x1100 && word <= 0x11FF) ||
       (word >= 0x2E80 && word <= 0x2FFF) ||
       (word >= 0x3040 && word <= 0x9FBF) ||
@@ -448,7 +448,7 @@
   return word >= 0xFF66 && word <= 0xFF9D;
 }
 
-static bool IsPunctuation(FX_DWORD word) {
+static bool IsPunctuation(uint32_t word) {
   if (word <= 0x007F)
     return !!(special_chars[word] & 0x08);
 
@@ -495,11 +495,11 @@
   return false;
 }
 
-static bool IsConnectiveSymbol(FX_DWORD word) {
+static bool IsConnectiveSymbol(uint32_t word) {
   return word <= 0x007F && (special_chars[word] & 0x20);
 }
 
-static bool IsOpenStylePunctuation(FX_DWORD word) {
+static bool IsOpenStylePunctuation(uint32_t word) {
   if (word <= 0x007F)
     return !!(special_chars[word] & 0x04);
 
diff --git a/core/fpdfdoc/tagged_int.h b/core/fpdfdoc/tagged_int.h
index e930f61..4877069 100644
--- a/core/fpdfdoc/tagged_int.h
+++ b/core/fpdfdoc/tagged_int.h
@@ -82,7 +82,7 @@
                  int subindex = -1) override;
 
   void LoadKids(CPDF_Dictionary* pDict);
-  void LoadKid(FX_DWORD PageObjNum, CPDF_Object* pObj, CPDF_StructKid* pKid);
+  void LoadKid(uint32_t PageObjNum, CPDF_Object* pObj, CPDF_StructKid* pKid);
   CPDF_Object* GetAttr(const CFX_ByteStringC& owner,
                        const CFX_ByteStringC& name,
                        FX_BOOL bInheritable,
diff --git a/core/fpdftext/fpdf_text_int.cpp b/core/fpdftext/fpdf_text_int.cpp
index 34f17fb..349a2cd 100644
--- a/core/fpdftext/fpdf_text_int.cpp
+++ b/core/fpdftext/fpdf_text_int.cpp
@@ -80,7 +80,7 @@
     for (int i = 0; i < nItems; i++) {
       CPDF_TextObjectItem item;
       pTextObj->GetItemInfo(i, &item);
-      if (item.m_CharCode == (FX_DWORD)-1) {
+      if (item.m_CharCode == (uint32_t)-1) {
         FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
         FX_FLOAT kerning = -fontsize_h * item.m_OriginX / 1000;
         baseSpace = std::min(baseSpace, kerning + spacing);
@@ -897,7 +897,7 @@
   }
 }
 
-int CPDF_TextPage::GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const {
+int CPDF_TextPage::GetCharWidth(uint32_t charCode, CPDF_Font* pFont) const {
   if (charCode == -1)
     return 0;
 
@@ -1267,7 +1267,7 @@
   for (int32_t i = 0; i < nItems; i++) {
     CPDF_TextObjectItem item;
     pTextObj->GetItemInfo(i, &item);
-    if (item.m_CharCode == (FX_DWORD)-1) {
+    if (item.m_CharCode == (uint32_t)-1) {
       continue;
     }
     CFX_WideString wstrItem = pFont->UnicodeFromCharCode(item.m_CharCode);
@@ -1393,7 +1393,7 @@
     charinfo.m_OriginX = 0;
     charinfo.m_OriginY = 0;
     pTextObj->GetItemInfo(i, &item);
-    if (item.m_CharCode == (FX_DWORD)-1) {
+    if (item.m_CharCode == (uint32_t)-1) {
       CFX_WideString str = m_TempTextBuf.GetWideString();
       if (str.IsEmpty()) {
         str = m_TextBuf.GetWideString();
@@ -1415,7 +1415,7 @@
     if (spacing && i > 0) {
       int last_width = 0;
       FX_FLOAT fontsize_h = pTextObj->m_TextState.GetFontSizeH();
-      FX_DWORD space_charcode = pFont->CharCodeFromUnicode(' ');
+      uint32_t space_charcode = pFont->CharCodeFromUnicode(' ');
       FX_FLOAT threshold = 0;
       if (space_charcode != -1) {
         threshold = fontsize_h * pFont->GetCharWidthF(space_charcode) / 1000;
@@ -1448,7 +1448,7 @@
                           charinfo.m_OriginX, charinfo.m_OriginY);
         m_TempCharList.push_back(charinfo);
       }
-      if (item.m_CharCode == (FX_DWORD)-1) {
+      if (item.m_CharCode == (uint32_t)-1) {
         continue;
       }
     }
@@ -1861,7 +1861,7 @@
   info.m_CharCode = -1;
   info.m_Flag = FPDFTEXT_CHAR_GENERATED;
   int preWidth = 0;
-  if (preChar->m_pTextObj && preChar->m_CharCode != (FX_DWORD)-1)
+  if (preChar->m_pTextObj && preChar->m_CharCode != (uint32_t)-1)
     preWidth =
         GetCharWidth(preChar->m_CharCode, preChar->m_pTextObj->GetFont());
 
diff --git a/core/fpdftext/fpdf_text_int.h b/core/fpdftext/fpdf_text_int.h
index a4274d7..7acab55 100644
--- a/core/fpdftext/fpdf_text_int.h
+++ b/core/fpdftext/fpdf_text_int.h
@@ -122,7 +122,7 @@
                                 CPDF_PageObjectList::const_iterator ObjPos);
   FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1,
                            CPDF_TextObject* pTextObj2);
-  int GetCharWidth(FX_DWORD charCode, CPDF_Font* pFont) const;
+  int GetCharWidth(uint32_t charCode, CPDF_Font* pFont) const;
   void CloseTempLine();
   void OnPiece(CFX_BidiChar* pBidi, CFX_WideString& str);
   int32_t PreMarkedContent(PDFTEXT_Obj pObj);
diff --git a/core/fxcodec/codec/codec_int.h b/core/fxcodec/codec/codec_int.h
index d19a694..c7bd9fc 100644
--- a/core/fxcodec/codec/codec_int.h
+++ b/core/fxcodec/codec/codec_int.h
@@ -26,15 +26,15 @@
  public:
   // ICodec_BasicModule:
   FX_BOOL RunLengthEncode(const uint8_t* src_buf,
-                          FX_DWORD src_size,
+                          uint32_t src_size,
                           uint8_t*& dest_buf,
-                          FX_DWORD& dest_size) override;
+                          uint32_t& dest_size) override;
   FX_BOOL A85Encode(const uint8_t* src_buf,
-                    FX_DWORD src_size,
+                    uint32_t src_size,
                     uint8_t*& dest_buf,
-                    FX_DWORD& dest_size) override;
+                    uint32_t& dest_size) override;
   ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf,
-                                                 FX_DWORD src_size,
+                                                 uint32_t src_size,
                                                  int width,
                                                  int height,
                                                  int nComps,
@@ -60,7 +60,7 @@
  protected:
   class ImageDataCache {
    public:
-    ImageDataCache(int width, int height, FX_DWORD pitch);
+    ImageDataCache(int width, int height, uint32_t pitch);
     ~ImageDataCache();
 
     bool AllocateCache();
@@ -77,7 +77,7 @@
 
     const int m_Width;
     const int m_Height;
-    const FX_DWORD m_Pitch;
+    const uint32_t m_Pitch;
     int m_nCachedLines;
     std::unique_ptr<uint8_t, FxFreeDeleter> m_Data;
   };
@@ -95,7 +95,7 @@
   int m_OutputHeight;
   int m_nComps;
   int m_bpc;
-  FX_DWORD m_Pitch;
+  uint32_t m_Pitch;
   FX_BOOL m_bColorTransformed;
   int m_NextLine;
   uint8_t* m_pLastScanline;
@@ -106,7 +106,7 @@
  public:
   // ICodec_FaxModule:
   ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf,
-                                        FX_DWORD src_size,
+                                        uint32_t src_size,
                                         int width,
                                         int height,
                                         int K,
@@ -120,13 +120,13 @@
                  int height,
                  int pitch,
                  uint8_t*& dest_buf,
-                 FX_DWORD& dest_size) override;
+                 uint32_t& dest_size) override;
 };
 
 class CCodec_FlateModule : public ICodec_FlateModule {
  public:
   virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf,
-                                                FX_DWORD src_size,
+                                                uint32_t src_size,
                                                 int width,
                                                 int height,
                                                 int nComps,
@@ -135,60 +135,60 @@
                                                 int Colors,
                                                 int BitsPerComponent,
                                                 int Columns);
-  virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW,
+  virtual uint32_t FlateOrLZWDecode(FX_BOOL bLZW,
                                     const uint8_t* src_buf,
-                                    FX_DWORD src_size,
+                                    uint32_t src_size,
                                     FX_BOOL bEarlyChange,
                                     int predictor,
                                     int Colors,
                                     int BitsPerComponent,
                                     int Columns,
-                                    FX_DWORD estimated_size,
+                                    uint32_t estimated_size,
                                     uint8_t*& dest_buf,
-                                    FX_DWORD& dest_size);
+                                    uint32_t& dest_size);
   virtual FX_BOOL Encode(const uint8_t* src_buf,
-                         FX_DWORD src_size,
+                         uint32_t src_size,
                          int predictor,
                          int Colors,
                          int BitsPerComponent,
                          int Columns,
                          uint8_t*& dest_buf,
-                         FX_DWORD& dest_size);
+                         uint32_t& dest_size);
   virtual FX_BOOL Encode(const uint8_t* src_buf,
-                         FX_DWORD src_size,
+                         uint32_t src_size,
                          uint8_t*& dest_buf,
-                         FX_DWORD& dest_size);
+                         uint32_t& dest_size);
 };
 
 class CCodec_JpegModule : public ICodec_JpegModule {
  public:
   CCodec_JpegModule() {}
   ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf,
-                                        FX_DWORD src_size,
+                                        uint32_t src_size,
                                         int width,
                                         int height,
                                         int nComps,
                                         FX_BOOL ColorTransform) override;
   FX_BOOL LoadInfo(const uint8_t* src_buf,
-                   FX_DWORD src_size,
+                   uint32_t src_size,
                    int& width,
                    int& height,
                    int& num_components,
                    int& bits_per_components,
                    FX_BOOL& color_transform,
                    uint8_t** icc_buf_ptr,
-                   FX_DWORD* icc_length) override;
+                   uint32_t* icc_length) override;
   FX_BOOL Encode(const CFX_DIBSource* pSource,
                  uint8_t*& dest_buf,
                  FX_STRSIZE& dest_size,
                  int quality,
                  const uint8_t* icc_buf,
-                 FX_DWORD icc_length) override;
+                 uint32_t icc_length) override;
   void* Start() override;
   void Finish(void* pContext) override;
   void Input(void* pContext,
              const uint8_t* src_buf,
-             FX_DWORD src_size) override;
+             uint32_t src_size) override;
 #ifndef PDF_ENABLE_XFA
   int ReadHeader(void* pContext, int* width, int* height, int* nComps) override;
 #else   // PDF_ENABLE_XFA
@@ -200,7 +200,7 @@
 #endif  // PDF_ENABLE_XFA
   int StartScanline(void* pContext, int down_scale) override;
   FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) override;
-  FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override;
+  uint32_t GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override;
 };
 
 #ifdef PDF_ENABLE_XFA
@@ -213,7 +213,7 @@
   virtual void Finish(void* pContext);
   virtual FX_BOOL Input(void* pContext,
                         const uint8_t* src_buf,
-                        FX_DWORD src_size,
+                        uint32_t src_size,
                         CFX_DIBAttribute* pAttribute);
 
  protected:
@@ -224,8 +224,8 @@
   CCodec_GifModule() { FXSYS_memset(m_szLastError, '\0', 256); }
   virtual void* Start(void* pModule);
   virtual void Finish(void* pContext);
-  virtual FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr);
-  virtual void Input(void* pContext, const uint8_t* src_buf, FX_DWORD src_size);
+  virtual uint32_t GetAvailInput(void* pContext, uint8_t** avail_buf_ptr);
+  virtual void Input(void* pContext, const uint8_t* src_buf, uint32_t src_size);
 
   virtual int32_t ReadHeader(void* pContext,
                              int* width,
@@ -249,17 +249,17 @@
   CCodec_BmpModule() { FXSYS_memset(m_szLastError, 0, sizeof(m_szLastError)); }
   void* Start(void* pModule) override;
   void Finish(void* pContext) override;
-  FX_DWORD GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override;
+  uint32_t GetAvailInput(void* pContext, uint8_t** avail_buf_ptr) override;
   void Input(void* pContext,
              const uint8_t* src_buf,
-             FX_DWORD src_size) override;
+             uint32_t src_size) override;
   int32_t ReadHeader(void* pContext,
                      int32_t* width,
                      int32_t* height,
                      FX_BOOL* tb_flag,
                      int32_t* components,
                      int32_t* pal_num,
-                     FX_DWORD** pal_pp,
+                     uint32_t** pal_pp,
                      CFX_DIBAttribute* pAttribute) override;
   int32_t LoadImage(void* pContext) override;
 
@@ -279,25 +279,25 @@
   void* CreateTransform(ICodec_IccModule::IccParam* pInputParam,
                         ICodec_IccModule::IccParam* pOutputParam,
                         ICodec_IccModule::IccParam* pProofParam = NULL,
-                        FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
-                        FX_DWORD dwFlag = Icc_FLAGS_DEFAULT,
-                        FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
-                        FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING) override;
+                        uint32_t dwIntent = Icc_INTENT_PERCEPTUAL,
+                        uint32_t dwFlag = Icc_FLAGS_DEFAULT,
+                        uint32_t dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
+                        uint32_t dwPrfFlag = Icc_FLAGS_SOFTPROOFING) override;
   void* CreateTransform_sRGB(
       const uint8_t* pProfileData,
-      FX_DWORD dwProfileSize,
-      FX_DWORD& nComponents,
+      uint32_t dwProfileSize,
+      uint32_t& nComponents,
       int32_t intent = 0,
-      FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) override;
+      uint32_t dwSrcFormat = Icc_FORMAT_DEFAULT) override;
   void* CreateTransform_CMYK(
       const uint8_t* pSrcProfileData,
-      FX_DWORD dwSrcProfileSize,
-      FX_DWORD& nSrcComponents,
+      uint32_t dwSrcProfileSize,
+      uint32_t& nSrcComponents,
       const uint8_t* pDstProfileData,
-      FX_DWORD dwDstProfileSize,
+      uint32_t dwDstProfileSize,
       int32_t intent = 0,
-      FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
-      FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT) override;
+      uint32_t dwSrcFormat = Icc_FORMAT_DEFAULT,
+      uint32_t dwDstFormat = Icc_FORMAT_DEFAULT) override;
   void DestroyTransform(void* pTransform) override;
   void Translate(void* pTransform,
                  FX_FLOAT* pSrcValues,
@@ -306,7 +306,7 @@
                          uint8_t* pDest,
                          const uint8_t* pSrc,
                          int pixels) override;
-  void SetComponents(FX_DWORD nComponents) override {
+  void SetComponents(uint32_t nComponents) override {
     m_nComponents = nComponents;
   }
 
@@ -321,7 +321,7 @@
                       Icc_CLASS ic,
                       CFX_BinaryBuf* pTransformKey);
 
-  FX_DWORD m_nComponents;
+  uint32_t m_nComponents;
   std::map<CFX_ByteString, CFX_IccTransformCache*> m_MapTranform;
   std::map<CFX_ByteString, CFX_IccProfileCache*> m_MapProfile;
 };
@@ -333,12 +333,12 @@
 
   // ICodec_JpxModule:
   CJPX_Decoder* CreateDecoder(const uint8_t* src_buf,
-                              FX_DWORD src_size,
+                              uint32_t src_size,
                               CPDF_ColorSpace* cs) override;
   void GetImageInfo(CJPX_Decoder* pDecoder,
-                    FX_DWORD* width,
-                    FX_DWORD* height,
-                    FX_DWORD* components) override;
+                    uint32_t* width,
+                    uint32_t* height,
+                    uint32_t* components) override;
   bool Decode(CJPX_Decoder* pDecoder,
               uint8_t* dest_data,
               int pitch,
@@ -354,10 +354,10 @@
   void GetFrames(void* ctx, int32_t& frames) override;
   FX_BOOL LoadFrameInfo(void* ctx,
                         int32_t frame,
-                        FX_DWORD& width,
-                        FX_DWORD& height,
-                        FX_DWORD& comps,
-                        FX_DWORD& bpc,
+                        uint32_t& width,
+                        uint32_t& height,
+                        uint32_t& comps,
+                        uint32_t& bpc,
                         CFX_DIBAttribute* pAttribute) override;
   FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) override;
   void DestroyDecoder(void* ctx) override;
@@ -372,12 +372,12 @@
   CCodec_Jbig2Context();
   ~CCodec_Jbig2Context() {}
 
-  FX_DWORD m_width;
-  FX_DWORD m_height;
+  uint32_t m_width;
+  uint32_t m_height;
   CPDF_StreamAcc* m_pGlobalStream;
   CPDF_StreamAcc* m_pSrcStream;
   uint8_t* m_dest_buf;
-  FX_DWORD m_dest_pitch;
+  uint32_t m_dest_pitch;
   IFX_Pause* m_pPause;
   CJBig2_Context* m_pContext;
   CJBig2_Image* m_dest_image;
@@ -391,12 +391,12 @@
   void* CreateJbig2Context() override;
   FXCODEC_STATUS StartDecode(void* pJbig2Context,
                              CFX_PrivateData* pPrivateData,
-                             FX_DWORD width,
-                             FX_DWORD height,
+                             uint32_t width,
+                             uint32_t height,
                              CPDF_StreamAcc* src_stream,
                              CPDF_StreamAcc* global_stream,
                              uint8_t* dest_buf,
-                             FX_DWORD dest_pitch,
+                             uint32_t dest_pitch,
                              IFX_Pause* pPause) override;
   FXCODEC_STATUS ContinueDecode(void* pJbig2Context,
                                 IFX_Pause* pPause) override;
diff --git a/core/fxcodec/codec/fx_codec.cpp b/core/fxcodec/codec/fx_codec.cpp
index 92dba69..0952c80 100644
--- a/core/fxcodec/codec/fx_codec.cpp
+++ b/core/fxcodec/codec/fx_codec.cpp
@@ -32,7 +32,7 @@
 
 CCodec_ScanlineDecoder::ImageDataCache::ImageDataCache(int width,
                                                        int height,
-                                                       FX_DWORD pitch)
+                                                       uint32_t pitch)
     : m_Width(width), m_Height(height), m_Pitch(pitch), m_nCachedLines(0) {}
 
 CCodec_ScanlineDecoder::ImageDataCache::~ImageDataCache() {}
@@ -147,9 +147,9 @@
 }
 
 FX_BOOL CCodec_BasicModule::RunLengthEncode(const uint8_t* src_buf,
-                                            FX_DWORD src_size,
+                                            uint32_t src_size,
                                             uint8_t*& dest_buf,
-                                            FX_DWORD& dest_size) {
+                                            uint32_t& dest_size) {
   return FALSE;
 }
 
@@ -256,9 +256,9 @@
 #undef EXPONENT_DETECT
 
 FX_BOOL CCodec_BasicModule::A85Encode(const uint8_t* src_buf,
-                                      FX_DWORD src_size,
+                                      uint32_t src_size,
                                       uint8_t*& dest_buf,
-                                      FX_DWORD& dest_size) {
+                                      uint32_t& dest_size) {
   return FALSE;
 }
 
@@ -287,7 +287,7 @@
   ~CCodec_RLScanlineDecoder() override;
 
   FX_BOOL Create(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  int width,
                  int height,
                  int nComps,
@@ -297,7 +297,7 @@
   void v_DownScale(int dest_width, int dest_height) override {}
   FX_BOOL v_Rewind() override;
   uint8_t* v_GetNextLine() override;
-  FX_DWORD GetSrcOffset() override { return m_SrcOffset; }
+  uint32_t GetSrcOffset() override { return m_SrcOffset; }
 
  protected:
   FX_BOOL CheckDestSize();
@@ -306,9 +306,9 @@
 
   uint8_t* m_pScanline;
   const uint8_t* m_pSrcBuf;
-  FX_DWORD m_SrcSize;
-  FX_DWORD m_dwLineBytes;
-  FX_DWORD m_SrcOffset;
+  uint32_t m_SrcSize;
+  uint32_t m_dwLineBytes;
+  uint32_t m_SrcOffset;
   FX_BOOL m_bEOD;
   uint8_t m_Operator;
 };
@@ -324,9 +324,9 @@
   FX_Free(m_pScanline);
 }
 FX_BOOL CCodec_RLScanlineDecoder::CheckDestSize() {
-  FX_DWORD i = 0;
-  FX_DWORD old_size = 0;
-  FX_DWORD dest_size = 0;
+  uint32_t i = 0;
+  uint32_t old_size = 0;
+  uint32_t dest_size = 0;
   while (i < m_SrcSize) {
     if (m_pSrcBuf[i] < 128) {
       old_size = dest_size;
@@ -346,14 +346,14 @@
       break;
     }
   }
-  if (((FX_DWORD)m_OrigWidth * m_nComps * m_bpc * m_OrigHeight + 7) / 8 >
+  if (((uint32_t)m_OrigWidth * m_nComps * m_bpc * m_OrigHeight + 7) / 8 >
       dest_size) {
     return FALSE;
   }
   return TRUE;
 }
 FX_BOOL CCodec_RLScanlineDecoder::Create(const uint8_t* src_buf,
-                                         FX_DWORD src_size,
+                                         uint32_t src_size,
                                          int width,
                                          int height,
                                          int nComps,
@@ -378,7 +378,7 @@
   }
   m_Pitch = pitch.ValueOrDie();
   // Overflow should already have been checked before this is called.
-  m_dwLineBytes = (static_cast<FX_DWORD>(width) * nComps * bpc + 7) / 8;
+  m_dwLineBytes = (static_cast<uint32_t>(width) * nComps * bpc + 7) / 8;
   m_pScanline = FX_Alloc(uint8_t, m_Pitch);
   return CheckDestSize();
 }
@@ -398,11 +398,11 @@
     }
   }
   FXSYS_memset(m_pScanline, 0, m_Pitch);
-  FX_DWORD col_pos = 0;
+  uint32_t col_pos = 0;
   FX_BOOL eol = FALSE;
   while (m_SrcOffset < m_SrcSize && !eol) {
     if (m_Operator < 128) {
-      FX_DWORD copy_len = m_Operator + 1;
+      uint32_t copy_len = m_Operator + 1;
       if (col_pos + copy_len >= m_dwLineBytes) {
         copy_len = m_dwLineBytes - col_pos;
         eol = TRUE;
@@ -419,7 +419,7 @@
       if (m_SrcOffset - 1 < m_SrcSize - 1) {
         fill = m_pSrcBuf[m_SrcOffset];
       }
-      FX_DWORD duplicate_len = 257 - m_Operator;
+      uint32_t duplicate_len = 257 - m_Operator;
       if (col_pos + duplicate_len >= m_dwLineBytes) {
         duplicate_len = m_dwLineBytes - col_pos;
         eol = TRUE;
@@ -447,7 +447,7 @@
     return;
   }
   if (m_Operator < 128) {
-    FXSYS_assert((FX_DWORD)m_Operator + 1 >= used_bytes);
+    FXSYS_assert((uint32_t)m_Operator + 1 >= used_bytes);
     if (used_bytes == m_Operator + 1) {
       m_SrcOffset += used_bytes;
       GetNextOperator();
@@ -461,7 +461,7 @@
     return;
   }
   uint8_t count = 257 - m_Operator;
-  FXSYS_assert((FX_DWORD)count >= used_bytes);
+  FXSYS_assert((uint32_t)count >= used_bytes);
   if (used_bytes == count) {
     m_SrcOffset++;
     GetNextOperator();
@@ -472,7 +472,7 @@
 }
 ICodec_ScanlineDecoder* CCodec_BasicModule::CreateRunLengthDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     int nComps,
diff --git a/core/fxcodec/codec/fx_codec_bmp.cpp b/core/fxcodec/codec/fx_codec_bmp.cpp
index d2299d6..3138377 100644
--- a/core/fxcodec/codec/fx_codec_bmp.cpp
+++ b/core/fxcodec/codec/fx_codec_bmp.cpp
@@ -37,7 +37,7 @@
   pModule->ReadScanlineCallback(p->child_ptr, row_num, row_buf);
 }
 static FX_BOOL bmp_get_data_position(bmp_decompress_struct_p bmp_ptr,
-                                     FX_DWORD rcd_pos) {
+                                     uint32_t rcd_pos) {
   FXBMP_Context* p = (FXBMP_Context*)bmp_ptr->context_ptr;
   CCodec_BmpModule* pModule = (CCodec_BmpModule*)p->parent_ptr;
   return pModule->InputImagePositionBufCallback(p->child_ptr, rcd_pos);
@@ -81,7 +81,7 @@
                                      FX_BOOL* tb_flag,
                                      int32_t* components,
                                      int32_t* pal_num,
-                                     FX_DWORD** pal_pp,
+                                     uint32_t** pal_pp,
                                      CFX_DIBAttribute* pAttribute) {
   FXBMP_Context* p = (FXBMP_Context*)pContext;
   if (setjmp(p->bmp_ptr->jmpbuf)) {
@@ -112,14 +112,14 @@
   }
   return bmp_decode_image(p->bmp_ptr);
 }
-FX_DWORD CCodec_BmpModule::GetAvailInput(void* pContext,
+uint32_t CCodec_BmpModule::GetAvailInput(void* pContext,
                                          uint8_t** avial_buf_ptr) {
   FXBMP_Context* p = (FXBMP_Context*)pContext;
   return bmp_get_avail_input(p->bmp_ptr, avial_buf_ptr);
 }
 void CCodec_BmpModule::Input(void* pContext,
                              const uint8_t* src_buf,
-                             FX_DWORD src_size) {
+                             uint32_t src_size) {
   FXBMP_Context* p = (FXBMP_Context*)pContext;
   bmp_input_buffer(p->bmp_ptr, (uint8_t*)src_buf, src_size);
 }
diff --git a/core/fxcodec/codec/fx_codec_fax.cpp b/core/fxcodec/codec/fx_codec_fax.cpp
index 13ffcda..0ccebba 100644
--- a/core/fxcodec/codec/fx_codec_fax.cpp
+++ b/core/fxcodec/codec/fx_codec_fax.cpp
@@ -257,7 +257,7 @@
               const uint8_t* src_buf,
               int& bitpos,
               int bitsize) {
-  FX_DWORD code = 0;
+  uint32_t code = 0;
   int ins_off = 0;
   while (1) {
     uint8_t ins = ins_array[ins_off++];
@@ -602,7 +602,7 @@
   ~CCodec_FaxDecoder() override;
 
   FX_BOOL Create(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  int width,
                  int height,
                  int K,
@@ -616,12 +616,12 @@
   void v_DownScale(int dest_width, int dest_height) override {}
   FX_BOOL v_Rewind() override;
   uint8_t* v_GetNextLine() override;
-  FX_DWORD GetSrcOffset() override;
+  uint32_t GetSrcOffset() override;
 
   int m_Encoding, m_bEndOfLine, m_bByteAlign, m_bBlack;
   int bitpos;
   const uint8_t* m_pSrcBuf;
-  FX_DWORD m_SrcSize;
+  uint32_t m_SrcSize;
   uint8_t* m_pScanlineBuf;
   uint8_t* m_pRefBuf;
 };
@@ -635,7 +635,7 @@
   FX_Free(m_pRefBuf);
 }
 FX_BOOL CCodec_FaxDecoder::Create(const uint8_t* src_buf,
-                                  FX_DWORD src_size,
+                                  uint32_t src_size,
                                   int width,
                                   int height,
                                   int K,
@@ -657,7 +657,7 @@
     m_OrigHeight = height;
   }
   // Should not overflow. Checked by FPDFAPI_CreateFaxDecoder.
-  m_Pitch = (static_cast<FX_DWORD>(m_OrigWidth) + 31) / 32 * 4;
+  m_Pitch = (static_cast<uint32_t>(m_OrigWidth) + 31) / 32 * 4;
   m_OutputWidth = m_OrigWidth;
   m_OutputHeight = m_OrigHeight;
   m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch);
@@ -717,14 +717,14 @@
     }
   }
   if (m_bBlack) {
-    for (FX_DWORD i = 0; i < m_Pitch; i++) {
+    for (uint32_t i = 0; i < m_Pitch; i++) {
       m_pScanlineBuf[i] = ~m_pScanlineBuf[i];
     }
   }
   return m_pScanlineBuf;
 }
-FX_DWORD CCodec_FaxDecoder::GetSrcOffset() {
-  FX_DWORD ret = (bitpos + 7) / 8;
+uint32_t CCodec_FaxDecoder::GetSrcOffset() {
+  uint32_t ret = (bitpos + 7) / 8;
   if (ret > m_SrcSize) {
     ret = m_SrcSize;
   }
@@ -732,7 +732,7 @@
 }
 
 void FaxG4Decode(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  int* pbitpos,
                  uint8_t* dest_buf,
                  int width,
@@ -758,7 +758,7 @@
  public:
   CCodec_FaxEncoder(const uint8_t* src_buf, int width, int height, int pitch);
   ~CCodec_FaxEncoder();
-  void Encode(uint8_t*& dest_buf, FX_DWORD& dest_size);
+  void Encode(uint8_t*& dest_buf, uint32_t& dest_size);
   void Encode2DLine(const uint8_t* scan_line);
   CFX_BinaryBuf m_DestBuf;
   uint8_t* m_pRefLine;
@@ -783,7 +783,7 @@
   FX_Free(m_pRefLine);
   FX_Free(m_pLineBuf);
 }
-void CCodec_FaxEncoder::Encode(uint8_t*& dest_buf, FX_DWORD& dest_size) {
+void CCodec_FaxEncoder::Encode(uint8_t*& dest_buf, uint32_t& dest_size) {
   int dest_bitpos = 0;
   uint8_t last_byte = 0;
   for (int i = 0; i < m_Rows; i++) {
@@ -807,14 +807,14 @@
                                  int height,
                                  int pitch,
                                  uint8_t*& dest_buf,
-                                 FX_DWORD& dest_size) {
+                                 uint32_t& dest_size) {
   CCodec_FaxEncoder encoder(src_buf, width, height, pitch);
   encoder.Encode(dest_buf, dest_size);
   return TRUE;
 }
 ICodec_ScanlineDecoder* CCodec_FaxModule::CreateDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     int K,
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index d4ad241..e69c017 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -83,27 +83,27 @@
 class CLZWDecoder {
  public:
   int Decode(uint8_t* output,
-             FX_DWORD& outlen,
+             uint32_t& outlen,
              const uint8_t* input,
-             FX_DWORD& size,
+             uint32_t& size,
              FX_BOOL bEarlyChange);
 
  private:
-  void AddCode(FX_DWORD prefix_code, uint8_t append_char);
-  void DecodeString(FX_DWORD code);
+  void AddCode(uint32_t prefix_code, uint8_t append_char);
+  void DecodeString(uint32_t code);
 
-  FX_DWORD m_InPos;
-  FX_DWORD m_OutPos;
+  uint32_t m_InPos;
+  uint32_t m_OutPos;
   uint8_t* m_pOutput;
   const uint8_t* m_pInput;
   FX_BOOL m_Early;
-  FX_DWORD m_CodeArray[5021];
-  FX_DWORD m_nCodes;
+  uint32_t m_CodeArray[5021];
+  uint32_t m_nCodes;
   uint8_t m_DecodeStack[4000];
-  FX_DWORD m_StackLen;
+  uint32_t m_StackLen;
   int m_CodeLen;
 };
-void CLZWDecoder::AddCode(FX_DWORD prefix_code, uint8_t append_char) {
+void CLZWDecoder::AddCode(uint32_t prefix_code, uint8_t append_char) {
   if (m_nCodes + m_Early == 4094) {
     return;
   }
@@ -116,13 +116,13 @@
     m_CodeLen = 12;
   }
 }
-void CLZWDecoder::DecodeString(FX_DWORD code) {
+void CLZWDecoder::DecodeString(uint32_t code) {
   while (1) {
     int index = code - 258;
     if (index < 0 || index >= (int)m_nCodes) {
       break;
     }
-    FX_DWORD data = m_CodeArray[index];
+    uint32_t data = m_CodeArray[index];
     if (m_StackLen >= sizeof(m_DecodeStack)) {
       return;
     }
@@ -135,9 +135,9 @@
   m_DecodeStack[m_StackLen++] = (uint8_t)code;
 }
 int CLZWDecoder::Decode(uint8_t* dest_buf,
-                        FX_DWORD& dest_size,
+                        uint32_t& dest_size,
                         const uint8_t* src_buf,
-                        FX_DWORD& src_size,
+                        uint32_t& src_size,
                         FX_BOOL bEarlyChange) {
   m_CodeLen = 9;
   m_InPos = 0;
@@ -146,7 +146,7 @@
   m_pOutput = dest_buf;
   m_Early = bEarlyChange ? 1 : 0;
   m_nCodes = 0;
-  FX_DWORD old_code = (FX_DWORD)-1;
+  uint32_t old_code = (uint32_t)-1;
   uint8_t last_char = 0;
   while (1) {
     if (m_InPos + m_CodeLen > src_size * 8) {
@@ -154,7 +154,7 @@
     }
     int byte_pos = m_InPos / 8;
     int bit_pos = m_InPos % 8, bit_left = m_CodeLen;
-    FX_DWORD code = 0;
+    uint32_t code = 0;
     if (bit_pos) {
       bit_left -= 8 - bit_pos;
       code = (m_pInput[byte_pos++] & ((1 << (8 - bit_pos)) - 1)) << bit_left;
@@ -178,18 +178,18 @@
       }
       m_OutPos++;
       last_char = (uint8_t)code;
-      if (old_code != (FX_DWORD)-1) {
+      if (old_code != (uint32_t)-1) {
         AddCode(old_code, last_char);
       }
       old_code = code;
     } else if (code == 256) {
       m_CodeLen = 9;
       m_nCodes = 0;
-      old_code = (FX_DWORD)-1;
+      old_code = (uint32_t)-1;
     } else if (code == 257) {
       break;
     } else {
-      if (old_code == (FX_DWORD)-1) {
+      if (old_code == (uint32_t)-1) {
         return 2;
       }
       m_StackLen = 0;
@@ -205,7 +205,7 @@
         return -5;
       }
       if (m_pOutput) {
-        for (FX_DWORD i = 0; i < m_StackLen; i++) {
+        for (uint32_t i = 0; i < m_StackLen; i++) {
           m_pOutput[m_OutPos + i] = m_DecodeStack[m_StackLen - i - 1];
         }
       }
@@ -243,7 +243,7 @@
 }
 
 FX_BOOL PNG_PredictorEncode(uint8_t*& data_buf,
-                            FX_DWORD& data_size,
+                            uint32_t& data_size,
                             int predictor,
                             int Colors,
                             int BitsPerComponent,
@@ -400,7 +400,7 @@
 }
 
 FX_BOOL PNG_Predictor(uint8_t*& data_buf,
-                      FX_DWORD& data_size,
+                      uint32_t& data_size,
                       int Colors,
                       int BitsPerComponent,
                       int Columns) {
@@ -540,7 +540,7 @@
 }
 
 FX_BOOL TIFF_PredictorEncode(uint8_t*& data_buf,
-                             FX_DWORD& data_size,
+                             uint32_t& data_size,
                              int Colors,
                              int BitsPerComponent,
                              int Columns) {
@@ -561,7 +561,7 @@
 }
 
 void TIFF_PredictLine(uint8_t* dest_buf,
-                      FX_DWORD row_size,
+                      uint32_t row_size,
                       int BitsPerComponent,
                       int Colors,
                       int Columns) {
@@ -586,7 +586,7 @@
   }
   int BytesPerPixel = BitsPerComponent * Colors / 8;
   if (BitsPerComponent == 16) {
-    for (FX_DWORD i = BytesPerPixel; i < row_size; i += 2) {
+    for (uint32_t i = BytesPerPixel; i < row_size; i += 2) {
       uint16_t pixel =
           (dest_buf[i - BytesPerPixel] << 8) | dest_buf[i - BytesPerPixel + 1];
       pixel += (dest_buf[i] << 8) | dest_buf[i + 1];
@@ -594,14 +594,14 @@
       dest_buf[i + 1] = (uint8_t)pixel;
     }
   } else {
-    for (FX_DWORD i = BytesPerPixel; i < row_size; i++) {
+    for (uint32_t i = BytesPerPixel; i < row_size; i++) {
       dest_buf[i] += dest_buf[i - BytesPerPixel];
     }
   }
 }
 
 FX_BOOL TIFF_Predictor(uint8_t*& data_buf,
-                       FX_DWORD& data_size,
+                       uint32_t& data_size,
                        int Colors,
                        int BitsPerComponent,
                        int Columns) {
@@ -621,21 +621,21 @@
 }
 
 void FlateUncompress(const uint8_t* src_buf,
-                     FX_DWORD src_size,
-                     FX_DWORD orig_size,
+                     uint32_t src_size,
+                     uint32_t orig_size,
                      uint8_t*& dest_buf,
-                     FX_DWORD& dest_size,
-                     FX_DWORD& offset) {
-  FX_DWORD guess_size = orig_size ? orig_size : src_size * 2;
-  const FX_DWORD kStepSize = 10240;
-  FX_DWORD alloc_step = orig_size ? kStepSize : std::min(src_size, kStepSize);
-  static const FX_DWORD kMaxInitialAllocSize = 10000000;
+                     uint32_t& dest_size,
+                     uint32_t& offset) {
+  uint32_t guess_size = orig_size ? orig_size : src_size * 2;
+  const uint32_t kStepSize = 10240;
+  uint32_t alloc_step = orig_size ? kStepSize : std::min(src_size, kStepSize);
+  static const uint32_t kMaxInitialAllocSize = 10000000;
   if (guess_size > kMaxInitialAllocSize) {
     guess_size = kMaxInitialAllocSize;
     alloc_step = kMaxInitialAllocSize;
   }
-  FX_DWORD buf_size = guess_size;
-  FX_DWORD last_buf_size = buf_size;
+  uint32_t buf_size = guess_size;
+  uint32_t last_buf_size = buf_size;
 
   dest_buf = nullptr;
   dest_size = 0;
@@ -660,7 +660,7 @@
       if (avail_buf_size != 0)
         break;
 
-      FX_DWORD old_size = guess_size;
+      uint32_t old_size = guess_size;
       guess_size += alloc_step;
       if (guess_size < old_size || guess_size + 1 < guess_size) {
         FPDFAPI_FlateEnd(context);
@@ -715,10 +715,10 @@
       dest_buf = result_tmp_bufs[0];
     } else {
       uint8_t* result_buf = FX_Alloc(uint8_t, dest_size);
-      FX_DWORD result_pos = 0;
+      uint32_t result_pos = 0;
       for (int32_t i = 0; i < result_tmp_bufs.GetSize(); i++) {
         uint8_t* tmp_buf = result_tmp_bufs[i];
-        FX_DWORD tmp_buf_size = buf_size;
+        uint32_t tmp_buf_size = buf_size;
         if (i == result_tmp_bufs.GetSize() - 1) {
           tmp_buf_size = last_buf_size;
         }
@@ -740,7 +740,7 @@
   ~CCodec_FlateScanlineDecoder() override;
 
   void Create(const uint8_t* src_buf,
-              FX_DWORD src_size,
+              uint32_t src_size,
               int width,
               int height,
               int nComps,
@@ -755,11 +755,11 @@
   void v_DownScale(int dest_width, int dest_height) override {}
   FX_BOOL v_Rewind() override;
   uint8_t* v_GetNextLine() override;
-  FX_DWORD GetSrcOffset() override;
+  uint32_t GetSrcOffset() override;
 
   void* m_pFlate;
   const uint8_t* m_SrcBuf;
-  FX_DWORD m_SrcSize;
+  uint32_t m_SrcSize;
   uint8_t* m_pScanline;
   uint8_t* m_pLastLine;
   uint8_t* m_pPredictBuffer;
@@ -768,7 +768,7 @@
   int m_Colors;
   int m_BitsPerComponent;
   int m_Columns;
-  FX_DWORD m_PredictPitch;
+  uint32_t m_PredictPitch;
   size_t m_LeftOver;
 };
 
@@ -790,7 +790,7 @@
   }
 }
 void CCodec_FlateScanlineDecoder::Create(const uint8_t* src_buf,
-                                         FX_DWORD src_size,
+                                         uint32_t src_size,
                                          int width,
                                          int height,
                                          int nComps,
@@ -806,7 +806,7 @@
   m_nComps = nComps;
   m_bpc = bpc;
   m_bColorTransformed = FALSE;
-  m_Pitch = (static_cast<FX_DWORD>(width) * nComps * bpc + 7) / 8;
+  m_Pitch = (static_cast<uint32_t>(width) * nComps * bpc + 7) / 8;
   m_pScanline = FX_Alloc(uint8_t, m_Pitch);
   m_Predictor = 0;
   if (predictor) {
@@ -825,7 +825,7 @@
       m_BitsPerComponent = BitsPerComponent;
       m_Columns = Columns;
       m_PredictPitch =
-          (static_cast<FX_DWORD>(m_BitsPerComponent) * m_Colors * m_Columns +
+          (static_cast<uint32_t>(m_BitsPerComponent) * m_Colors * m_Columns +
            7) /
           8;
       m_pLastLine = FX_Alloc(uint8_t, m_PredictPitch);
@@ -894,13 +894,13 @@
   }
   return m_pScanline;
 }
-FX_DWORD CCodec_FlateScanlineDecoder::GetSrcOffset() {
+uint32_t CCodec_FlateScanlineDecoder::GetSrcOffset() {
   return FPDFAPI_FlateGetTotalIn(m_pFlate);
 }
 
 ICodec_ScanlineDecoder* CCodec_FlateModule::CreateDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     int nComps,
@@ -914,19 +914,19 @@
                    Colors, BitsPerComponent, Columns);
   return pDecoder;
 }
-FX_DWORD CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
+uint32_t CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
                                               const uint8_t* src_buf,
-                                              FX_DWORD src_size,
+                                              uint32_t src_size,
                                               FX_BOOL bEarlyChange,
                                               int predictor,
                                               int Colors,
                                               int BitsPerComponent,
                                               int Columns,
-                                              FX_DWORD estimated_size,
+                                              uint32_t estimated_size,
                                               uint8_t*& dest_buf,
-                                              FX_DWORD& dest_size) {
+                                              uint32_t& dest_size) {
   dest_buf = NULL;
-  FX_DWORD offset = 0;
+  uint32_t offset = 0;
   int predictor_type = 0;
   if (predictor) {
     if (predictor >= 10) {
@@ -938,11 +938,11 @@
   if (bLZW) {
     {
       std::unique_ptr<CLZWDecoder> decoder(new CLZWDecoder);
-      dest_size = (FX_DWORD)-1;
+      dest_size = (uint32_t)-1;
       offset = src_size;
       int err = decoder->Decode(NULL, dest_size, src_buf, offset, bEarlyChange);
       if (err || dest_size == 0 || dest_size + 1 < dest_size) {
-        return static_cast<FX_DWORD>(-1);
+        return static_cast<uint32_t>(-1);
       }
     }
     {
@@ -965,16 +965,16 @@
     ret =
         TIFF_Predictor(dest_buf, dest_size, Colors, BitsPerComponent, Columns);
   }
-  return ret ? offset : static_cast<FX_DWORD>(-1);
+  return ret ? offset : static_cast<uint32_t>(-1);
 }
 FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf,
-                                   FX_DWORD src_size,
+                                   uint32_t src_size,
                                    int predictor,
                                    int Colors,
                                    int BitsPerComponent,
                                    int Columns,
                                    uint8_t*& dest_buf,
-                                   FX_DWORD& dest_size) {
+                                   uint32_t& dest_size) {
   if (predictor != 2 && predictor < 10) {
     return Encode(src_buf, src_size, dest_buf, dest_size);
   }
@@ -995,13 +995,13 @@
   return ret;
 }
 FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf,
-                                   FX_DWORD src_size,
+                                   uint32_t src_size,
                                    uint8_t*& dest_buf,
-                                   FX_DWORD& dest_size) {
+                                   uint32_t& dest_size) {
   dest_size = src_size + src_size / 1000 + 12;
   dest_buf = FX_Alloc(uint8_t, dest_size);
   unsigned long temp_size = dest_size;
   FPDFAPI_FlateCompress(dest_buf, &temp_size, src_buf, src_size);
-  dest_size = (FX_DWORD)temp_size;
+  dest_size = (uint32_t)temp_size;
   return TRUE;
 }
diff --git a/core/fxcodec/codec/fx_codec_gif.cpp b/core/fxcodec/codec/fx_codec_gif.cpp
index 60ca00f..1657d72 100644
--- a/core/fxcodec/codec/fx_codec_gif.cpp
+++ b/core/fxcodec/codec/fx_codec_gif.cpp
@@ -37,7 +37,7 @@
       p->child_ptr, gif_get_frame_num(gif_ptr), pal_size);
 }
 static void gif_record_current_position(gif_decompress_struct_p gif_ptr,
-                                        FX_DWORD* cur_pos_ptr) {
+                                        uint32_t* cur_pos_ptr) {
   FXGIF_Context* p = (FXGIF_Context*)gif_ptr->context_ptr;
   CCodec_GifModule* pModule = (CCodec_GifModule*)p->parent_ptr;
   pModule->RecordCurrentPositionCallback(p->child_ptr, *cur_pos_ptr);
@@ -50,7 +50,7 @@
   pModule->ReadScanlineCallback(p->child_ptr, row_num, row_buf);
 }
 static FX_BOOL gif_get_record_position(gif_decompress_struct_p gif_ptr,
-                                       FX_DWORD cur_pos,
+                                       uint32_t cur_pos,
                                        int32_t left,
                                        int32_t top,
                                        int32_t width,
@@ -155,7 +155,7 @@
       if (p->gif_ptr->cmt_data_ptr) {
         const uint8_t* buf =
             (const uint8_t*)p->gif_ptr->cmt_data_ptr->GetBuffer(0);
-        FX_DWORD len = p->gif_ptr->cmt_data_ptr->GetLength();
+        uint32_t len = p->gif_ptr->cmt_data_ptr->GetLength();
         if (len > 21) {
           uint8_t size = *buf++;
           if (size) {
@@ -174,14 +174,14 @@
   }
   return ret;
 }
-FX_DWORD CCodec_GifModule::GetAvailInput(void* pContext,
+uint32_t CCodec_GifModule::GetAvailInput(void* pContext,
                                          uint8_t** avial_buf_ptr) {
   FXGIF_Context* p = (FXGIF_Context*)pContext;
   return gif_get_avail_input(p->gif_ptr, avial_buf_ptr);
 }
 void CCodec_GifModule::Input(void* pContext,
                              const uint8_t* src_buf,
-                             FX_DWORD src_size) {
+                             uint32_t src_size) {
   FXGIF_Context* p = (FXGIF_Context*)pContext;
   gif_input_buffer(p->gif_ptr, (uint8_t*)src_buf, src_size);
 }
diff --git a/core/fxcodec/codec/fx_codec_icc.cpp b/core/fxcodec/codec/fx_codec_icc.cpp
index fc8113e..13280d7 100644
--- a/core/fxcodec/codec/fx_codec_icc.cpp
+++ b/core/fxcodec/codec/fx_codec_icc.cpp
@@ -8,13 +8,13 @@
 #include "core/include/fxcodec/fx_codec.h"
 #include "third_party/lcms2-2.6/include/lcms2.h"
 
-const FX_DWORD N_COMPONENT_LAB = 3;
-const FX_DWORD N_COMPONENT_GRAY = 1;
-const FX_DWORD N_COMPONENT_RGB = 3;
-const FX_DWORD N_COMPONENT_CMYK = 4;
-const FX_DWORD N_COMPONENT_DEFAULT = 3;
+const uint32_t N_COMPONENT_LAB = 3;
+const uint32_t N_COMPONENT_GRAY = 1;
+const uint32_t N_COMPONENT_RGB = 3;
+const uint32_t N_COMPONENT_CMYK = 4;
+const uint32_t N_COMPONENT_DEFAULT = 3;
 
-FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]) {
+FX_BOOL MD5ComputeID(const void* buf, uint32_t dwSize, uint8_t ID[16]) {
   return cmsMD5computeIDExt(buf, dwSize, ID);
 }
 struct CLcmsCmm {
@@ -67,8 +67,8 @@
   return TRUE;
 }
 
-FX_DWORD GetCSComponents(cmsColorSpaceSignature cs) {
-  FX_DWORD components;
+uint32_t GetCSComponents(cmsColorSpaceSignature cs) {
+  uint32_t components;
   switch (cs) {
     case cmsSigLabData:
       components = N_COMPONENT_LAB;
@@ -90,14 +90,14 @@
 }
 
 void* IccLib_CreateTransform(const unsigned char* pSrcProfileData,
-                             FX_DWORD dwSrcProfileSize,
-                             FX_DWORD& nSrcComponents,
+                             uint32_t dwSrcProfileSize,
+                             uint32_t& nSrcComponents,
                              const unsigned char* pDstProfileData,
-                             FX_DWORD dwDstProfileSize,
+                             uint32_t dwDstProfileSize,
                              int32_t nDstComponents,
                              int intent,
-                             FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
-                             FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT) {
+                             uint32_t dwSrcFormat = Icc_FORMAT_DEFAULT,
+                             uint32_t dwDstFormat = Icc_FORMAT_DEFAULT) {
   cmsHPROFILE srcProfile = NULL;
   cmsHPROFILE dstProfile = NULL;
   cmsHTRANSFORM hTransform = NULL;
@@ -170,10 +170,10 @@
   return pCmm;
 }
 void* IccLib_CreateTransform_sRGB(const unsigned char* pProfileData,
-                                  FX_DWORD dwProfileSize,
-                                  FX_DWORD& nComponents,
+                                  uint32_t dwProfileSize,
+                                  uint32_t& nComponents,
                                   int32_t intent,
-                                  FX_DWORD dwSrcFormat) {
+                                  uint32_t dwSrcFormat) {
   return IccLib_CreateTransform(pProfileData, dwProfileSize, nComponents, NULL,
                                 0, 3, intent, dwSrcFormat);
 }
@@ -185,7 +185,7 @@
   delete (CLcmsCmm*)pTransform;
 }
 void IccLib_Translate(void* pTransform,
-                      FX_DWORD nSrcComponents,
+                      uint32_t nSrcComponents,
                       FX_FLOAT* pSrcValues,
                       FX_FLOAT* pDestValues) {
   if (!pTransform) {
@@ -196,14 +196,14 @@
   if (p->m_bLab) {
     CFX_FixedBufGrow<double, 16> inputs(nSrcComponents);
     double* input = inputs;
-    for (FX_DWORD i = 0; i < nSrcComponents; i++) {
+    for (uint32_t i = 0; i < nSrcComponents; i++) {
       input[i] = pSrcValues[i];
     }
     cmsDoTransform(p->m_hTransform, input, output, 1);
   } else {
     CFX_FixedBufGrow<uint8_t, 16> inputs(nSrcComponents);
     uint8_t* input = inputs;
-    for (FX_DWORD i = 0; i < nSrcComponents; i++) {
+    for (uint32_t i = 0; i < nSrcComponents; i++) {
       if (pSrcValues[i] > 1.0f) {
         input[i] = 255;
       } else if (pSrcValues[i] < 0) {
@@ -284,7 +284,7 @@
 }
 ICodec_IccModule::IccCS CCodec_IccModule::GetProfileCS(
     const uint8_t* pProfileData,
-    FX_DWORD dwProfileSize) {
+    uint32_t dwProfileSize) {
   ICodec_IccModule::IccCS cs;
   cmsHPROFILE hProfile =
       cmsOpenProfileFromMem((void*)pProfileData, dwProfileSize);
@@ -302,14 +302,14 @@
     return IccCS_Unknown;
   }
   ICodec_IccModule::IccCS cs;
-  FX_DWORD dwSize = (FX_DWORD)pFile->GetSize();
+  uint32_t dwSize = (uint32_t)pFile->GetSize();
   uint8_t* pBuf = FX_Alloc(uint8_t, dwSize);
   pFile->ReadBlock(pBuf, 0, dwSize);
   cs = GetProfileCS(pBuf, dwSize);
   FX_Free(pBuf);
   return cs;
 }
-FX_DWORD TransferProfileType(void* pProfile, FX_DWORD dwFormat) {
+uint32_t TransferProfileType(void* pProfile, uint32_t dwFormat) {
   cmsColorSpaceSignature cs = cmsGetColorSpace(pProfile);
   switch (cs) {
     case cmsSigXYZData:
@@ -359,7 +359,7 @@
   CFX_IccProfileCache();
   ~CFX_IccProfileCache();
   void* m_pProfile;
-  FX_DWORD m_dwRate;
+  uint32_t m_dwRate;
 
  protected:
   void Purge();
@@ -379,7 +379,7 @@
   CFX_IccTransformCache(CLcmsCmm* pCmm = NULL);
   ~CFX_IccTransformCache();
   void* m_pIccTransform;
-  FX_DWORD m_dwRate;
+  uint32_t m_dwRate;
   CLcmsCmm* m_pCmm;
 
  protected:
@@ -400,10 +400,10 @@
 class CFX_ByteStringKey : public CFX_BinaryBuf {
  public:
   CFX_ByteStringKey() : CFX_BinaryBuf() {}
-  CFX_ByteStringKey& operator<<(FX_DWORD i);
+  CFX_ByteStringKey& operator<<(uint32_t i);
 };
-CFX_ByteStringKey& CFX_ByteStringKey::operator<<(FX_DWORD i) {
-  AppendBlock(&i, sizeof(FX_DWORD));
+CFX_ByteStringKey& CFX_ByteStringKey::operator<<(uint32_t i) {
+  AppendBlock(&i, sizeof(uint32_t));
   return *this;
 }
 void* CCodec_IccModule::CreateProfile(ICodec_IccModule::IccParam* pIccParam,
@@ -472,10 +472,10 @@
     ICodec_IccModule::IccParam* pInputParam,
     ICodec_IccModule::IccParam* pOutputParam,
     ICodec_IccModule::IccParam* pProofParam,
-    FX_DWORD dwIntent,
-    FX_DWORD dwFlag,
-    FX_DWORD dwPrfIntent,
-    FX_DWORD dwPrfFlag) {
+    uint32_t dwIntent,
+    uint32_t dwFlag,
+    uint32_t dwPrfIntent,
+    uint32_t dwPrfFlag) {
   CLcmsCmm* pCmm = NULL;
   ASSERT(pInputParam && pOutputParam);
   CFX_ByteStringKey key;
@@ -487,9 +487,9 @@
   if (!pOutputProfile) {
     return NULL;
   }
-  FX_DWORD dwInputProfileType =
+  uint32_t dwInputProfileType =
       TransferProfileType(pInputProfile, pInputParam->dwFormat);
-  FX_DWORD dwOutputProfileType =
+  uint32_t dwOutputProfileType =
       TransferProfileType(pOutputProfile, pOutputParam->dwFormat);
   if (dwInputProfileType == 0 || dwOutputProfileType == 0) {
     return NULL;
@@ -537,22 +537,22 @@
   m_MapTranform.clear();
 }
 void* CCodec_IccModule::CreateTransform_sRGB(const uint8_t* pProfileData,
-                                             FX_DWORD dwProfileSize,
-                                             FX_DWORD& nComponents,
+                                             uint32_t dwProfileSize,
+                                             uint32_t& nComponents,
                                              int32_t intent,
-                                             FX_DWORD dwSrcFormat) {
+                                             uint32_t dwSrcFormat) {
   return IccLib_CreateTransform_sRGB(pProfileData, dwProfileSize, nComponents,
                                      intent, dwSrcFormat);
 }
 
 void* CCodec_IccModule::CreateTransform_CMYK(const uint8_t* pSrcProfileData,
-                                             FX_DWORD dwSrcProfileSize,
-                                             FX_DWORD& nSrcComponents,
+                                             uint32_t dwSrcProfileSize,
+                                             uint32_t& nSrcComponents,
                                              const uint8_t* pDstProfileData,
-                                             FX_DWORD dwDstProfileSize,
+                                             uint32_t dwDstProfileSize,
                                              int32_t intent,
-                                             FX_DWORD dwSrcFormat,
-                                             FX_DWORD dwDstFormat) {
+                                             uint32_t dwSrcFormat,
+                                             uint32_t dwDstFormat) {
   return IccLib_CreateTransform(
       pSrcProfileData, dwSrcProfileSize, nSrcComponents, pDstProfileData,
       dwDstProfileSize, 4, intent, dwSrcFormat, dwDstFormat);
diff --git a/core/fxcodec/codec/fx_codec_jbig.cpp b/core/fxcodec/codec/fx_codec_jbig.cpp
index 557d246..ddcec6c 100644
--- a/core/fxcodec/codec/fx_codec_jbig.cpp
+++ b/core/fxcodec/codec/fx_codec_jbig.cpp
@@ -58,12 +58,12 @@
 }
 FXCODEC_STATUS CCodec_Jbig2Module::StartDecode(void* pJbig2Context,
                                                CFX_PrivateData* pPrivateData,
-                                               FX_DWORD width,
-                                               FX_DWORD height,
+                                               uint32_t width,
+                                               uint32_t height,
                                                CPDF_StreamAcc* src_stream,
                                                CPDF_StreamAcc* global_stream,
                                                uint8_t* dest_buf,
-                                               FX_DWORD dest_pitch,
+                                               uint32_t dest_pitch,
                                                IFX_Pause* pPause) {
   if (!pJbig2Context) {
     return FXCODEC_STATUS_ERR_PARAMS;
@@ -95,7 +95,7 @@
       return FXCODEC_STATUS_ERROR;
     }
     int dword_size = height * dest_pitch / 4;
-    FX_DWORD* dword_buf = (FX_DWORD*)dest_buf;
+    uint32_t* dword_buf = (uint32_t*)dest_buf;
     for (int i = 0; i < dword_size; i++) {
       dword_buf[i] = ~dword_buf[i];
     }
@@ -118,7 +118,7 @@
   }
   int dword_size =
       m_pJbig2Context->m_height * m_pJbig2Context->m_dest_pitch / 4;
-  FX_DWORD* dword_buf = (FX_DWORD*)m_pJbig2Context->m_dest_buf;
+  uint32_t* dword_buf = (uint32_t*)m_pJbig2Context->m_dest_buf;
   for (int i = 0; i < dword_size; i++) {
     dword_buf[i] = ~dword_buf[i];
   }
diff --git a/core/fxcodec/codec/fx_codec_jpeg.cpp b/core/fxcodec/codec/fx_codec_jpeg.cpp
index 1b0dff7..a81926e 100644
--- a/core/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/fxcodec/codec/fx_codec_jpeg.cpp
@@ -23,11 +23,11 @@
 }
 
 extern "C" {
-static void _JpegScanSOI(const uint8_t*& src_buf, FX_DWORD& src_size) {
+static void _JpegScanSOI(const uint8_t*& src_buf, uint32_t& src_size) {
   if (src_size == 0) {
     return;
   }
-  FX_DWORD offset = 0;
+  uint32_t offset = 0;
   while (offset < src_size - 1) {
     if (src_buf[offset] == 0xff && src_buf[offset + 1] == 0xd8) {
       src_buf += offset;
@@ -81,16 +81,16 @@
 #define JPEG_OVERHEAD_LEN 14
 static FX_BOOL _JpegEmbedIccProfile(j_compress_ptr cinfo,
                                     const uint8_t* icc_buf_ptr,
-                                    FX_DWORD icc_length) {
+                                    uint32_t icc_length) {
   if (!icc_buf_ptr || icc_length == 0) {
     return FALSE;
   }
-  FX_DWORD icc_segment_size = (JPEG_MARKER_MAXSIZE - 2 - JPEG_OVERHEAD_LEN);
-  FX_DWORD icc_segment_num = (icc_length / icc_segment_size) + 1;
+  uint32_t icc_segment_size = (JPEG_MARKER_MAXSIZE - 2 - JPEG_OVERHEAD_LEN);
+  uint32_t icc_segment_num = (icc_length / icc_segment_size) + 1;
   if (icc_segment_num > 255) {
     return FALSE;
   }
-  FX_DWORD icc_data_length =
+  uint32_t icc_data_length =
       JPEG_OVERHEAD_LEN + (icc_segment_num > 1 ? icc_segment_size : icc_length);
   uint8_t* icc_data = FX_Alloc(uint8_t, icc_data_length);
   FXSYS_memcpy(icc_data, "\x49\x43\x43\x5f\x50\x52\x4f\x46\x49\x4c\x45\x00",
@@ -103,7 +103,7 @@
     jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data, icc_data_length);
   }
   icc_data[12] = (uint8_t)icc_segment_num;
-  FX_DWORD icc_size = (icc_segment_num - 1) * icc_segment_size;
+  uint32_t icc_size = (icc_segment_num - 1) * icc_segment_size;
   FXSYS_memcpy(icc_data + JPEG_OVERHEAD_LEN, icc_buf_ptr + icc_size,
                icc_length - icc_size);
   jpeg_write_marker(cinfo, JPEG_MARKER_ICC, icc_data,
@@ -125,7 +125,7 @@
                         FX_STRSIZE& dest_size,
                         int quality,
                         const uint8_t* icc_buf,
-                        FX_DWORD icc_length) {
+                        uint32_t icc_length) {
   struct jpeg_error_mgr jerr;
   jerr.error_exit = _error_do_nothing;
   jerr.emit_message = _error_do_nothing1;
@@ -138,10 +138,10 @@
   cinfo.err = &jerr;
   jpeg_create_compress(&cinfo);
   int Bpp = pSource->GetBPP() / 8;
-  FX_DWORD nComponents = Bpp >= 3 ? (pSource->IsCmykImage() ? 4 : 3) : 1;
-  FX_DWORD pitch = pSource->GetPitch();
-  FX_DWORD width = pdfium::base::checked_cast<FX_DWORD>(pSource->GetWidth());
-  FX_DWORD height = pdfium::base::checked_cast<FX_DWORD>(pSource->GetHeight());
+  uint32_t nComponents = Bpp >= 3 ? (pSource->IsCmykImage() ? 4 : 3) : 1;
+  uint32_t pitch = pSource->GetPitch();
+  uint32_t width = pdfium::base::checked_cast<uint32_t>(pSource->GetWidth());
+  uint32_t height = pdfium::base::checked_cast<uint32_t>(pSource->GetHeight());
   FX_SAFE_DWORD safe_buf_len = width;
   safe_buf_len *= height;
   safe_buf_len *= nComponents;
@@ -150,7 +150,7 @@
     safe_buf_len += 255 * 18;
     safe_buf_len += icc_length;
   }
-  FX_DWORD dest_buf_length = 0;
+  uint32_t dest_buf_length = 0;
   if (!safe_buf_len.IsValid()) {
     dest_buf = nullptr;
   } else {
@@ -199,7 +199,7 @@
     if (nComponents > 1) {
       uint8_t* dest_scan = line_buf;
       if (nComponents == 3) {
-        for (FX_DWORD i = 0; i < width; i++) {
+        for (uint32_t i = 0; i < width; i++) {
           dest_scan[0] = src_scan[2];
           dest_scan[1] = src_scan[1];
           dest_scan[2] = src_scan[0];
@@ -207,7 +207,7 @@
           src_scan += Bpp;
         }
       } else {
-        for (FX_DWORD i = 0; i < pitch; i++) {
+        for (uint32_t i = 0; i < pitch; i++) {
           *dest_scan++ = ~*src_scan++;
         }
       }
@@ -246,14 +246,14 @@
 #endif  // PDF_ENABLE_XFA
 
 static FX_BOOL _JpegLoadInfo(const uint8_t* src_buf,
-                             FX_DWORD src_size,
+                             uint32_t src_size,
                              int& width,
                              int& height,
                              int& num_components,
                              int& bits_per_components,
                              FX_BOOL& color_transform,
                              uint8_t** icc_buf_ptr,
-                             FX_DWORD* icc_length) {
+                             uint32_t* icc_length) {
   _JpegScanSOI(src_buf, src_size);
   struct jpeg_decompress_struct cinfo;
   struct jpeg_error_mgr jerr;
@@ -313,7 +313,7 @@
   ~CCodec_JpegDecoder() override;
 
   FX_BOOL Create(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  int width,
                  int height,
                  int nComps,
@@ -324,7 +324,7 @@
   void v_DownScale(int dest_width, int dest_height) override;
   FX_BOOL v_Rewind() override;
   uint8_t* v_GetNextLine() override;
-  FX_DWORD GetSrcOffset() override;
+  uint32_t GetSrcOffset() override;
 
   FX_BOOL InitDecode();
 
@@ -333,7 +333,7 @@
   struct jpeg_error_mgr jerr;
   struct jpeg_source_mgr src;
   const uint8_t* m_SrcBuf;
-  FX_DWORD m_SrcSize;
+  uint32_t m_SrcSize;
   uint8_t* m_pScanlineBuf;
 
   FX_BOOL m_bInited;
@@ -341,7 +341,7 @@
   FX_BOOL m_bJpegTransform;
 
  protected:
-  FX_DWORD m_nDefaultScaleDenom;
+  uint32_t m_nDefaultScaleDenom;
 };
 
 CCodec_JpegDecoder::CCodec_JpegDecoder() {
@@ -396,7 +396,7 @@
   return TRUE;
 }
 FX_BOOL CCodec_JpegDecoder::Create(const uint8_t* src_buf,
-                                   FX_DWORD src_size,
+                                   uint32_t src_size,
                                    int width,
                                    int height,
                                    int nComps,
@@ -432,7 +432,7 @@
     return FALSE;
   }
   m_Pitch =
-      (static_cast<FX_DWORD>(cinfo.image_width) * cinfo.num_components + 3) /
+      (static_cast<uint32_t>(cinfo.image_width) * cinfo.num_components + 3) /
       4 * 4;
   m_pScanlineBuf = FX_Alloc(uint8_t, m_Pitch);
   m_nComps = cinfo.num_components;
@@ -467,7 +467,7 @@
       FX_GetDownsampleRatio(m_OrigWidth, m_OrigHeight, dest_width, dest_height);
   m_OutputWidth = (m_OrigWidth + m_DownScale - 1) / m_DownScale;
   m_OutputHeight = (m_OrigHeight + m_DownScale - 1) / m_DownScale;
-  m_Pitch = (static_cast<FX_DWORD>(m_OutputWidth) * m_nComps + 3) / 4 * 4;
+  m_Pitch = (static_cast<uint32_t>(m_OutputWidth) * m_nComps + 3) / 4 * 4;
   if (old_scale != m_DownScale) {
     m_NextLine = -1;
   }
@@ -506,12 +506,12 @@
   }
   return m_pScanlineBuf;
 }
-FX_DWORD CCodec_JpegDecoder::GetSrcOffset() {
-  return (FX_DWORD)(m_SrcSize - src.bytes_in_buffer);
+uint32_t CCodec_JpegDecoder::GetSrcOffset() {
+  return (uint32_t)(m_SrcSize - src.bytes_in_buffer);
 }
 ICodec_ScanlineDecoder* CCodec_JpegModule::CreateDecoder(
     const uint8_t* src_buf,
-    FX_DWORD src_size,
+    uint32_t src_size,
     int width,
     int height,
     int nComps,
@@ -528,14 +528,14 @@
   return pDecoder;
 }
 FX_BOOL CCodec_JpegModule::LoadInfo(const uint8_t* src_buf,
-                                    FX_DWORD src_size,
+                                    uint32_t src_size,
                                     int& width,
                                     int& height,
                                     int& num_components,
                                     int& bits_per_components,
                                     FX_BOOL& color_transform,
                                     uint8_t** icc_buf_ptr,
-                                    FX_DWORD* icc_length) {
+                                    uint32_t* icc_length) {
   return _JpegLoadInfo(src_buf, src_size, width, height, num_components,
                        bits_per_components, color_transform, icc_buf_ptr,
                        icc_length);
@@ -545,7 +545,7 @@
                                   FX_STRSIZE& dest_size,
                                   int quality,
                                   const uint8_t* icc_buf,
-                                  FX_DWORD icc_length) {
+                                  uint32_t icc_length) {
   if (pSource->GetBPP() < 8 || pSource->GetPalette())
     return FALSE;
 
@@ -615,7 +615,7 @@
 }
 void CCodec_JpegModule::Input(void* pContext,
                               const unsigned char* src_buf,
-                              FX_DWORD src_size) {
+                              uint32_t src_size) {
   FXJPEG_Context* p = (FXJPEG_Context*)pContext;
   if (p->m_SkipSize) {
     if (p->m_SkipSize > src_size) {
@@ -679,7 +679,7 @@
   int nlines = jpeg_read_scanlines(&p->m_Info, &dest_buf, 1);
   return nlines == 1;
 }
-FX_DWORD CCodec_JpegModule::GetAvailInput(void* pContext,
+uint32_t CCodec_JpegModule::GetAvailInput(void* pContext,
                                           uint8_t** avail_buf_ptr) {
   if (avail_buf_ptr) {
     *avail_buf_ptr = NULL;
@@ -688,5 +688,5 @@
           (uint8_t*)((FXJPEG_Context*)pContext)->m_SrcMgr.next_input_byte;
     }
   }
-  return (FX_DWORD)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer;
+  return (uint32_t)((FXJPEG_Context*)pContext)->m_SrcMgr.bytes_in_buffer;
 }
diff --git a/core/fxcodec/codec/fx_codec_jpx_opj.cpp b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
index 99eb78f..27b645c 100644
--- a/core/fxcodec/codec/fx_codec_jpx_opj.cpp
+++ b/core/fxcodec/codec/fx_codec_jpx_opj.cpp
@@ -675,15 +675,15 @@
  public:
   explicit CJPX_Decoder(CPDF_ColorSpace* cs);
   ~CJPX_Decoder();
-  FX_BOOL Init(const unsigned char* src_data, FX_DWORD src_size);
-  void GetInfo(FX_DWORD* width, FX_DWORD* height, FX_DWORD* components);
+  FX_BOOL Init(const unsigned char* src_data, uint32_t src_size);
+  void GetInfo(uint32_t* width, uint32_t* height, uint32_t* components);
   bool Decode(uint8_t* dest_buf,
               int pitch,
               const std::vector<uint8_t>& offsets);
 
  private:
   const uint8_t* m_SrcData;
-  FX_DWORD m_SrcSize;
+  uint32_t m_SrcSize;
   opj_image_t* image;
   opj_codec_t* l_codec;
   opj_stream_t* l_stream;
@@ -705,7 +705,7 @@
   }
 }
 
-FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, FX_DWORD src_size) {
+FX_BOOL CJPX_Decoder::Init(const unsigned char* src_data, uint32_t src_size) {
   static const unsigned char szJP2Header[] = {
       0x00, 0x00, 0x00, 0x0c, 0x6a, 0x50, 0x20, 0x20, 0x0d, 0x0a, 0x87, 0x0a};
   if (!src_data || src_size < sizeof(szJP2Header))
@@ -788,12 +788,12 @@
   return TRUE;
 }
 
-void CJPX_Decoder::GetInfo(FX_DWORD* width,
-                           FX_DWORD* height,
-                           FX_DWORD* components) {
-  *width = (FX_DWORD)image->x1;
-  *height = (FX_DWORD)image->y1;
-  *components = (FX_DWORD)image->numcomps;
+void CJPX_Decoder::GetInfo(uint32_t* width,
+                           uint32_t* height,
+                           uint32_t* components) {
+  *width = (uint32_t)image->x1;
+  *height = (uint32_t)image->y1;
+  *components = (uint32_t)image->numcomps;
 }
 
 bool CJPX_Decoder::Decode(uint8_t* dest_buf,
@@ -874,16 +874,16 @@
 CCodec_JpxModule::~CCodec_JpxModule() {}
 
 CJPX_Decoder* CCodec_JpxModule::CreateDecoder(const uint8_t* src_buf,
-                                              FX_DWORD src_size,
+                                              uint32_t src_size,
                                               CPDF_ColorSpace* cs) {
   std::unique_ptr<CJPX_Decoder> decoder(new CJPX_Decoder(cs));
   return decoder->Init(src_buf, src_size) ? decoder.release() : nullptr;
 }
 
 void CCodec_JpxModule::GetImageInfo(CJPX_Decoder* pDecoder,
-                                    FX_DWORD* width,
-                                    FX_DWORD* height,
-                                    FX_DWORD* components) {
+                                    uint32_t* width,
+                                    uint32_t* height,
+                                    uint32_t* components) {
   pDecoder->GetInfo(width, height, components);
 }
 
diff --git a/core/fxcodec/codec/fx_codec_png.cpp b/core/fxcodec/codec/fx_codec_png.cpp
index a3882ba..f862100 100644
--- a/core/fxcodec/codec/fx_codec_png.cpp
+++ b/core/fxcodec/codec/fx_codec_png.cpp
@@ -239,7 +239,7 @@
 }
 FX_BOOL CCodec_PngModule::Input(void* pContext,
                                 const uint8_t* src_buf,
-                                FX_DWORD src_size,
+                                uint32_t src_size,
                                 CFX_DIBAttribute* pAttribute) {
   FXPNG_Context* p = (FXPNG_Context*)pContext;
   if (setjmp(png_jmpbuf(p->png_ptr))) {
diff --git a/core/fxcodec/codec/fx_codec_progress.cpp b/core/fxcodec/codec/fx_codec_progress.cpp
index b22d203..9e113c6 100644
--- a/core/fxcodec/codec/fx_codec_progress.cpp
+++ b/core/fxcodec/codec/fx_codec_progress.cpp
@@ -296,12 +296,12 @@
 FX_BOOL CCodec_ProgressiveDecoder::JpegReadMoreData(
     ICodec_JpegModule* pJpegModule,
     FXCODEC_STATUS& err_status) {
-  FX_DWORD dwSize = (FX_DWORD)m_pFile->GetSize();
+  uint32_t dwSize = (uint32_t)m_pFile->GetSize();
   if (dwSize <= m_offSet) {
     return FALSE;
   }
   dwSize = dwSize - m_offSet;
-  FX_DWORD dwAvail = pJpegModule->GetAvailInput(m_pJpegContext, NULL);
+  uint32_t dwAvail = pJpegModule->GetAvailInput(m_pJpegContext, NULL);
   if (dwAvail == m_SrcSize) {
     if (dwSize > FXCODEC_BLOCK_SIZE) {
       dwSize = FXCODEC_BLOCK_SIZE;
@@ -314,7 +314,7 @@
       return FALSE;
     }
   } else {
-    FX_DWORD dwConsume = m_SrcSize - dwAvail;
+    uint32_t dwConsume = m_SrcSize - dwAvail;
     if (dwAvail) {
       FXSYS_memcpy(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
     }
@@ -417,13 +417,13 @@
           if (pDIBitmap->GetPalette()) {
             return FALSE;
           }
-          FX_DWORD des_g = 0;
+          uint32_t des_g = 0;
           des_g += pPixelWeights->m_Weights[0] * src_scan[src_col];
           des_scan[pPixelWeights->m_SrcStart] = (uint8_t)(des_g >> 16);
         } break;
         case FXDIB_Rgb:
         case FXDIB_Rgb32: {
-          FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+          uint32_t des_b = 0, des_g = 0, des_r = 0;
           const uint8_t* p = src_scan + src_col * src_Bpp;
           des_b += pPixelWeights->m_Weights[0] * (*p++);
           des_g += pPixelWeights->m_Weights[0] * (*p++);
@@ -434,7 +434,7 @@
           *pDes = (uint8_t)((des_r) >> 16);
         } break;
         case FXDIB_Argb: {
-          FX_DWORD des_r = 0, des_g = 0, des_b = 0;
+          uint32_t des_r = 0, des_g = 0, des_b = 0;
           const uint8_t* p = src_scan + src_col * src_Bpp;
           des_b += pPixelWeights->m_Weights[0] * (*p++);
           des_g += pPixelWeights->m_Weights[0] * (*p++);
@@ -476,7 +476,7 @@
         if (pDeviceBitmap->GetPalette()) {
           return;
         }
-        FX_DWORD des_g = 0;
+        uint32_t des_g = 0;
         des_g +=
             pPixelWeights->m_Weights[0] * src_scan[pPixelWeights->m_SrcStart];
         des_g +=
@@ -485,7 +485,7 @@
       } break;
       case FXDIB_Rgb:
       case FXDIB_Rgb32: {
-        FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+        uint32_t des_b = 0, des_g = 0, des_r = 0;
         const uint8_t* p = src_scan;
         p = src_scan + pPixelWeights->m_SrcStart * src_Bpp;
         des_b += pPixelWeights->m_Weights[0] * (*p++);
@@ -501,7 +501,7 @@
         des_scan += des_Bpp - 3;
       } break;
       case FXDIB_Argb: {
-        FX_DWORD des_a = 0, des_b = 0, des_g = 0, des_r = 0;
+        uint32_t des_a = 0, des_b = 0, des_g = 0, des_r = 0;
         const uint8_t* p = src_scan;
         p = src_scan + pPixelWeights->m_SrcStart * src_Bpp;
         des_b += pPixelWeights->m_Weights[0] * (*p++);
@@ -554,12 +554,12 @@
 }
 FX_BOOL CCodec_ProgressiveDecoder::GifReadMoreData(ICodec_GifModule* pGifModule,
                                                    FXCODEC_STATUS& err_status) {
-  FX_DWORD dwSize = (FX_DWORD)m_pFile->GetSize();
+  uint32_t dwSize = (uint32_t)m_pFile->GetSize();
   if (dwSize <= m_offSet) {
     return FALSE;
   }
   dwSize = dwSize - m_offSet;
-  FX_DWORD dwAvail = pGifModule->GetAvailInput(m_pGifContext, NULL);
+  uint32_t dwAvail = pGifModule->GetAvailInput(m_pGifContext, NULL);
   if (dwAvail == m_SrcSize) {
     if (dwSize > FXCODEC_BLOCK_SIZE) {
       dwSize = FXCODEC_BLOCK_SIZE;
@@ -572,7 +572,7 @@
       return FALSE;
     }
   } else {
-    FX_DWORD dwConsume = m_SrcSize - dwAvail;
+    uint32_t dwConsume = m_SrcSize - dwAvail;
     if (dwAvail) {
       FXSYS_memcpy(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
     }
@@ -590,9 +590,9 @@
 }
 void CCodec_ProgressiveDecoder::GifRecordCurrentPositionCallback(
     void* pModule,
-    FX_DWORD& cur_pos) {
+    uint32_t& cur_pos) {
   CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule;
-  FX_DWORD remain_size =
+  uint32_t remain_size =
       pCodec->m_pCodecMgr->GetGifModule()->GetAvailInput(pCodec->m_pGifContext);
   cur_pos = pCodec->m_offSet - remain_size;
 }
@@ -604,7 +604,7 @@
 }
 FX_BOOL CCodec_ProgressiveDecoder::GifInputRecordPositionBufCallback(
     void* pModule,
-    FX_DWORD rcd_pos,
+    uint32_t rcd_pos,
     const FX_RECT& img_rc,
     int32_t pal_num,
     void* pal_ptr,
@@ -637,7 +637,7 @@
   }
   pCodec->m_SrcPaletteNumber = pal_num;
   for (int i = 0; i < pal_num; i++) {
-    FX_DWORD j = i * 3;
+    uint32_t j = i * 3;
     pCodec->m_pSrcPalette[i] =
         ArgbEncode(0xff, pPalette[j], pPalette[j + 1], pPalette[j + 2]);
   }
@@ -738,7 +738,7 @@
     if (scale_y > 1.0) {
       int des_bottom = des_top + pCodec->m_sizeY;
       int des_Bpp = pDIBitmap->GetBPP() >> 3;
-      FX_DWORD des_ScanOffet = pCodec->m_startX * des_Bpp;
+      uint32_t des_ScanOffet = pCodec->m_startX * des_Bpp;
       if (des_row + (int)scale_y >= des_bottom - 1) {
         uint8_t* scan_src =
             (uint8_t*)pDIBitmap->GetScanline(des_row) + des_ScanOffet;
@@ -746,7 +746,7 @@
         while (++cur_row < des_bottom) {
           uint8_t* scan_des =
               (uint8_t*)pDIBitmap->GetScanline(cur_row) + des_ScanOffet;
-          FX_DWORD size = pCodec->m_sizeX * des_Bpp;
+          uint32_t size = pCodec->m_sizeX * des_Bpp;
           FXSYS_memcpy(scan_des, scan_src, size);
         }
       }
@@ -761,7 +761,7 @@
     double scale_y,
     int des_row) {
   int des_Bpp = pDeviceBitmap->GetBPP() >> 3;
-  FX_DWORD des_ScanOffet = m_startX * des_Bpp;
+  uint32_t des_ScanOffet = m_startX * des_Bpp;
   int des_top = m_startY;
   int des_row_1 = des_row - int(2 * scale_y);
   if (des_row_1 < des_top) {
@@ -794,7 +794,7 @@
         } break;
         case FXDIB_Rgb:
         case FXDIB_Rgb32: {
-          FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+          uint32_t des_b = 0, des_g = 0, des_r = 0;
           des_b += pWeight->m_Weights[0] * (*scan_src1++);
           des_g += pWeight->m_Weights[0] * (*scan_src1++);
           des_r += pWeight->m_Weights[0] * (*scan_src1++);
@@ -809,7 +809,7 @@
           scan_des += des_Bpp - 3;
         } break;
         case FXDIB_Argb: {
-          FX_DWORD des_a = 0, des_b = 0, des_g = 0, des_r = 0;
+          uint32_t des_a = 0, des_b = 0, des_g = 0, des_r = 0;
           des_b += pWeight->m_Weights[0] * (*scan_src1++);
           des_g += pWeight->m_Weights[0] * (*scan_src1++);
           des_r += pWeight->m_Weights[0] * (*scan_src1++);
@@ -836,12 +836,12 @@
 }
 FX_BOOL CCodec_ProgressiveDecoder::BmpReadMoreData(ICodec_BmpModule* pBmpModule,
                                                    FXCODEC_STATUS& err_status) {
-  FX_DWORD dwSize = (FX_DWORD)m_pFile->GetSize();
+  uint32_t dwSize = (uint32_t)m_pFile->GetSize();
   if (dwSize <= m_offSet) {
     return FALSE;
   }
   dwSize = dwSize - m_offSet;
-  FX_DWORD dwAvail = pBmpModule->GetAvailInput(m_pBmpContext, NULL);
+  uint32_t dwAvail = pBmpModule->GetAvailInput(m_pBmpContext, NULL);
   if (dwAvail == m_SrcSize) {
     if (dwSize > FXCODEC_BLOCK_SIZE) {
       dwSize = FXCODEC_BLOCK_SIZE;
@@ -854,7 +854,7 @@
       return FALSE;
     }
   } else {
-    FX_DWORD dwConsume = m_SrcSize - dwAvail;
+    uint32_t dwConsume = m_SrcSize - dwAvail;
     if (dwAvail) {
       FXSYS_memcpy(m_pSrcBuf, m_pSrcBuf + dwConsume, dwAvail);
     }
@@ -872,7 +872,7 @@
 }
 FX_BOOL CCodec_ProgressiveDecoder::BmpInputImagePositionBufCallback(
     void* pModule,
-    FX_DWORD rcd_pos) {
+    uint32_t rcd_pos) {
   CCodec_ProgressiveDecoder* pCodec = (CCodec_ProgressiveDecoder*)pModule;
   pCodec->m_offSet = rcd_pos;
   FXCODEC_STATUS error_status = FXCODEC_STATUS_ERROR;
@@ -917,7 +917,7 @@
                                                double scale_y,
                                                int des_row) {
   int des_Bpp = pDeviceBitmap->GetBPP() >> 3;
-  FX_DWORD des_ScanOffet = m_startX * des_Bpp;
+  uint32_t des_ScanOffet = m_startX * des_Bpp;
   int des_top = m_startY;
   int des_bottom = m_startY + m_sizeY;
   int des_row_1 = des_row + int(scale_y);
@@ -927,7 +927,7 @@
     while (++des_row < des_bottom) {
       uint8_t* scan_des =
           (uint8_t*)pDeviceBitmap->GetScanline(des_row) + des_ScanOffet;
-      FX_DWORD size = m_sizeX * des_Bpp;
+      uint32_t size = m_sizeX * des_Bpp;
       FXSYS_memcpy(scan_des, scan_src, size);
     }
     return;
@@ -959,7 +959,7 @@
         } break;
         case FXDIB_Rgb:
         case FXDIB_Rgb32: {
-          FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+          uint32_t des_b = 0, des_g = 0, des_r = 0;
           des_b += pWeight->m_Weights[0] * (*scan_src1++);
           des_g += pWeight->m_Weights[0] * (*scan_src1++);
           des_r += pWeight->m_Weights[0] * (*scan_src1++);
@@ -974,7 +974,7 @@
           scan_des += des_Bpp - 3;
         } break;
         case FXDIB_Argb: {
-          FX_DWORD des_a = 0, des_b = 0, des_g = 0, des_r = 0;
+          uint32_t des_a = 0, des_b = 0, des_g = 0, des_r = 0;
           des_b += pWeight->m_Weights[0] * (*scan_src1++);
           des_g += pWeight->m_Weights[0] * (*scan_src1++);
           des_r += pWeight->m_Weights[0] * (*scan_src1++);
@@ -998,7 +998,7 @@
     FXCODEC_IMAGE_TYPE imageType,
     CFX_DIBAttribute* pAttribute) {
   m_offSet = 0;
-  FX_DWORD size = (FX_DWORD)m_pFile->GetSize();
+  uint32_t size = (uint32_t)m_pFile->GetSize();
   if (size > FXCODEC_BLOCK_SIZE) {
     size = FXCODEC_BLOCK_SIZE;
   }
@@ -1028,7 +1028,7 @@
       }
       m_offSet += size;
       pBmpModule->Input(m_pBmpContext, m_pSrcBuf, size);
-      FX_DWORD* pPalette = NULL;
+      uint32_t* pPalette = NULL;
       int32_t readResult = pBmpModule->ReadHeader(
           m_pBmpContext, &m_SrcWidth, &m_SrcHeight, &m_BmpIsTopBottom,
           &m_SrcComponents, &m_SrcPaletteNumber, &pPalette, pAttribute);
@@ -1049,7 +1049,7 @@
         if (m_SrcPaletteNumber) {
           m_pSrcPalette = FX_Alloc(FX_ARGB, m_SrcPaletteNumber);
           FXSYS_memcpy(m_pSrcPalette, pPalette,
-                       m_SrcPaletteNumber * sizeof(FX_DWORD));
+                       m_SrcPaletteNumber * sizeof(uint32_t));
         } else {
           m_pSrcPalette = nullptr;
         }
@@ -1130,8 +1130,8 @@
       m_offSet += size;
       bResult = pPngModule->Input(m_pPngContext, m_pSrcBuf, size, pAttribute);
       while (bResult) {
-        FX_DWORD remain_size = (FX_DWORD)m_pFile->GetSize() - m_offSet;
-        FX_DWORD input_size =
+        uint32_t remain_size = (uint32_t)m_pFile->GetSize() - m_offSet;
+        uint32_t input_size =
             remain_size > FXCODEC_BLOCK_SIZE ? FXCODEC_BLOCK_SIZE : remain_size;
         if (input_size == 0) {
           if (m_pPngContext) {
@@ -1231,10 +1231,10 @@
       }
       int32_t frames = 0;
       pTiffModule->GetFrames(m_pTiffContext, frames);
-      FX_DWORD bpc;
+      uint32_t bpc;
       FX_BOOL ret = pTiffModule->LoadFrameInfo(
-          m_pTiffContext, 0, (FX_DWORD&)m_SrcWidth, (FX_DWORD&)m_SrcHeight,
-          (FX_DWORD&)m_SrcComponents, bpc, pAttribute);
+          m_pTiffContext, 0, (uint32_t&)m_SrcWidth, (uint32_t&)m_SrcHeight,
+          (uint32_t&)m_SrcComponents, bpc, pAttribute);
       m_SrcComponents = 4;
       m_clipBox = FX_RECT(0, 0, m_SrcWidth, m_SrcHeight);
       if (!ret) {
@@ -1475,7 +1475,7 @@
       case 1:
         return;
       case 2: {
-        FX_DWORD des_g = 0;
+        uint32_t des_g = 0;
         for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd;
              j++) {
           int pixel_weight =
@@ -1499,7 +1499,7 @@
             (uint8_t)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
       } break;
       case 4: {
-        FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+        uint32_t des_b = 0, des_g = 0, des_r = 0;
         for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd;
              j++) {
           int pixel_weight =
@@ -1513,7 +1513,7 @@
             (uint8_t)FXRGB2GRAY((des_r >> 16), (des_g >> 16), (des_b >> 16));
       } break;
       case 5: {
-        FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+        uint32_t des_b = 0, des_g = 0, des_r = 0;
         for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd;
              j++) {
           int pixel_weight =
@@ -1533,7 +1533,7 @@
       case 6:
         return;
       case 7: {
-        FX_DWORD des_g = 0;
+        uint32_t des_g = 0;
         for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd;
              j++) {
           int pixel_weight =
@@ -1594,7 +1594,7 @@
         }
       } break;
       case 9: {
-        FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+        uint32_t des_b = 0, des_g = 0, des_r = 0;
         for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd;
              j++) {
           int pixel_weight =
@@ -1610,7 +1610,7 @@
         des_scan += des_Bpp - 3;
       } break;
       case 10: {
-        FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+        uint32_t des_b = 0, des_g = 0, des_r = 0;
         for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd;
              j++) {
           int pixel_weight =
@@ -1630,7 +1630,7 @@
         des_scan += des_Bpp - 3;
       } break;
       case 11: {
-        FX_DWORD des_alpha = 0, des_r = 0, des_g = 0, des_b = 0;
+        uint32_t des_alpha = 0, des_r = 0, des_g = 0, des_b = 0;
         for (int j = pPixelWeights->m_SrcStart; j <= pPixelWeights->m_SrcEnd;
              j++) {
           int pixel_weight =
@@ -1656,7 +1656,7 @@
                                              double scale_y,
                                              int des_row) {
   int des_Bpp = pDeviceBitmap->GetBPP() >> 3;
-  FX_DWORD des_ScanOffet = m_startX * des_Bpp;
+  uint32_t des_ScanOffet = m_startX * des_Bpp;
   if (m_bInterpol) {
     int des_top = m_startY;
     int des_row_1 = des_row - int(scale_y);
@@ -1668,7 +1668,7 @@
         while (++des_row < des_bottom) {
           uint8_t* scan_des =
               (uint8_t*)pDeviceBitmap->GetScanline(des_row) + des_ScanOffet;
-          FX_DWORD size = m_sizeX * des_Bpp;
+          uint32_t size = m_sizeX * des_Bpp;
           FXSYS_memcpy(scan_des, scan_src, size);
         }
       }
@@ -1702,7 +1702,7 @@
           } break;
           case FXDIB_Rgb:
           case FXDIB_Rgb32: {
-            FX_DWORD des_b = 0, des_g = 0, des_r = 0;
+            uint32_t des_b = 0, des_g = 0, des_r = 0;
             des_b += pWeight->m_Weights[0] * (*scan_src1++);
             des_g += pWeight->m_Weights[0] * (*scan_src1++);
             des_r += pWeight->m_Weights[0] * (*scan_src1++);
@@ -1717,7 +1717,7 @@
             scan_des += des_Bpp - 3;
           } break;
           case FXDIB_Argb: {
-            FX_DWORD des_a = 0, des_b = 0, des_g = 0, des_r = 0;
+            uint32_t des_a = 0, des_b = 0, des_g = 0, des_r = 0;
             des_b += pWeight->m_Weights[0] * (*scan_src1++);
             des_g += pWeight->m_Weights[0] * (*scan_src1++);
             des_r += pWeight->m_Weights[0] * (*scan_src1++);
@@ -1743,7 +1743,7 @@
       while (++des_row < des_bottom) {
         uint8_t* scan_des =
             (uint8_t*)pDeviceBitmap->GetScanline(des_row) + des_ScanOffet;
-        FX_DWORD size = m_sizeX * des_Bpp;
+        uint32_t size = m_sizeX * des_Bpp;
         FXSYS_memcpy(scan_des, scan_src, size);
       }
     }
@@ -1759,7 +1759,7 @@
       }
       uint8_t* scan_des =
           (uint8_t*)pDeviceBitmap->GetScanline(des_row + i) + des_ScanOffet;
-      FX_DWORD size = m_sizeX * des_Bpp;
+      uint32_t size = m_sizeX * des_Bpp;
       FXSYS_memcpy(scan_des, scan_src, size);
     }
   }
@@ -2063,8 +2063,8 @@
     case FXCODEC_IMAGE_PNG: {
       ICodec_PngModule* pPngModule = m_pCodecMgr->GetPngModule();
       while (TRUE) {
-        FX_DWORD remain_size = (FX_DWORD)m_pFile->GetSize() - m_offSet;
-        FX_DWORD input_size =
+        uint32_t remain_size = (uint32_t)m_pFile->GetSize() - m_offSet;
+        uint32_t input_size =
             remain_size > FXCODEC_BLOCK_SIZE ? FXCODEC_BLOCK_SIZE : remain_size;
         if (input_size == 0) {
           if (m_pPngContext) {
diff --git a/core/fxcodec/codec/fx_codec_progress.h b/core/fxcodec/codec/fx_codec_progress.h
index e4335cc..ccd52a9 100644
--- a/core/fxcodec/codec/fx_codec_progress.h
+++ b/core/fxcodec/codec/fx_codec_progress.h
@@ -122,12 +122,12 @@
                                               int pass,
                                               int line);
   static void GifRecordCurrentPositionCallback(void* pModule,
-                                               FX_DWORD& cur_pos);
+                                               uint32_t& cur_pos);
   static uint8_t* GifAskLocalPaletteBufCallback(void* pModule,
                                                 int32_t frame_num,
                                                 int32_t pal_size);
   static FX_BOOL GifInputRecordPositionBufCallback(void* pModule,
-                                                   FX_DWORD rcd_pos,
+                                                   uint32_t rcd_pos,
                                                    const FX_RECT& img_rc,
                                                    int32_t pal_num,
                                                    void* pal_ptr,
@@ -140,7 +140,7 @@
                                       int32_t row_num,
                                       uint8_t* row_buf);
   static FX_BOOL BmpInputImagePositionBufCallback(void* pModule,
-                                                  FX_DWORD rcd_pos);
+                                                  uint32_t rcd_pos);
   static void BmpReadScanlineCallback(void* pModule,
                                       int32_t row_num,
                                       uint8_t* row_buf);
@@ -182,9 +182,9 @@
   void* m_pBmpContext;
   void* m_pTiffContext;
   FXCODEC_IMAGE_TYPE m_imagType;
-  FX_DWORD m_offSet;
+  uint32_t m_offSet;
   uint8_t* m_pSrcBuf;
-  FX_DWORD m_SrcSize;
+  uint32_t m_SrcSize;
   uint8_t* m_pDecodeBuf;
   int m_ScanlineSize;
   CFX_DIBitmap* m_pDeviceBitmap;
diff --git a/core/fxcodec/codec/fx_codec_tiff.cpp b/core/fxcodec/codec/fx_codec_tiff.cpp
index 58f0870..96249f9 100644
--- a/core/fxcodec/codec/fx_codec_tiff.cpp
+++ b/core/fxcodec/codec/fx_codec_tiff.cpp
@@ -16,7 +16,7 @@
                                   unsigned int dwProfileSize,
                                   int nComponents,
                                   int intent,
-                                  FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT);
+                                  uint32_t dwSrcFormat = Icc_FORMAT_DEFAULT);
 void IccLib_TranslateImage(void* pTransform,
                            unsigned char* pDest,
                            const unsigned char* pSrc,
@@ -30,10 +30,10 @@
   FX_BOOL InitDecoder(IFX_FileRead* file_ptr);
   void GetFrames(int32_t& frames);
   FX_BOOL LoadFrameInfo(int32_t frame,
-                        FX_DWORD& width,
-                        FX_DWORD& height,
-                        FX_DWORD& comps,
-                        FX_DWORD& bpc,
+                        uint32_t& width,
+                        uint32_t& height,
+                        uint32_t& comps,
+                        uint32_t& bpc,
                         CFX_DIBAttribute* pAttribute);
   FX_BOOL Decode(CFX_DIBitmap* pDIBitmap);
 
@@ -42,7 +42,7 @@
     IFX_FileStream* out;
   } io;
 
-  FX_DWORD offset;
+  uint32_t offset;
 
   TIFF* tif_ctx;
   void* icc_ctx;
@@ -98,7 +98,7 @@
   if (!ret) {
     return 0;
   }
-  pTiffContext->offset += (FX_DWORD)length;
+  pTiffContext->offset += (uint32_t)length;
   return length;
 }
 static tsize_t _tiff_write(thandle_t context, tdata_t buf, tsize_t length) {
@@ -107,17 +107,17 @@
   if (!pTiffContext->io.out->WriteBlock(buf, pTiffContext->offset, length)) {
     return 0;
   }
-  pTiffContext->offset += (FX_DWORD)length;
+  pTiffContext->offset += (uint32_t)length;
   return length;
 }
 static toff_t _tiff_seek(thandle_t context, toff_t offset, int whence) {
   CCodec_TiffContext* pTiffContext = (CCodec_TiffContext*)context;
   switch (whence) {
     case 0:
-      pTiffContext->offset = (FX_DWORD)offset;
+      pTiffContext->offset = (uint32_t)offset;
       break;
     case 1:
-      pTiffContext->offset += (FX_DWORD)offset;
+      pTiffContext->offset += (uint32_t)offset;
       break;
     case 2:
       if (pTiffContext->isDecoder) {
@@ -125,20 +125,20 @@
           return static_cast<toff_t>(-1);
         }
         pTiffContext->offset =
-            (FX_DWORD)(pTiffContext->io.in->GetSize() - offset);
+            (uint32_t)(pTiffContext->io.in->GetSize() - offset);
       } else {
         if (pTiffContext->io.out->GetSize() < (FX_FILESIZE)offset) {
           return static_cast<toff_t>(-1);
         }
         pTiffContext->offset =
-            (FX_DWORD)(pTiffContext->io.out->GetSize() - offset);
+            (uint32_t)(pTiffContext->io.out->GetSize() - offset);
       }
       break;
     default:
       return static_cast<toff_t>(-1);
   }
   ASSERT(pTiffContext->isDecoder ? (pTiffContext->offset <=
-                                    (FX_DWORD)pTiffContext->io.in->GetSize())
+                                    (uint32_t)pTiffContext->io.in->GetSize())
                                  : TRUE);
   return pTiffContext->offset;
 }
@@ -234,7 +234,7 @@
   (key) = NULL;
 #define TIFF_EXIF_GETSTRINGINFO(key, tag)    \
   {                                          \
-    FX_DWORD size = 0;                       \
+    uint32_t size = 0;                       \
     uint8_t* buf = NULL;                     \
     TIFFGetField(tif_ctx, tag, &size, &buf); \
     if (size && buf) {                       \
@@ -277,20 +277,20 @@
 }  // namespace
 
 FX_BOOL CCodec_TiffContext::LoadFrameInfo(int32_t frame,
-                                          FX_DWORD& width,
-                                          FX_DWORD& height,
-                                          FX_DWORD& comps,
-                                          FX_DWORD& bpc,
+                                          uint32_t& width,
+                                          uint32_t& height,
+                                          uint32_t& comps,
+                                          uint32_t& bpc,
                                           CFX_DIBAttribute* pAttribute) {
   if (!TIFFSetDirectory(tif_ctx, (uint16)frame)) {
     return FALSE;
   }
   uint16_t tif_cs;
-  FX_DWORD tif_icc_size = 0;
+  uint32_t tif_icc_size = 0;
   uint8_t* tif_icc_buf = NULL;
   uint16_t tif_bpc = 0;
   uint16_t tif_cps;
-  FX_DWORD tif_rps;
+  uint32_t tif_rps;
   width = height = comps = 0;
   TIFFGetField(tif_ctx, TIFFTAG_IMAGEWIDTH, &width);
   TIFFGetField(tif_ctx, TIFFTAG_IMAGELENGTH, &height);
@@ -379,10 +379,10 @@
   }
   int32_t len = 1 << bps;
   for (int32_t index = 0; index < len; index++) {
-    FX_DWORD r = red_orig[index] & 0xFF;
-    FX_DWORD g = green_orig[index] & 0xFF;
-    FX_DWORD b = blue_orig[index] & 0xFF;
-    FX_DWORD color = (uint32_t)b | ((uint32_t)g << 8) | ((uint32_t)r << 16) |
+    uint32_t r = red_orig[index] & 0xFF;
+    uint32_t g = green_orig[index] & 0xFF;
+    uint32_t b = blue_orig[index] & 0xFF;
+    uint32_t color = (uint32_t)b | ((uint32_t)g << 8) | ((uint32_t)r << 16) |
                      (((uint32)0xffL) << 24);
     pDIBitmap->SetPaletteEntry(index, color);
   }
@@ -404,7 +404,7 @@
     return FALSE;
   }
   uint8_t* bitMapbuffer = (uint8_t*)pDIBitmap->GetBuffer();
-  FX_DWORD pitch = pDIBitmap->GetPitch();
+  uint32_t pitch = pDIBitmap->GetPitch();
   for (int32_t row = 0; row < height; row++) {
     TIFFReadScanline(tif_ctx, buf, row, 0);
     for (int32_t j = 0; j < size; j++) {
@@ -431,7 +431,7 @@
     return FALSE;
   }
   uint8_t* bitMapbuffer = (uint8_t*)pDIBitmap->GetBuffer();
-  FX_DWORD pitch = pDIBitmap->GetPitch();
+  uint32_t pitch = pDIBitmap->GetPitch();
   for (int32_t row = 0; row < height; row++) {
     TIFFReadScanline(tif_ctx, buf, row, 0);
     for (int32_t j = 0; j < size; j++) {
@@ -464,7 +464,7 @@
     return FALSE;
   }
   uint8_t* bitMapbuffer = (uint8_t*)pDIBitmap->GetBuffer();
-  FX_DWORD pitch = pDIBitmap->GetPitch();
+  uint32_t pitch = pDIBitmap->GetPitch();
   for (int32_t row = 0; row < height; row++) {
     TIFFReadScanline(tif_ctx, buf, row, 0);
     for (int32_t j = 0; j < size - 2; j += 3) {
@@ -477,10 +477,10 @@
   return TRUE;
 }
 FX_BOOL CCodec_TiffContext::Decode(CFX_DIBitmap* pDIBitmap) {
-  FX_DWORD img_wid = pDIBitmap->GetWidth();
-  FX_DWORD img_hei = pDIBitmap->GetHeight();
-  FX_DWORD width = 0;
-  FX_DWORD height = 0;
+  uint32_t img_wid = pDIBitmap->GetWidth();
+  uint32_t img_hei = pDIBitmap->GetHeight();
+  uint32_t width = 0;
+  uint32_t height = 0;
   TIFFGetField(tif_ctx, TIFFTAG_IMAGEWIDTH, &width);
   TIFFGetField(tif_ctx, TIFFTAG_IMAGELENGTH, &height);
   if (img_wid != width || img_hei != height) {
@@ -492,7 +492,7 @@
     if (TIFFReadRGBAImageOriented(tif_ctx, img_wid, img_hei,
                                   (uint32*)pDIBitmap->GetBuffer(), rotation,
                                   1)) {
-      for (FX_DWORD row = 0; row < img_hei; row++) {
+      for (uint32_t row = 0; row < img_hei; row++) {
         uint8_t* row_buf = (uint8_t*)pDIBitmap->GetScanline(row);
         _TiffBGRA2RGBA(row_buf, img_wid, 4);
       }
@@ -502,7 +502,7 @@
   uint16_t spp, bps;
   TIFFGetField(tif_ctx, TIFFTAG_SAMPLESPERPIXEL, &spp);
   TIFFGetField(tif_ctx, TIFFTAG_BITSPERSAMPLE, &bps);
-  FX_DWORD bpp = bps * spp;
+  uint32_t bpp = bps * spp;
   if (bpp == 1) {
     return Decode1bppRGB(pDIBitmap, height, width, bps, spp);
   } else if (bpp <= 8) {
@@ -526,10 +526,10 @@
 }
 FX_BOOL CCodec_TiffModule::LoadFrameInfo(void* ctx,
                                          int32_t frame,
-                                         FX_DWORD& width,
-                                         FX_DWORD& height,
-                                         FX_DWORD& comps,
-                                         FX_DWORD& bpc,
+                                         uint32_t& width,
+                                         uint32_t& height,
+                                         uint32_t& comps,
+                                         uint32_t& bpc,
                                          CFX_DIBAttribute* pAttribute) {
   CCodec_TiffContext* pDecoder = (CCodec_TiffContext*)ctx;
   return pDecoder->LoadFrameInfo(frame, width, height, comps, bpc, pAttribute);
diff --git a/core/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp b/core/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp
index 720b96e..6be9094 100644
--- a/core/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp
+++ b/core/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp
@@ -81,7 +81,7 @@
 CJBig2_ArithIaidDecoder::~CJBig2_ArithIaidDecoder() {}
 
 void CJBig2_ArithIaidDecoder::decode(CJBig2_ArithDecoder* pArithDecoder,
-                                     FX_DWORD* nResult) {
+                                     uint32_t* nResult) {
   int PREV = 1;
   for (unsigned char i = 0; i < SBSYMCODELEN; ++i) {
     JBig2ArithCtx* pCX = &m_IAID[PREV];
diff --git a/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h b/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h
index 50327cc..f1eb68d 100644
--- a/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h
+++ b/core/fxcodec/jbig2/JBig2_ArithIntDecoder.h
@@ -30,7 +30,7 @@
   explicit CJBig2_ArithIaidDecoder(unsigned char SBSYMCODELENA);
   ~CJBig2_ArithIaidDecoder();
 
-  void decode(CJBig2_ArithDecoder* pArithDecoder, FX_DWORD* nResult);
+  void decode(CJBig2_ArithDecoder* pArithDecoder, uint32_t* nResult);
 
  private:
   std::vector<JBig2ArithCtx> m_IAID;
diff --git a/core/fxcodec/jbig2/JBig2_BitStream.cpp b/core/fxcodec/jbig2/JBig2_BitStream.cpp
index 4ca4be1..ddf092d 100644
--- a/core/fxcodec/jbig2/JBig2_BitStream.cpp
+++ b/core/fxcodec/jbig2/JBig2_BitStream.cpp
@@ -26,8 +26,8 @@
 
 CJBig2_BitStream::~CJBig2_BitStream() {}
 
-int32_t CJBig2_BitStream::readNBits(FX_DWORD dwBits, FX_DWORD* dwResult) {
-  FX_DWORD dwBitPos = getBitPos();
+int32_t CJBig2_BitStream::readNBits(uint32_t dwBits, uint32_t* dwResult) {
+  uint32_t dwBitPos = getBitPos();
   if (dwBitPos > LengthInBits())
     return -1;
 
@@ -45,8 +45,8 @@
   return 0;
 }
 
-int32_t CJBig2_BitStream::readNBits(FX_DWORD dwBits, int32_t* nResult) {
-  FX_DWORD dwBitPos = getBitPos();
+int32_t CJBig2_BitStream::readNBits(uint32_t dwBits, int32_t* nResult) {
+  uint32_t dwBitPos = getBitPos();
   if (dwBitPos > LengthInBits())
     return -1;
 
@@ -64,7 +64,7 @@
   return 0;
 }
 
-int32_t CJBig2_BitStream::read1Bit(FX_DWORD* dwResult) {
+int32_t CJBig2_BitStream::read1Bit(uint32_t* dwResult) {
   if (!IsInBound())
     return -1;
 
@@ -91,7 +91,7 @@
   return 0;
 }
 
-int32_t CJBig2_BitStream::readInteger(FX_DWORD* dwResult) {
+int32_t CJBig2_BitStream::readInteger(uint32_t* dwResult) {
   if (m_dwByteIdx + 3 >= m_dwLength)
     return -1;
 
@@ -134,19 +134,19 @@
   return m_dwByteIdx + 1 < m_dwLength ? m_pBuf[m_dwByteIdx + 1] : 0xFF;
 }
 
-FX_DWORD CJBig2_BitStream::getOffset() const {
+uint32_t CJBig2_BitStream::getOffset() const {
   return m_dwByteIdx;
 }
 
-void CJBig2_BitStream::setOffset(FX_DWORD dwOffset) {
+void CJBig2_BitStream::setOffset(uint32_t dwOffset) {
   m_dwByteIdx = std::min(dwOffset, m_dwLength);
 }
 
-FX_DWORD CJBig2_BitStream::getBitPos() const {
+uint32_t CJBig2_BitStream::getBitPos() const {
   return (m_dwByteIdx << 3) + m_dwBitIdx;
 }
 
-void CJBig2_BitStream::setBitPos(FX_DWORD dwBitPos) {
+void CJBig2_BitStream::setBitPos(uint32_t dwBitPos) {
   m_dwByteIdx = dwBitPos >> 3;
   m_dwBitIdx = dwBitPos & 7;
 }
@@ -159,11 +159,11 @@
   return m_pBuf + m_dwByteIdx;
 }
 
-void CJBig2_BitStream::offset(FX_DWORD dwOffset) {
+void CJBig2_BitStream::offset(uint32_t dwOffset) {
   m_dwByteIdx += dwOffset;
 }
 
-FX_DWORD CJBig2_BitStream::getByteLeft() const {
+uint32_t CJBig2_BitStream::getByteLeft() const {
   return m_dwLength - m_dwByteIdx;
 }
 
@@ -180,10 +180,10 @@
   return m_dwByteIdx < m_dwLength;
 }
 
-FX_DWORD CJBig2_BitStream::LengthInBits() const {
+uint32_t CJBig2_BitStream::LengthInBits() const {
   return m_dwLength << 3;
 }
 
-FX_DWORD CJBig2_BitStream::getObjNum() const {
+uint32_t CJBig2_BitStream::getObjNum() const {
   return m_dwObjNum;
 }
diff --git a/core/fxcodec/jbig2/JBig2_BitStream.h b/core/fxcodec/jbig2/JBig2_BitStream.h
index 45eb44c..191438f 100644
--- a/core/fxcodec/jbig2/JBig2_BitStream.h
+++ b/core/fxcodec/jbig2/JBig2_BitStream.h
@@ -17,39 +17,39 @@
   ~CJBig2_BitStream();
 
   // TODO(thestig): readFoo() should return bool.
-  int32_t readNBits(FX_DWORD nBits, FX_DWORD* dwResult);
-  int32_t readNBits(FX_DWORD nBits, int32_t* nResult);
-  int32_t read1Bit(FX_DWORD* dwResult);
+  int32_t readNBits(uint32_t nBits, uint32_t* dwResult);
+  int32_t readNBits(uint32_t nBits, int32_t* nResult);
+  int32_t read1Bit(uint32_t* dwResult);
   int32_t read1Bit(FX_BOOL* bResult);
   int32_t read1Byte(uint8_t* cResult);
-  int32_t readInteger(FX_DWORD* dwResult);
+  int32_t readInteger(uint32_t* dwResult);
   int32_t readShortInteger(uint16_t* wResult);
   void alignByte();
   uint8_t getCurByte() const;
   void incByteIdx();
   uint8_t getCurByte_arith() const;
   uint8_t getNextByte_arith() const;
-  FX_DWORD getOffset() const;
-  void setOffset(FX_DWORD dwOffset);
-  FX_DWORD getBitPos() const;
-  void setBitPos(FX_DWORD dwBitPos);
+  uint32_t getOffset() const;
+  void setOffset(uint32_t dwOffset);
+  uint32_t getBitPos() const;
+  void setBitPos(uint32_t dwBitPos);
   const uint8_t* getBuf() const;
-  FX_DWORD getLength() const { return m_dwLength; }
+  uint32_t getLength() const { return m_dwLength; }
   const uint8_t* getPointer() const;
-  void offset(FX_DWORD dwOffset);
-  FX_DWORD getByteLeft() const;
-  FX_DWORD getObjNum() const;
+  void offset(uint32_t dwOffset);
+  uint32_t getByteLeft() const;
+  uint32_t getObjNum() const;
 
  private:
   void AdvanceBit();
   bool IsInBound() const;
-  FX_DWORD LengthInBits() const;
+  uint32_t LengthInBits() const;
 
   const uint8_t* m_pBuf;
-  FX_DWORD m_dwLength;
-  FX_DWORD m_dwByteIdx;
-  FX_DWORD m_dwBitIdx;
-  const FX_DWORD m_dwObjNum;
+  uint32_t m_dwLength;
+  uint32_t m_dwByteIdx;
+  uint32_t m_dwBitIdx;
+  const uint32_t m_dwObjNum;
 
   CJBig2_BitStream(const CJBig2_BitStream&) = delete;
   void operator=(const CJBig2_BitStream&) = delete;
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp
index da020a6..1c316a0 100644
--- a/core/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp
@@ -230,7 +230,7 @@
   return nRet;
 }
 
-CJBig2_Segment* CJBig2_Context::findSegmentByNumber(FX_DWORD dwNumber) {
+CJBig2_Segment* CJBig2_Context::findSegmentByNumber(uint32_t dwNumber) {
   if (m_pGlobalContext) {
     CJBig2_Segment* pSeg = m_pGlobalContext->findSegmentByNumber(dwNumber);
     if (pSeg) {
@@ -267,11 +267,11 @@
     return JBIG2_ERROR_TOO_SHORT;
   }
 
-  FX_DWORD dwTemp;
+  uint32_t dwTemp;
   uint8_t cTemp = m_pStream->getCurByte();
   if ((cTemp >> 5) == 7) {
     if (m_pStream->readInteger(
-            (FX_DWORD*)&pSegment->m_nReferred_to_segment_count) != 0) {
+            (uint32_t*)&pSegment->m_nReferred_to_segment_count) != 0) {
       return JBIG2_ERROR_TOO_SHORT;
     }
     pSegment->m_nReferred_to_segment_count &= 0x1fffffff;
@@ -292,7 +292,7 @@
   uint8_t cPSize = pSegment->m_cFlags.s.page_association_size ? 4 : 1;
   if (pSegment->m_nReferred_to_segment_count) {
     pSegment->m_pReferred_to_segment_numbers =
-        FX_Alloc(FX_DWORD, pSegment->m_nReferred_to_segment_count);
+        FX_Alloc(uint32_t, pSegment->m_nReferred_to_segment_count);
     for (int32_t i = 0; i < pSegment->m_nReferred_to_segment_count; ++i) {
       switch (cSSize) {
         case 1:
@@ -396,7 +396,7 @@
         pPageInfo->m_bIsStriped = TRUE;
 
       if (!m_bBufSpecified) {
-        FX_DWORD height =
+        uint32_t height =
             bMaxHeight ? pPageInfo->m_wMaxStripeSize : pPageInfo->m_dwHeight;
         m_pPage.reset(new CJBig2_Image(pPageInfo->m_dwWidth, height));
       }
@@ -449,8 +449,8 @@
   uint8_t cSDHUFFBMSIZE = (wFlags >> 6) & 0x0001;
   uint8_t cSDHUFFAGGINST = (wFlags >> 7) & 0x0001;
   if (pSymbolDictDecoder->SDHUFF == 0) {
-    const FX_DWORD dwTemp = (pSymbolDictDecoder->SDTEMPLATE == 0) ? 8 : 2;
-    for (FX_DWORD i = 0; i < dwTemp; ++i) {
+    const uint32_t dwTemp = (pSymbolDictDecoder->SDTEMPLATE == 0) ? 8 : 2;
+    for (uint32_t i = 0; i < dwTemp; ++i) {
       if (m_pStream->read1Byte((uint8_t*)&pSymbolDictDecoder->SDAT[i]) != 0)
         return JBIG2_ERROR_TOO_SHORT;
     }
@@ -488,7 +488,7 @@
   std::unique_ptr<CJBig2_Image*, FxFreeDeleter> SDINSYMS;
   if (pSymbolDictDecoder->SDNUMINSYMS != 0) {
     SDINSYMS.reset(FX_Alloc(CJBig2_Image*, pSymbolDictDecoder->SDNUMINSYMS));
-    FX_DWORD dwTemp = 0;
+    uint32_t dwTemp = 0;
     for (int32_t i = 0; i < pSegment->m_nReferred_to_segment_count; ++i) {
       CJBig2_Segment* pSeg =
           findSegmentByNumber(pSegment->m_pReferred_to_segment_numbers[i]);
@@ -665,7 +665,7 @@
   pTRD->SBH = ri.height;
   pTRD->SBHUFF = wFlags & 0x0001;
   pTRD->SBREFINE = (wFlags >> 1) & 0x0001;
-  FX_DWORD dwTemp = (wFlags >> 2) & 0x0003;
+  uint32_t dwTemp = (wFlags >> 2) & 0x0003;
   pTRD->SBSTRIPS = 1 << dwTemp;
   pTRD->REFCORNER = (JBig2Corner)((wFlags >> 4) & 0x0003);
   pTRD->TRANSPOSED = (wFlags >> 6) & 0x0001;
@@ -751,7 +751,7 @@
     pTRD->SBSYMCODES = SBSYMCODES.get();
   } else {
     dwTemp = 0;
-    while ((FX_DWORD)(1 << dwTemp) < pTRD->SBNUMSYMS) {
+    while ((uint32_t)(1 << dwTemp) < pTRD->SBNUMSYMS) {
       ++dwTemp;
     }
     pTRD->SBSYMCODELEN = (uint8_t)dwTemp;
@@ -999,8 +999,8 @@
       m_pStream->read1Byte(&cFlags) != 0 ||
       m_pStream->readInteger(&pHRD->HGW) != 0 ||
       m_pStream->readInteger(&pHRD->HGH) != 0 ||
-      m_pStream->readInteger((FX_DWORD*)&pHRD->HGX) != 0 ||
-      m_pStream->readInteger((FX_DWORD*)&pHRD->HGY) != 0 ||
+      m_pStream->readInteger((uint32_t*)&pHRD->HGX) != 0 ||
+      m_pStream->readInteger((uint32_t*)&pHRD->HGY) != 0 ||
       m_pStream->readShortInteger(&pHRD->HRX) != 0 ||
       m_pStream->readShortInteger(&pHRD->HRY) != 0) {
     return JBIG2_ERROR_TOO_SHORT;
@@ -1261,10 +1261,10 @@
 }
 
 int32_t CJBig2_Context::parseRegionInfo(JBig2RegionInfo* pRI) {
-  if (m_pStream->readInteger((FX_DWORD*)&pRI->width) != 0 ||
-      m_pStream->readInteger((FX_DWORD*)&pRI->height) != 0 ||
-      m_pStream->readInteger((FX_DWORD*)&pRI->x) != 0 ||
-      m_pStream->readInteger((FX_DWORD*)&pRI->y) != 0 ||
+  if (m_pStream->readInteger((uint32_t*)&pRI->width) != 0 ||
+      m_pStream->readInteger((uint32_t*)&pRI->height) != 0 ||
+      m_pStream->readInteger((uint32_t*)&pRI->x) != 0 ||
+      m_pStream->readInteger((uint32_t*)&pRI->y) != 0 ||
       m_pStream->read1Byte(&pRI->flags) != 0) {
     return JBIG2_ERROR_TOO_SHORT;
   }
@@ -1273,7 +1273,7 @@
 
 JBig2HuffmanCode* CJBig2_Context::decodeSymbolIDHuffmanTable(
     CJBig2_BitStream* pStream,
-    FX_DWORD SBNUMSYMS) {
+    uint32_t SBNUMSYMS) {
   const size_t kRunCodesSize = 35;
   int32_t runcodes[kRunCodesSize];
   int32_t runcodes_len[kRunCodesSize];
@@ -1291,7 +1291,7 @@
     int32_t j;
     int32_t nVal = 0;
     int32_t nBits = 0;
-    FX_DWORD nTemp;
+    uint32_t nTemp;
     while (true) {
       if (pStream->read1Bit(&nTemp) != 0)
         return nullptr;
diff --git a/core/fxcodec/jbig2/JBig2_Context.h b/core/fxcodec/jbig2/JBig2_Context.h
index aff3b1b..4a32e61 100644
--- a/core/fxcodec/jbig2/JBig2_Context.h
+++ b/core/fxcodec/jbig2/JBig2_Context.h
@@ -23,7 +23,7 @@
 class IFX_Pause;
 
 // Cache is keyed by the ObjNum of a stream and an index within the stream.
-using CJBig2_CacheKey = std::pair<FX_DWORD, FX_DWORD>;
+using CJBig2_CacheKey = std::pair<uint32_t, uint32_t>;
 // NB: CJBig2_SymbolDict* is owned.
 using CJBig2_CachePair = std::pair<CJBig2_CacheKey, CJBig2_SymbolDict*>;
 
@@ -74,7 +74,7 @@
 
   int32_t decode_RandomOrgnazation(IFX_Pause* pPause);
 
-  CJBig2_Segment* findSegmentByNumber(FX_DWORD dwNumber);
+  CJBig2_Segment* findSegmentByNumber(uint32_t dwNumber);
 
   CJBig2_Segment* findReferredSegmentByTypeAndIndex(CJBig2_Segment* pSegment,
                                                     uint8_t cType,
@@ -103,7 +103,7 @@
   int32_t parseRegionInfo(JBig2RegionInfo* pRI);
 
   JBig2HuffmanCode* decodeSymbolIDHuffmanTable(CJBig2_BitStream* pStream,
-                                               FX_DWORD SBNUMSYMS);
+                                               uint32_t SBNUMSYMS);
 
   void huffman_assign_code(int* CODES, int* PREFLEN, int NTEMP);
 
@@ -125,7 +125,7 @@
   std::unique_ptr<CJBig2_GRDProc> m_pGRD;
   JBig2ArithCtx* m_gbContext;
   std::unique_ptr<CJBig2_Segment> m_pSegment;
-  FX_DWORD m_dwOffset;
+  uint32_t m_dwOffset;
   JBig2RegionInfo m_ri;
   std::list<CJBig2_CachePair>* const m_pSymbolDictCache;
   bool m_bIsGlobal;
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
index a3fc33c..5f3b47f 100644
--- a/core/fxcodec/jbig2/JBig2_GrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_GrdProc.cpp
@@ -66,8 +66,8 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   uint8_t *pLine, *pLine1, *pLine2, cVal;
   int32_t nStride, nStride2, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -81,8 +81,8 @@
   nStride2 = nStride << 1;
   nLineBytes = ((GBW + 7) >> 3) - 1;
   nBitsLeft = GBW - (nLineBytes << 3);
-  FX_DWORD height = GBH & 0x7fffffff;
-  for (FX_DWORD h = 0; h < height; h++) {
+  uint32_t height = GBH & 0x7fffffff;
+  for (uint32_t h = 0; h < height; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
       LTP = LTP ^ SLTP;
@@ -156,12 +156,12 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3;
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3;
   LTP = 0;
   std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
   GBREG->fill(0);
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
       LTP = LTP ^ SLTP;
@@ -175,7 +175,7 @@
       line2 |= GBREG->getPixel(1, h - 1) << 1;
       line2 |= GBREG->getPixel(0, h - 1) << 2;
       line3 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, h)) {
           bVal = 0;
         } else {
@@ -204,8 +204,8 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   uint8_t *pLine, *pLine1, *pLine2, cVal;
   int32_t nStride, nStride2, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -219,7 +219,7 @@
   nStride2 = nStride << 1;
   nLineBytes = ((GBW + 7) >> 3) - 1;
   nBitsLeft = GBW - (nLineBytes << 3);
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
       LTP = LTP ^ SLTP;
@@ -293,12 +293,12 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3;
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3;
   LTP = 0;
   std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
   GBREG->fill(0);
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
       LTP = LTP ^ SLTP;
@@ -313,7 +313,7 @@
       line2 |= GBREG->getPixel(1, h - 1) << 1;
       line2 |= GBREG->getPixel(0, h - 1) << 2;
       line3 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, h)) {
           bVal = 0;
         } else {
@@ -338,8 +338,8 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   uint8_t *pLine, *pLine1, *pLine2, cVal;
   int32_t nStride, nStride2, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -353,7 +353,7 @@
   nStride2 = nStride << 1;
   nLineBytes = ((GBW + 7) >> 3) - 1;
   nBitsLeft = GBW - (nLineBytes << 3);
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
       LTP = LTP ^ SLTP;
@@ -427,12 +427,12 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3;
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3;
   LTP = 0;
   std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
   GBREG->fill(0);
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
       LTP = LTP ^ SLTP;
@@ -445,7 +445,7 @@
       line2 = GBREG->getPixel(1, h - 1);
       line2 |= GBREG->getPixel(0, h - 1) << 1;
       line3 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, h)) {
           bVal = 0;
         } else {
@@ -471,8 +471,8 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1;
+  uint32_t CONTEXT;
+  uint32_t line1;
   uint8_t *pLine, *pLine1, cVal;
   int32_t nStride, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -485,7 +485,7 @@
   nStride = GBREG->m_nStride;
   nLineBytes = ((GBW + 7) >> 3) - 1;
   nBitsLeft = GBW - (nLineBytes << 3);
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
       LTP = LTP ^ SLTP;
@@ -546,12 +546,12 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   LTP = 0;
   std::unique_ptr<CJBig2_Image> GBREG(new CJBig2_Image(GBW, GBH));
   GBREG->fill(0);
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
       LTP = LTP ^ SLTP;
@@ -562,7 +562,7 @@
       line1 = GBREG->getPixel(1, h - 1);
       line1 |= GBREG->getPixel(0, h - 1) << 1;
       line2 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, h)) {
           bVal = 0;
         } else {
@@ -673,7 +673,7 @@
   FaxG4Decode(pStream->getBuf(), pStream->getLength(), &bitpos,
               (*pImage)->m_pData, GBW, GBH, (*pImage)->m_nStride);
   pStream->setBitPos(bitpos);
-  for (i = 0; (FX_DWORD)i < (*pImage)->m_nStride * GBH; i++) {
+  for (i = 0; (uint32_t)i < (*pImage)->m_nStride * GBH; i++) {
     (*pImage)->m_pData[i] = ~(*pImage)->m_pData[i];
   }
   m_ProssiveStatus = FXCODEC_STATUS_DECODE_FINISH;
@@ -698,8 +698,8 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   uint8_t *pLine1, *pLine2, cVal;
   int32_t nStride, nStride2, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -710,7 +710,7 @@
   nStride2 = nStride << 1;
   nLineBytes = ((GBW + 7) >> 3) - 1;
   nBitsLeft = GBW - (nLineBytes << 3);
-  FX_DWORD height = GBH & 0x7fffffff;
+  uint32_t height = GBH & 0x7fffffff;
   for (; m_loopIndex < height; m_loopIndex++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
@@ -793,8 +793,8 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3;
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3;
   for (; m_loopIndex < GBH; m_loopIndex++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x9b25]);
@@ -809,7 +809,7 @@
       line2 |= pImage->getPixel(1, m_loopIndex - 1) << 1;
       line2 |= pImage->getPixel(0, m_loopIndex - 1) << 2;
       line3 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, m_loopIndex)) {
           bVal = 0;
         } else {
@@ -848,8 +848,8 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   uint8_t *pLine1, *pLine2, cVal;
   int32_t nStride, nStride2, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -942,9 +942,9 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3;
-  for (FX_DWORD h = 0; h < GBH; h++) {
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3;
+  for (uint32_t h = 0; h < GBH; h++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x0795]);
       LTP = LTP ^ SLTP;
@@ -959,7 +959,7 @@
       line2 |= pImage->getPixel(1, h - 1) << 1;
       line2 |= pImage->getPixel(0, h - 1) << 2;
       line3 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, h)) {
           bVal = 0;
         } else {
@@ -993,8 +993,8 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   uint8_t *pLine1, *pLine2, cVal;
   int32_t nStride, nStride2, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -1087,8 +1087,8 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3;
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3;
   for (; m_loopIndex < GBH; m_loopIndex++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x00e5]);
@@ -1102,7 +1102,7 @@
       line2 = pImage->getPixel(1, m_loopIndex - 1);
       line2 |= pImage->getPixel(0, m_loopIndex - 1) << 1;
       line3 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, m_loopIndex)) {
           bVal = 0;
         } else {
@@ -1138,8 +1138,8 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1;
+  uint32_t CONTEXT;
+  uint32_t line1;
   uint8_t *pLine1, cVal;
   int32_t nStride, k;
   int32_t nLineBytes, nBitsLeft, cc;
@@ -1218,8 +1218,8 @@
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
   FX_BOOL SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2;
+  uint32_t CONTEXT;
+  uint32_t line1, line2;
   for (; m_loopIndex < GBH; m_loopIndex++) {
     if (TPGDON) {
       SLTP = pArithDecoder->DECODE(&gbContext[0x0195]);
@@ -1231,7 +1231,7 @@
       line1 = pImage->getPixel(1, m_loopIndex - 1);
       line1 |= pImage->getPixel(0, m_loopIndex - 1) << 1;
       line2 = 0;
-      for (FX_DWORD w = 0; w < GBW; w++) {
+      for (uint32_t w = 0; w < GBW; w++) {
         if (USESKIP && SKIP->getPixel(w, m_loopIndex)) {
           bVal = 0;
         } else {
diff --git a/core/fxcodec/jbig2/JBig2_GrdProc.h b/core/fxcodec/jbig2/JBig2_GrdProc.h
index 2a638aa..f6a5448 100644
--- a/core/fxcodec/jbig2/JBig2_GrdProc.h
+++ b/core/fxcodec/jbig2/JBig2_GrdProc.h
@@ -35,8 +35,8 @@
   FX_RECT GetReplaceRect() const { return m_ReplaceRect; }
 
   FX_BOOL MMR;
-  FX_DWORD GBW;
-  FX_DWORD GBH;
+  uint32_t GBW;
+  uint32_t GBH;
   uint8_t GBTEMPLATE;
   FX_BOOL TPGDON;
   FX_BOOL USESKIP;
@@ -109,7 +109,7 @@
   CJBig2_Image* decode_Arith_Template3_unopt(CJBig2_ArithDecoder* pArithDecoder,
                                              JBig2ArithCtx* gbContext);
 
-  FX_DWORD m_loopIndex;
+  uint32_t m_loopIndex;
   uint8_t* m_pLine;
   IFX_Pause* m_pPause;
   FXCODEC_STATUS m_ProssiveStatus;
diff --git a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp
index c6ff3dd..17d17d5 100644
--- a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp
@@ -20,13 +20,13 @@
   if (GRTEMPLATE == 0) {
     if ((GRAT[0] == -1) && (GRAT[1] == -1) && (GRAT[2] == -1) &&
         (GRAT[3] == -1) && (GRREFERENCEDX == 0) &&
-        (GRW == (FX_DWORD)GRREFERENCE->m_nWidth)) {
+        (GRW == (uint32_t)GRREFERENCE->m_nWidth)) {
       return decode_Template0_opt(pArithDecoder, grContext);
     }
     return decode_Template0_unopt(pArithDecoder, grContext);
   }
 
-  if ((GRREFERENCEDX == 0) && (GRW == (FX_DWORD)GRREFERENCE->m_nWidth))
+  if ((GRREFERENCEDX == 0) && (GRW == (uint32_t)GRREFERENCE->m_nWidth))
     return decode_Template1_opt(pArithDecoder, grContext);
   return decode_Template1_unopt(pArithDecoder, grContext);
 }
@@ -35,12 +35,12 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* grContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3, line4, line5;
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3, line4, line5;
   LTP = 0;
   std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH));
   GRREG->fill(0);
-  for (FX_DWORD h = 0; h < GRH; h++) {
+  for (uint32_t h = 0; h < GRH; h++) {
     if (TPGRON) {
       SLTP = pArithDecoder->DECODE(&grContext[0x0010]);
       LTP = LTP ^ SLTP;
@@ -61,7 +61,7 @@
                << 1;
       line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1)
                << 2;
-      for (FX_DWORD w = 0; w < GRW; w++) {
+      for (uint32_t w = 0; w < GRW; w++) {
         CONTEXT = line5;
         CONTEXT |= line4 << 3;
         CONTEXT |= line3 << 6;
@@ -104,7 +104,7 @@
                << 1;
       line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX - 1, h - GRREFERENCEDY + 1)
                << 2;
-      for (FX_DWORD w = 0; w < GRW; w++) {
+      for (uint32_t w = 0; w < GRW; w++) {
         bVal = GRREFERENCE->getPixel(w, h);
         if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) &&
               (bVal == GRREFERENCE->getPixel(w, h - 1)) &&
@@ -153,8 +153,8 @@
     return nullptr;
 
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line1_r, line2_r, line3_r;
+  uint32_t CONTEXT;
+  uint32_t line1, line1_r, line2_r, line3_r;
   uint8_t *pLine, *pLineR, cVal;
   intptr_t nStride, nStrideR, nOffset;
   int32_t k, nBits;
@@ -287,12 +287,12 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* grContext) {
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line2, line3, line4, line5;
+  uint32_t CONTEXT;
+  uint32_t line1, line2, line3, line4, line5;
   LTP = 0;
   std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH));
   GRREG->fill(0);
-  for (FX_DWORD h = 0; h < GRH; h++) {
+  for (uint32_t h = 0; h < GRH; h++) {
     if (TPGRON) {
       SLTP = pArithDecoder->DECODE(&grContext[0x0008]);
       LTP = LTP ^ SLTP;
@@ -310,7 +310,7 @@
       line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
       line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1)
                << 1;
-      for (FX_DWORD w = 0; w < GRW; w++) {
+      for (uint32_t w = 0; w < GRW; w++) {
         CONTEXT = line5;
         CONTEXT |= line4 << 2;
         CONTEXT |= line3 << 5;
@@ -346,7 +346,7 @@
       line5 = GRREFERENCE->getPixel(-GRREFERENCEDX + 1, h - GRREFERENCEDY + 1);
       line5 |= GRREFERENCE->getPixel(-GRREFERENCEDX, h - GRREFERENCEDY + 1)
                << 1;
-      for (FX_DWORD w = 0; w < GRW; w++) {
+      for (uint32_t w = 0; w < GRW; w++) {
         bVal = GRREFERENCE->getPixel(w, h);
         if (!(TPGRON && (bVal == GRREFERENCE->getPixel(w - 1, h - 1)) &&
               (bVal == GRREFERENCE->getPixel(w, h - 1)) &&
@@ -391,8 +391,8 @@
     return nullptr;
 
   FX_BOOL LTP, SLTP, bVal;
-  FX_DWORD CONTEXT;
-  FX_DWORD line1, line1_r, line2_r, line3_r;
+  uint32_t CONTEXT;
+  uint32_t line1, line1_r, line2_r, line3_r;
   uint8_t *pLine, *pLineR, cVal;
   intptr_t nStride, nStrideR, nOffset;
   int32_t k, nBits;
diff --git a/core/fxcodec/jbig2/JBig2_GrrdProc.h b/core/fxcodec/jbig2/JBig2_GrrdProc.h
index 2c6d02d..17adf19 100644
--- a/core/fxcodec/jbig2/JBig2_GrrdProc.h
+++ b/core/fxcodec/jbig2/JBig2_GrrdProc.h
@@ -30,8 +30,8 @@
   CJBig2_Image* decode_Template1_opt(CJBig2_ArithDecoder* pArithDecoder,
                                      JBig2ArithCtx* grContext);
 
-  FX_DWORD GRW;
-  FX_DWORD GRH;
+  uint32_t GRW;
+  uint32_t GRH;
   FX_BOOL GRTEMPLATE;
   CJBig2_Image* GRREFERENCE;
   int32_t GRREFERENCEDX;
diff --git a/core/fxcodec/jbig2/JBig2_GsidProc.cpp b/core/fxcodec/jbig2/JBig2_GsidProc.cpp
index 2ac96fc..30f95b8 100644
--- a/core/fxcodec/jbig2/JBig2_GsidProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_GsidProc.cpp
@@ -14,7 +14,7 @@
 #include "core/fxcodec/jbig2/JBig2_List.h"
 #include "core/fxcrt/include/fx_basic.h"
 
-FX_DWORD* CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
+uint32_t* CJBig2_GSIDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
                                         JBig2ArithCtx* gbContext,
                                         IFX_Pause* pPause) {
   std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc());
@@ -56,11 +56,11 @@
     if (i < GSBPP - 1)
       pImage->composeFrom(0, 0, GSPLANES.get(i + 1), JBIG2_COMPOSE_XOR);
   }
-  std::unique_ptr<FX_DWORD, FxFreeDeleter> GSVALS(
-      FX_Alloc2D(FX_DWORD, GSW, GSH));
-  JBIG2_memset(GSVALS.get(), 0, sizeof(FX_DWORD) * GSW * GSH);
-  for (FX_DWORD y = 0; y < GSH; ++y) {
-    for (FX_DWORD x = 0; x < GSW; ++x) {
+  std::unique_ptr<uint32_t, FxFreeDeleter> GSVALS(
+      FX_Alloc2D(uint32_t, GSW, GSH));
+  JBIG2_memset(GSVALS.get(), 0, sizeof(uint32_t) * GSW * GSH);
+  for (uint32_t y = 0; y < GSH; ++y) {
+    for (uint32_t x = 0; x < GSW; ++x) {
       for (int32_t i = 0; i < GSBPP; ++i) {
         GSVALS.get()[y * GSW + x] |= GSPLANES.get(i)->getPixel(x, y) << i;
       }
@@ -69,7 +69,7 @@
   return GSVALS.release();
 }
 
-FX_DWORD* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream,
+uint32_t* CJBig2_GSIDProc::decode_MMR(CJBig2_BitStream* pStream,
                                       IFX_Pause* pPause) {
   std::unique_ptr<CJBig2_GRDProc> pGRD(new CJBig2_GRDProc());
   pGRD->MMR = GSMMR;
@@ -106,10 +106,10 @@
                                    JBIG2_COMPOSE_XOR);
     J = J - 1;
   }
-  std::unique_ptr<FX_DWORD> GSVALS(FX_Alloc2D(FX_DWORD, GSW, GSH));
-  JBIG2_memset(GSVALS.get(), 0, sizeof(FX_DWORD) * GSW * GSH);
-  for (FX_DWORD y = 0; y < GSH; ++y) {
-    for (FX_DWORD x = 0; x < GSW; ++x) {
+  std::unique_ptr<uint32_t> GSVALS(FX_Alloc2D(uint32_t, GSW, GSH));
+  JBIG2_memset(GSVALS.get(), 0, sizeof(uint32_t) * GSW * GSH);
+  for (uint32_t y = 0; y < GSH; ++y) {
+    for (uint32_t x = 0; x < GSW; ++x) {
       for (J = 0; J < GSBPP; ++J) {
         GSVALS.get()[y * GSW + x] |= GSPLANES.get()[J]->getPixel(x, y) << J;
       }
diff --git a/core/fxcodec/jbig2/JBig2_GsidProc.h b/core/fxcodec/jbig2/JBig2_GsidProc.h
index 8124db5..b3bd022 100644
--- a/core/fxcodec/jbig2/JBig2_GsidProc.h
+++ b/core/fxcodec/jbig2/JBig2_GsidProc.h
@@ -17,18 +17,18 @@
 
 class CJBig2_GSIDProc {
  public:
-  FX_DWORD* decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
+  uint32_t* decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
                          JBig2ArithCtx* gbContext,
                          IFX_Pause* pPause);
 
-  FX_DWORD* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause);
+  uint32_t* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause);
 
  public:
   FX_BOOL GSMMR;
   FX_BOOL GSUSESKIP;
   uint8_t GSBPP;
-  FX_DWORD GSW;
-  FX_DWORD GSH;
+  uint32_t GSW;
+  uint32_t GSH;
   uint8_t GSTEMPLATE;
   CJBig2_Image* GSKIP;
 };
diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
index a9f1534..aaa617c 100644
--- a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
@@ -14,10 +14,10 @@
 CJBig2_Image* CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
                                             JBig2ArithCtx* gbContext,
                                             IFX_Pause* pPause) {
-  FX_DWORD ng, mg;
+  uint32_t ng, mg;
   int32_t x, y;
-  FX_DWORD HBPP;
-  FX_DWORD* GI;
+  uint32_t HBPP;
+  uint32_t* GI;
   std::unique_ptr<CJBig2_Image> HSKIP;
   std::unique_ptr<CJBig2_Image> HTREG(new CJBig2_Image(HBW, HBH));
   HTREG->fill(HDEFPIXEL);
@@ -37,7 +37,7 @@
     }
   }
   HBPP = 1;
-  while ((FX_DWORD)(1 << HBPP) < HNUMPATS) {
+  while ((uint32_t)(1 << HBPP) < HNUMPATS) {
     HBPP++;
   }
   std::unique_ptr<CJBig2_GSIDProc> pGID(new CJBig2_GSIDProc());
@@ -56,7 +56,7 @@
     for (ng = 0; ng < HGW; ng++) {
       x = (HGX + mg * HRY + ng * HRX) >> 8;
       y = (HGY + mg * HRX - ng * HRY) >> 8;
-      FX_DWORD pat_index = GI[mg * HGW + ng];
+      uint32_t pat_index = GI[mg * HGW + ng];
       if (pat_index >= HNUMPATS) {
         pat_index = HNUMPATS - 1;
       }
@@ -69,13 +69,13 @@
 
 CJBig2_Image* CJBig2_HTRDProc::decode_MMR(CJBig2_BitStream* pStream,
                                           IFX_Pause* pPause) {
-  FX_DWORD ng, mg;
+  uint32_t ng, mg;
   int32_t x, y;
-  FX_DWORD* GI;
+  uint32_t* GI;
   std::unique_ptr<CJBig2_Image> HTREG(new CJBig2_Image(HBW, HBH));
   HTREG->fill(HDEFPIXEL);
-  FX_DWORD HBPP = 1;
-  while ((FX_DWORD)(1 << HBPP) < HNUMPATS) {
+  uint32_t HBPP = 1;
+  while ((uint32_t)(1 << HBPP) < HNUMPATS) {
     HBPP++;
   }
   std::unique_ptr<CJBig2_GSIDProc> pGID(new CJBig2_GSIDProc());
@@ -92,7 +92,7 @@
     for (ng = 0; ng < HGW; ng++) {
       x = (HGX + mg * HRY + ng * HRX) >> 8;
       y = (HGY + mg * HRX - ng * HRY) >> 8;
-      FX_DWORD pat_index = GI[mg * HGW + ng];
+      uint32_t pat_index = GI[mg * HGW + ng];
       if (pat_index >= HNUMPATS) {
         pat_index = HNUMPATS - 1;
       }
diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.h b/core/fxcodec/jbig2/JBig2_HtrdProc.h
index 62ae57d..b4f55c6 100644
--- a/core/fxcodec/jbig2/JBig2_HtrdProc.h
+++ b/core/fxcodec/jbig2/JBig2_HtrdProc.h
@@ -24,17 +24,17 @@
   CJBig2_Image* decode_MMR(CJBig2_BitStream* pStream, IFX_Pause* pPause);
 
  public:
-  FX_DWORD HBW;
-  FX_DWORD HBH;
+  uint32_t HBW;
+  uint32_t HBH;
   FX_BOOL HMMR;
   uint8_t HTEMPLATE;
-  FX_DWORD HNUMPATS;
+  uint32_t HNUMPATS;
   CJBig2_Image** HPATS;
   FX_BOOL HDEFPIXEL;
   JBig2ComposeOp HCOMBOP;
   FX_BOOL HENABLESKIP;
-  FX_DWORD HGW;
-  FX_DWORD HGH;
+  uint32_t HGW;
+  uint32_t HGH;
   int32_t HGX;
   int32_t HGY;
   uint16_t HRX;
diff --git a/core/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp b/core/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
index afcc17a..050b5e6 100644
--- a/core/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
+++ b/core/fxcodec/jbig2/JBig2_HuffmanDecoder.cpp
@@ -18,13 +18,13 @@
   int nVal = 0;
   int nBits = 0;
   while (1) {
-    FX_DWORD nTmp;
+    uint32_t nTmp;
     if (m_pStream->read1Bit(&nTmp) == -1)
       break;
 
     nVal = (nVal << 1) | nTmp;
     ++nBits;
-    for (FX_DWORD i = 0; i < pTable->Size(); ++i) {
+    for (uint32_t i = 0; i < pTable->Size(); ++i) {
       if (pTable->GetPREFLEN()[i] == nBits && pTable->GetCODES()[i] == nVal) {
         if (pTable->IsHTOOB() && i == pTable->Size() - 1)
           return JBIG2_OOB;
@@ -32,7 +32,7 @@
         if (m_pStream->readNBits(pTable->GetRANGELEN()[i], &nTmp) == -1)
           return -1;
 
-        FX_DWORD offset = pTable->IsHTOOB() ? 3 : 2;
+        uint32_t offset = pTable->IsHTOOB() ? 3 : 2;
         if (i == pTable->Size() - offset)
           *nResult = pTable->GetRANGELOW()[i] - nTmp;
         else
diff --git a/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp b/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
index 7b18551..038921e 100644
--- a/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
+++ b/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
@@ -15,7 +15,7 @@
 #include "core/fxcrt/include/fx_memory.h"
 
 CJBig2_HuffmanTable::CJBig2_HuffmanTable(const JBig2TableLine* pTable,
-                                         FX_DWORD nLines,
+                                         uint32_t nLines,
                                          bool bHTOOB)
     : m_bOK(true), HTOOB(bHTOOB), NTEMP(nLines) {
   ParseFromStandardTable(pTable);
@@ -32,7 +32,7 @@
   PREFLEN.resize(NTEMP);
   RANGELEN.resize(NTEMP);
   RANGELOW.resize(NTEMP);
-  for (FX_DWORD i = 0; i < NTEMP; ++i) {
+  for (uint32_t i = 0; i < NTEMP; ++i) {
     PREFLEN[i] = pTable[i].PREFLEN;
     RANGELEN[i] = pTable[i].RANDELEN;
     RANGELOW[i] = pTable[i].RANGELOW;
@@ -48,8 +48,8 @@
   HTOOB = !!(cTemp & 0x01);
   unsigned char HTPS = ((cTemp >> 1) & 0x07) + 1;
   unsigned char HTRS = ((cTemp >> 4) & 0x07) + 1;
-  FX_DWORD HTLOW;
-  FX_DWORD HTHIGH;
+  uint32_t HTLOW;
+  uint32_t HTHIGH;
   if (pStream->readInteger(&HTLOW) == -1 ||
       pStream->readInteger(&HTHIGH) == -1) {
     return false;
@@ -99,7 +99,7 @@
 
 void CJBig2_HuffmanTable::InitCodes() {
   int lenmax = 0;
-  for (FX_DWORD i = 0; i < NTEMP; ++i)
+  for (uint32_t i = 0; i < NTEMP; ++i)
     lenmax = std::max(PREFLEN[i], lenmax);
 
   CODES.resize(NTEMP);
@@ -113,7 +113,7 @@
   for (int i = 1; i <= lenmax; ++i) {
     FIRSTCODE[i] = (FIRSTCODE[i - 1] + LENCOUNT[i - 1]) << 1;
     int CURCODE = FIRSTCODE[i];
-    for (FX_DWORD j = 0; j < NTEMP; ++j) {
+    for (uint32_t j = 0; j < NTEMP; ++j) {
       if (PREFLEN[j] == i)
         CODES[j] = CURCODE++;
     }
diff --git a/core/fxcodec/jbig2/JBig2_HuffmanTable.h b/core/fxcodec/jbig2/JBig2_HuffmanTable.h
index 7a31cf6..9b29847 100644
--- a/core/fxcodec/jbig2/JBig2_HuffmanTable.h
+++ b/core/fxcodec/jbig2/JBig2_HuffmanTable.h
@@ -17,7 +17,7 @@
 class CJBig2_HuffmanTable {
  public:
   CJBig2_HuffmanTable(const JBig2TableLine* pTable,
-                      FX_DWORD nLines,
+                      uint32_t nLines,
                       bool bHTOOB);
 
   explicit CJBig2_HuffmanTable(CJBig2_BitStream* pStream);
@@ -25,7 +25,7 @@
   ~CJBig2_HuffmanTable();
 
   bool IsHTOOB() const { return HTOOB; }
-  FX_DWORD Size() const { return NTEMP; }
+  uint32_t Size() const { return NTEMP; }
   const std::vector<int>& GetCODES() const { return CODES; }
   const std::vector<int>& GetPREFLEN() const { return PREFLEN; }
   const std::vector<int>& GetRANGELEN() const { return RANGELEN; }
@@ -40,7 +40,7 @@
 
   bool m_bOK;
   bool HTOOB;
-  FX_DWORD NTEMP;
+  uint32_t NTEMP;
   std::vector<int> CODES;
   std::vector<int> PREFLEN;
   std::vector<int> RANGELEN;
diff --git a/core/fxcodec/jbig2/JBig2_Image.cpp b/core/fxcodec/jbig2/JBig2_Image.cpp
index bb36740..7297199 100644
--- a/core/fxcodec/jbig2/JBig2_Image.cpp
+++ b/core/fxcodec/jbig2/JBig2_Image.cpp
@@ -149,14 +149,14 @@
   return pSrc->composeTo(this, x, y, op, pSrcRect);
 }
 #define JBIG2_GETDWORD(buf) \
-  ((FX_DWORD)(((buf)[0] << 24) | ((buf)[1] << 16) | ((buf)[2] << 8) | (buf)[3]))
+  ((uint32_t)(((buf)[0] << 24) | ((buf)[1] << 16) | ((buf)[2] << 8) | (buf)[3]))
 CJBig2_Image* CJBig2_Image::subImage(int32_t x,
                                      int32_t y,
                                      int32_t w,
                                      int32_t h) {
   int32_t m, n, j;
   uint8_t *pLineSrc, *pLineDst;
-  FX_DWORD wTmp;
+  uint32_t wTmp;
   uint8_t *pSrc, *pSrcEnd, *pDst, *pDstEnd;
   if (w == 0 || h == 0) {
     return NULL;
@@ -180,7 +180,7 @@
       pDst = pLineDst;
       pDstEnd = pLineDst + pImage->m_nStride;
       for (; pDst < pDstEnd; pSrc += 4, pDst += 4) {
-        *((FX_DWORD*)pDst) = *((FX_DWORD*)pSrc);
+        *((uint32_t*)pDst) = *((uint32_t*)pSrc);
       }
       pLineSrc += m_nStride;
       pLineDst += pImage->m_nStride;
@@ -213,9 +213,9 @@
   if (!m_pData || h <= m_nHeight) {
     return;
   }
-  FX_DWORD dwH = pdfium::base::checked_cast<FX_DWORD>(h);
-  FX_DWORD dwStride = pdfium::base::checked_cast<FX_DWORD>(m_nStride);
-  FX_DWORD dwHeight = pdfium::base::checked_cast<FX_DWORD>(m_nHeight);
+  uint32_t dwH = pdfium::base::checked_cast<uint32_t>(h);
+  uint32_t dwStride = pdfium::base::checked_cast<uint32_t>(m_nStride);
+  uint32_t dwHeight = pdfium::base::checked_cast<uint32_t>(m_nHeight);
   FX_SAFE_DWORD safeMemSize = dwH;
   safeMemSize *= dwStride;
   if (!safeMemSize.IsValid()) {
@@ -240,7 +240,7 @@
   int32_t xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0, xd0 = 0, yd0 = 0, xd1 = 0,
           yd1 = 0, xx = 0, yy = 0, w = 0, h = 0, middleDwords = 0, lineLeft = 0;
 
-  FX_DWORD s1 = 0, d1 = 0, d2 = 0, shift = 0, shift1 = 0, shift2 = 0, tmp = 0,
+  uint32_t s1 = 0, d1 = 0, d2 = 0, shift = 0, shift1 = 0, shift2 = 0, tmp = 0,
            tmp1 = 0, tmp2 = 0, maskL = 0, maskR = 0, maskM = 0;
 
   uint8_t *lineSrc = NULL, *lineDst = NULL, *sp = NULL, *dp = NULL;
@@ -700,11 +700,11 @@
   if ((xd0 & ~31) == ((xd1 - 1) & ~31)) {
     if ((xs0 & ~31) == ((xs1 - 1) & ~31)) {
       if (s1 > d1) {
-        FX_DWORD shift = s1 - d1;
+        uint32_t shift = s1 - d1;
         for (int32_t yy = yd0; yy < yd1; yy++) {
-          FX_DWORD tmp1 = JBIG2_GETDWORD(lineSrc) << shift;
-          FX_DWORD tmp2 = JBIG2_GETDWORD(lineDst);
-          FX_DWORD tmp = 0;
+          uint32_t tmp1 = JBIG2_GETDWORD(lineSrc) << shift;
+          uint32_t tmp2 = JBIG2_GETDWORD(lineDst);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
@@ -730,11 +730,11 @@
           lineDst += pDst->m_nStride;
         }
       } else {
-        FX_DWORD shift = d1 - s1;
+        uint32_t shift = d1 - s1;
         for (int32_t yy = yd0; yy < yd1; yy++) {
-          FX_DWORD tmp1 = JBIG2_GETDWORD(lineSrc) >> shift;
-          FX_DWORD tmp2 = JBIG2_GETDWORD(lineDst);
-          FX_DWORD tmp = 0;
+          uint32_t tmp1 = JBIG2_GETDWORD(lineSrc) >> shift;
+          uint32_t tmp2 = JBIG2_GETDWORD(lineDst);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
@@ -761,13 +761,13 @@
         }
       }
     } else {
-      FX_DWORD shift1 = s1 - d1;
-      FX_DWORD shift2 = 32 - shift1;
+      uint32_t shift1 = s1 - d1;
+      uint32_t shift2 = 32 - shift1;
       for (int32_t yy = yd0; yy < yd1; yy++) {
-        FX_DWORD tmp1 = (JBIG2_GETDWORD(lineSrc) << shift1) |
+        uint32_t tmp1 = (JBIG2_GETDWORD(lineSrc) << shift1) |
                         (JBIG2_GETDWORD(lineSrc + 4) >> shift2);
-        FX_DWORD tmp2 = JBIG2_GETDWORD(lineDst);
-        FX_DWORD tmp = 0;
+        uint32_t tmp2 = JBIG2_GETDWORD(lineDst);
+        uint32_t tmp = 0;
         switch (op) {
           case JBIG2_COMPOSE_OR:
             tmp = (tmp2 & ~maskM) | ((tmp1 | tmp2) & maskM);
@@ -795,17 +795,17 @@
     }
   } else {
     if (s1 > d1) {
-      FX_DWORD shift1 = s1 - d1;
-      FX_DWORD shift2 = 32 - shift1;
+      uint32_t shift1 = s1 - d1;
+      uint32_t shift2 = 32 - shift1;
       int32_t middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
       for (int32_t yy = yd0; yy < yd1; yy++) {
         uint8_t* sp = lineSrc;
         uint8_t* dp = lineDst;
         if (d1 != 0) {
-          FX_DWORD tmp1 = (JBIG2_GETDWORD(sp) << shift1) |
+          uint32_t tmp1 = (JBIG2_GETDWORD(sp) << shift1) |
                           (JBIG2_GETDWORD(sp + 4) >> shift2);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
@@ -831,10 +831,10 @@
           dp += 4;
         }
         for (int32_t xx = 0; xx < middleDwords; xx++) {
-          FX_DWORD tmp1 = (JBIG2_GETDWORD(sp) << shift1) |
+          uint32_t tmp1 = (JBIG2_GETDWORD(sp) << shift1) |
                           (JBIG2_GETDWORD(sp + 4) >> shift2);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = tmp1 | tmp2;
@@ -860,12 +860,12 @@
           dp += 4;
         }
         if (d2 != 0) {
-          FX_DWORD tmp1 =
+          uint32_t tmp1 =
               (JBIG2_GETDWORD(sp) << shift1) |
               (((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >>
                shift2);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
@@ -897,9 +897,9 @@
         uint8_t* sp = lineSrc;
         uint8_t* dp = lineDst;
         if (d1 != 0) {
-          FX_DWORD tmp1 = JBIG2_GETDWORD(sp);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp1 = JBIG2_GETDWORD(sp);
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
@@ -925,9 +925,9 @@
           dp += 4;
         }
         for (int32_t xx = 0; xx < middleDwords; xx++) {
-          FX_DWORD tmp1 = JBIG2_GETDWORD(sp);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp1 = JBIG2_GETDWORD(sp);
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = tmp1 | tmp2;
@@ -953,9 +953,9 @@
           dp += 4;
         }
         if (d2 != 0) {
-          FX_DWORD tmp1 = JBIG2_GETDWORD(sp);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp1 = JBIG2_GETDWORD(sp);
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
@@ -982,16 +982,16 @@
         lineDst += pDst->m_nStride;
       }
     } else {
-      FX_DWORD shift1 = d1 - s1;
-      FX_DWORD shift2 = 32 - shift1;
+      uint32_t shift1 = d1 - s1;
+      uint32_t shift2 = 32 - shift1;
       int32_t middleDwords = (xd1 >> 5) - ((xd0 + 31) >> 5);
       for (int32_t yy = yd0; yy < yd1; yy++) {
         uint8_t* sp = lineSrc;
         uint8_t* dp = lineDst;
         if (d1 != 0) {
-          FX_DWORD tmp1 = JBIG2_GETDWORD(sp) >> shift1;
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp1 = JBIG2_GETDWORD(sp) >> shift1;
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskL) | ((tmp1 | tmp2) & maskL);
@@ -1016,10 +1016,10 @@
           dp += 4;
         }
         for (int32_t xx = 0; xx < middleDwords; xx++) {
-          FX_DWORD tmp1 = (JBIG2_GETDWORD(sp) << shift2) |
+          uint32_t tmp1 = (JBIG2_GETDWORD(sp) << shift2) |
                           ((JBIG2_GETDWORD(sp + 4)) >> shift1);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = tmp1 | tmp2;
@@ -1045,12 +1045,12 @@
           dp += 4;
         }
         if (d2 != 0) {
-          FX_DWORD tmp1 =
+          uint32_t tmp1 =
               (JBIG2_GETDWORD(sp) << shift2) |
               (((sp + 4) < lineSrc + lineLeft ? JBIG2_GETDWORD(sp + 4) : 0) >>
                shift1);
-          FX_DWORD tmp2 = JBIG2_GETDWORD(dp);
-          FX_DWORD tmp = 0;
+          uint32_t tmp2 = JBIG2_GETDWORD(dp);
+          uint32_t tmp = 0;
           switch (op) {
             case JBIG2_COMPOSE_OR:
               tmp = (tmp2 & ~maskR) | ((tmp1 | tmp2) & maskR);
diff --git a/core/fxcodec/jbig2/JBig2_Page.h b/core/fxcodec/jbig2/JBig2_Page.h
index 6a33549..e9ffa76 100644
--- a/core/fxcodec/jbig2/JBig2_Page.h
+++ b/core/fxcodec/jbig2/JBig2_Page.h
@@ -10,10 +10,10 @@
 #include "core/fxcrt/include/fx_system.h"
 
 struct JBig2PageInfo {
-  FX_DWORD m_dwWidth;
-  FX_DWORD m_dwHeight;
-  FX_DWORD m_dwResolutionX;
-  FX_DWORD m_dwResolutionY;
+  uint32_t m_dwWidth;
+  uint32_t m_dwHeight;
+  uint32_t m_dwResolutionX;
+  uint32_t m_dwResolutionY;
   uint8_t m_cFlags;
   FX_BOOL m_bIsStriped;
   uint16_t m_wMaxStripeSize;
diff --git a/core/fxcodec/jbig2/JBig2_PatternDict.cpp b/core/fxcodec/jbig2/JBig2_PatternDict.cpp
index 3db672e..e74d836 100644
--- a/core/fxcodec/jbig2/JBig2_PatternDict.cpp
+++ b/core/fxcodec/jbig2/JBig2_PatternDict.cpp
@@ -15,7 +15,7 @@
 
 CJBig2_PatternDict::~CJBig2_PatternDict() {
   if (HDPATS) {
-    for (FX_DWORD i = 0; i < NUMPATS; i++) {
+    for (uint32_t i = 0; i < NUMPATS; i++) {
       delete HDPATS[i];
     }
     FX_Free(HDPATS);
diff --git a/core/fxcodec/jbig2/JBig2_PatternDict.h b/core/fxcodec/jbig2/JBig2_PatternDict.h
index 3196fca..dddd474 100644
--- a/core/fxcodec/jbig2/JBig2_PatternDict.h
+++ b/core/fxcodec/jbig2/JBig2_PatternDict.h
@@ -16,7 +16,7 @@
 
   ~CJBig2_PatternDict();
 
-  FX_DWORD NUMPATS;
+  uint32_t NUMPATS;
   CJBig2_Image** HDPATS;
 };
 
diff --git a/core/fxcodec/jbig2/JBig2_PddProc.cpp b/core/fxcodec/jbig2/JBig2_PddProc.cpp
index 5b67aad..12f66c3 100644
--- a/core/fxcodec/jbig2/JBig2_PddProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_PddProc.cpp
@@ -16,7 +16,7 @@
     CJBig2_ArithDecoder* pArithDecoder,
     JBig2ArithCtx* gbContext,
     IFX_Pause* pPause) {
-  FX_DWORD GRAY;
+  uint32_t GRAY;
   CJBig2_Image* BHDC = nullptr;
   std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict());
   pDict->NUMPATS = GRAYMAX + 1;
@@ -59,7 +59,7 @@
 
 CJBig2_PatternDict* CJBig2_PDDProc::decode_MMR(CJBig2_BitStream* pStream,
                                                IFX_Pause* pPause) {
-  FX_DWORD GRAY;
+  uint32_t GRAY;
   CJBig2_Image* BHDC = nullptr;
   std::unique_ptr<CJBig2_PatternDict> pDict(new CJBig2_PatternDict());
   pDict->NUMPATS = GRAYMAX + 1;
diff --git a/core/fxcodec/jbig2/JBig2_PddProc.h b/core/fxcodec/jbig2/JBig2_PddProc.h
index ce0089a..6bdd186 100644
--- a/core/fxcodec/jbig2/JBig2_PddProc.h
+++ b/core/fxcodec/jbig2/JBig2_PddProc.h
@@ -27,7 +27,7 @@
   FX_BOOL HDMMR;
   uint8_t HDPW;
   uint8_t HDPH;
-  FX_DWORD GRAYMAX;
+  uint32_t GRAYMAX;
   uint8_t HDTEMPLATE;
 };
 
diff --git a/core/fxcodec/jbig2/JBig2_SddProc.cpp b/core/fxcodec/jbig2/JBig2_SddProc.cpp
index 54c0bb9..81d7c89 100644
--- a/core/fxcodec/jbig2/JBig2_SddProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_SddProc.cpp
@@ -24,18 +24,18 @@
     std::vector<JBig2ArithCtx>* gbContext,
     std::vector<JBig2ArithCtx>* grContext) {
   CJBig2_Image** SDNEWSYMS;
-  FX_DWORD HCHEIGHT, NSYMSDECODED;
+  uint32_t HCHEIGHT, NSYMSDECODED;
   int32_t HCDH;
-  FX_DWORD SYMWIDTH, TOTWIDTH;
+  uint32_t SYMWIDTH, TOTWIDTH;
   int32_t DW;
   CJBig2_Image* BS;
-  FX_DWORD I, J, REFAGGNINST;
+  uint32_t I, J, REFAGGNINST;
   FX_BOOL* EXFLAGS;
-  FX_DWORD EXINDEX;
+  uint32_t EXINDEX;
   FX_BOOL CUREXFLAG;
-  FX_DWORD EXRUNLENGTH;
-  FX_DWORD nTmp;
-  FX_DWORD SBNUMSYMS;
+  uint32_t EXRUNLENGTH;
+  uint32_t nTmp;
+  uint32_t SBNUMSYMS;
   uint8_t SBSYMCODELEN;
   int32_t RDXI, RDYI;
   CJBig2_Image** SBSYMS;
@@ -55,7 +55,7 @@
   std::unique_ptr<CJBig2_ArithIntDecoder> IARDW(new CJBig2_ArithIntDecoder);
   std::unique_ptr<CJBig2_ArithIntDecoder> IARDH(new CJBig2_ArithIntDecoder);
   nTmp = 0;
-  while ((FX_DWORD)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) {
+  while ((uint32_t)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) {
     nTmp++;
   }
   IAID.reset(new CJBig2_ArithIaidDecoder((uint8_t)nTmp));
@@ -124,7 +124,7 @@
           pDecoder->SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
           SBNUMSYMS = pDecoder->SBNUMSYMS;
           nTmp = 0;
-          while ((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
+          while ((uint32_t)(1 << nTmp) < SBNUMSYMS) {
             nTmp++;
           }
           SBSYMCODELEN = (uint8_t)nTmp;
@@ -192,7 +192,7 @@
           FX_Free(SBSYMS);
         } else if (REFAGGNINST == 1) {
           SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
-          FX_DWORD IDI;
+          uint32_t IDI;
           IAID->decode(pArithDecoder, &IDI);
           IARDX->decode(pArithDecoder, &RDXI);
           IARDY->decode(pArithDecoder, &RDYI);
@@ -283,26 +283,26 @@
     std::vector<JBig2ArithCtx>* grContext,
     IFX_Pause* pPause) {
   CJBig2_Image** SDNEWSYMS;
-  FX_DWORD* SDNEWSYMWIDTHS;
-  FX_DWORD HCHEIGHT, NSYMSDECODED;
+  uint32_t* SDNEWSYMWIDTHS;
+  uint32_t HCHEIGHT, NSYMSDECODED;
   int32_t HCDH;
-  FX_DWORD SYMWIDTH, TOTWIDTH, HCFIRSTSYM;
+  uint32_t SYMWIDTH, TOTWIDTH, HCFIRSTSYM;
   int32_t DW;
   CJBig2_Image *BS, *BHC;
-  FX_DWORD I, J, REFAGGNINST;
+  uint32_t I, J, REFAGGNINST;
   FX_BOOL* EXFLAGS;
-  FX_DWORD EXINDEX;
+  uint32_t EXINDEX;
   FX_BOOL CUREXFLAG;
-  FX_DWORD EXRUNLENGTH;
+  uint32_t EXRUNLENGTH;
   int32_t nVal, nBits;
-  FX_DWORD nTmp;
-  FX_DWORD SBNUMSYMS;
+  uint32_t nTmp;
+  uint32_t SBNUMSYMS;
   uint8_t SBSYMCODELEN;
   JBig2HuffmanCode* SBSYMCODES;
-  FX_DWORD IDI;
+  uint32_t IDI;
   int32_t RDXI, RDYI;
-  FX_DWORD BMSIZE;
-  FX_DWORD stride;
+  uint32_t BMSIZE;
+  uint32_t stride;
   CJBig2_Image** SBSYMS;
   std::unique_ptr<CJBig2_HuffmanDecoder> pHuffmanDecoder(
       new CJBig2_HuffmanDecoder(pStream));
@@ -311,8 +311,8 @@
   SDNEWSYMWIDTHS = nullptr;
   BHC = nullptr;
   if (SDREFAGG == 0) {
-    SDNEWSYMWIDTHS = FX_Alloc(FX_DWORD, SDNUMNEWSYMS);
-    FXSYS_memset(SDNEWSYMWIDTHS, 0, SDNUMNEWSYMS * sizeof(FX_DWORD));
+    SDNEWSYMWIDTHS = FX_Alloc(uint32_t, SDNUMNEWSYMS);
+    FXSYS_memset(SDNEWSYMWIDTHS, 0, SDNUMNEWSYMS * sizeof(uint32_t));
   }
   std::unique_ptr<CJBig2_SymbolDict> pDict(new CJBig2_SymbolDict());
   std::unique_ptr<CJBig2_HuffmanTable> pTable;
@@ -370,7 +370,7 @@
           SBNUMSYMS = pDecoder->SBNUMSYMS;
           SBSYMCODES = FX_Alloc(JBig2HuffmanCode, SBNUMSYMS);
           nTmp = 1;
-          while ((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
+          while ((uint32_t)(1 << nTmp) < SBNUMSYMS) {
             nTmp++;
           }
           for (I = 0; I < SBNUMSYMS; I++) {
@@ -433,7 +433,7 @@
         } else if (REFAGGNINST == 1) {
           SBNUMSYMS = SDNUMINSYMS + SDNUMNEWSYMS;
           nTmp = 1;
-          while ((FX_DWORD)(1 << nTmp) < SBNUMSYMS) {
+          while ((uint32_t)(1 << nTmp) < SBNUMSYMS) {
             nTmp++;
           }
           SBSYMCODELEN = (uint8_t)nTmp;
@@ -499,7 +499,7 @@
           }
           pStream->alignByte();
           pStream->offset(2);
-          if ((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) {
+          if ((uint32_t)nVal != (pStream->getOffset() - nTmp)) {
             delete BS;
             FX_Free(SBSYMS);
             goto failed;
diff --git a/core/fxcodec/jbig2/JBig2_SddProc.h b/core/fxcodec/jbig2/JBig2_SddProc.h
index edfc372..4febc8d 100644
--- a/core/fxcodec/jbig2/JBig2_SddProc.h
+++ b/core/fxcodec/jbig2/JBig2_SddProc.h
@@ -32,10 +32,10 @@
  public:
   FX_BOOL SDHUFF;
   FX_BOOL SDREFAGG;
-  FX_DWORD SDNUMINSYMS;
+  uint32_t SDNUMINSYMS;
   CJBig2_Image** SDINSYMS;
-  FX_DWORD SDNUMNEWSYMS;
-  FX_DWORD SDNUMEXSYMS;
+  uint32_t SDNUMNEWSYMS;
+  uint32_t SDNUMEXSYMS;
   CJBig2_HuffmanTable* SDHUFFDH;
   CJBig2_HuffmanTable* SDHUFFDW;
   CJBig2_HuffmanTable* SDHUFFBMSIZE;
diff --git a/core/fxcodec/jbig2/JBig2_Segment.h b/core/fxcodec/jbig2/JBig2_Segment.h
index 61550ad..d89d652 100644
--- a/core/fxcodec/jbig2/JBig2_Segment.h
+++ b/core/fxcodec/jbig2/JBig2_Segment.h
@@ -35,7 +35,7 @@
 
   ~CJBig2_Segment();
 
-  FX_DWORD m_dwNumber;
+  uint32_t m_dwNumber;
   union {
     struct {
       uint8_t type : 6;
@@ -45,13 +45,13 @@
     uint8_t c;
   } m_cFlags;
   int32_t m_nReferred_to_segment_count;
-  FX_DWORD* m_pReferred_to_segment_numbers;
-  FX_DWORD m_dwPage_association;
-  FX_DWORD m_dwData_length;
+  uint32_t* m_pReferred_to_segment_numbers;
+  uint32_t m_dwPage_association;
+  uint32_t m_dwData_length;
 
-  FX_DWORD m_dwHeader_Length;
-  FX_DWORD m_dwObjNum;
-  FX_DWORD m_dwDataOffset;
+  uint32_t m_dwHeader_Length;
+  uint32_t m_dwObjNum;
+  uint32_t m_dwDataOffset;
   JBig2_SegmentState m_State;
   JBig2_ResultType m_nResultType;
   union {
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index 1a078a1..5b0ef19 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -25,7 +25,7 @@
 
   STRIPT *= SBSTRIPS;
   STRIPT = -STRIPT;
-  FX_DWORD NINSTANCES = 0;
+  uint32_t NINSTANCES = 0;
   while (NINSTANCES < SBNUMINSTANCES) {
     int32_t DT;
     if (pHuffmanDecoder->decodeAValue(SBHUFFDT, &DT) != 0)
@@ -58,8 +58,8 @@
       }
       uint8_t CURT = 0;
       if (SBSTRIPS != 1) {
-        FX_DWORD nTmp = 1;
-        while ((FX_DWORD)(1 << nTmp) < SBSTRIPS) {
+        uint32_t nTmp = 1;
+        while ((uint32_t)(1 << nTmp) < SBSTRIPS) {
           nTmp++;
         }
         int32_t nVal;
@@ -71,9 +71,9 @@
       int32_t TI = STRIPT + CURT;
       int32_t nVal = 0;
       int32_t nBits = 0;
-      FX_DWORD IDI;
+      uint32_t IDI;
       for (;;) {
-        FX_DWORD nTmp;
+        uint32_t nTmp;
         if (pStream->read1Bit(&nTmp) != 0)
           return nullptr;
 
@@ -109,13 +109,13 @@
           return nullptr;
         }
         pStream->alignByte();
-        FX_DWORD nTmp = pStream->getOffset();
+        uint32_t nTmp = pStream->getOffset();
         CJBig2_Image* IBOI = SBSYMS[IDI];
         if (!IBOI)
           return nullptr;
 
-        FX_DWORD WOI = IBOI->m_nWidth;
-        FX_DWORD HOI = IBOI->m_nHeight;
+        uint32_t WOI = IBOI->m_nWidth;
+        uint32_t HOI = IBOI->m_nHeight;
         if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0)
           return nullptr;
 
@@ -142,7 +142,7 @@
 
         pStream->alignByte();
         pStream->offset(2);
-        if ((FX_DWORD)nVal != (pStream->getOffset() - nTmp)) {
+        if ((uint32_t)nVal != (pStream->getOffset() - nTmp)) {
           delete IBI;
           return nullptr;
         }
@@ -150,8 +150,8 @@
       if (!IBI) {
         continue;
       }
-      FX_DWORD WI = IBI->m_nWidth;
-      FX_DWORD HI = IBI->m_nHeight;
+      uint32_t WI = IBI->m_nWidth;
+      uint32_t HI = IBI->m_nHeight;
       if (TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT) ||
                               (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
         CURS = CURS + WI - 1;
@@ -270,7 +270,7 @@
   STRIPT *= SBSTRIPS;
   STRIPT = -STRIPT;
   int32_t FIRSTS = 0;
-  FX_DWORD NINSTANCES = 0;
+  uint32_t NINSTANCES = 0;
   while (NINSTANCES < SBNUMINSTANCES) {
     int32_t CURS = 0;
     int32_t DT;
@@ -299,7 +299,7 @@
         pIAIT->decode(pArithDecoder, &CURT);
 
       int32_t TI = STRIPT + CURT;
-      FX_DWORD IDI;
+      uint32_t IDI;
       pIAID->decode(pArithDecoder, &IDI);
       if (IDI >= SBNUMSYMS)
         return nullptr;
@@ -324,8 +324,8 @@
         pIARDX->decode(pArithDecoder, &RDXI);
         pIARDY->decode(pArithDecoder, &RDYI);
         CJBig2_Image* IBOI = SBSYMS[IDI];
-        FX_DWORD WOI = IBOI->m_nWidth;
-        FX_DWORD HOI = IBOI->m_nHeight;
+        uint32_t WOI = IBOI->m_nWidth;
+        uint32_t HOI = IBOI->m_nHeight;
         if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0) {
           return nullptr;
         }
@@ -347,8 +347,8 @@
       if (!pIBI)
         return nullptr;
 
-      FX_DWORD WI = pIBI->m_nWidth;
-      FX_DWORD HI = pIBI->m_nHeight;
+      uint32_t WI = pIBI->m_nWidth;
+      uint32_t HI = pIBI->m_nHeight;
       if (TRANSPOSED == 0 && ((REFCORNER == JBIG2_CORNER_TOPRIGHT) ||
                               (REFCORNER == JBIG2_CORNER_BOTTOMRIGHT))) {
         CURS += WI - 1;
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.h b/core/fxcodec/jbig2/JBig2_TrdProc.h
index d73e012..fdad75f 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.h
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.h
@@ -50,11 +50,11 @@
  public:
   FX_BOOL SBHUFF;
   FX_BOOL SBREFINE;
-  FX_DWORD SBW;
-  FX_DWORD SBH;
-  FX_DWORD SBNUMINSTANCES;
-  FX_DWORD SBSTRIPS;
-  FX_DWORD SBNUMSYMS;
+  uint32_t SBW;
+  uint32_t SBH;
+  uint32_t SBNUMINSTANCES;
+  uint32_t SBSTRIPS;
+  uint32_t SBNUMSYMS;
 
   JBig2HuffmanCode* SBSYMCODES;
   uint8_t SBSYMCODELEN;
diff --git a/core/fxcodec/lbmp/fx_bmp.cpp b/core/fxcodec/lbmp/fx_bmp.cpp
index 90d8fe1..be5d93e 100644
--- a/core/fxcodec/lbmp/fx_bmp.cpp
+++ b/core/fxcodec/lbmp/fx_bmp.cpp
@@ -14,11 +14,11 @@
 const size_t kBmpInfoHeaderSize = 40;
 
 // TODO(thestig): Replace with FXDWORD_GET_LSBFIRST?
-FX_DWORD GetDWord_LSBFirst(uint8_t* p) {
+uint32_t GetDWord_LSBFirst(uint8_t* p) {
   return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
 }
 
-void SetDWord_LSBFirst(uint8_t* p, FX_DWORD v) {
+void SetDWord_LSBFirst(uint8_t* p, uint32_t v) {
   p[0] = (uint8_t)v;
   p[1] = (uint8_t)(v >> 8);
   p[2] = (uint8_t)(v >> 16);
@@ -65,7 +65,7 @@
   if (bmp_ptr == NULL) {
     return 0;
   }
-  FX_DWORD skip_size_org = bmp_ptr->skip_size;
+  uint32_t skip_size_org = bmp_ptr->skip_size;
   if (bmp_ptr->decode_status == BMP_D_STATUS_HEADER) {
     ASSERT(sizeof(BmpFileHeader) == 14);
     BmpFileHeader* bmp_header_ptr = NULL;
@@ -81,7 +81,7 @@
       bmp_error(bmp_ptr, "Not A Bmp Image");
       return 0;
     }
-    if (bmp_ptr->avail_in < sizeof(FX_DWORD)) {
+    if (bmp_ptr->avail_in < sizeof(uint32_t)) {
       bmp_ptr->skip_size = skip_size_org;
       return 2;
     }
@@ -182,7 +182,7 @@
       case 8:
       case 16:
       case 24: {
-        if (bmp_ptr->color_used > ((FX_DWORD)1) << bmp_ptr->bitCounts) {
+        if (bmp_ptr->color_used > ((uint32_t)1) << bmp_ptr->bitCounts) {
           bmp_error(bmp_ptr, "The Bmp File Is Corrupt");
           return 0;
         }
@@ -227,8 +227,8 @@
         bmp_error(bmp_ptr, "The Bmp File Is Corrupt");
         return 0;
       }
-      FX_DWORD* mask;
-      if (bmp_read_data(bmp_ptr, (uint8_t**)&mask, 3 * sizeof(FX_DWORD)) ==
+      uint32_t* mask;
+      if (bmp_read_data(bmp_ptr, (uint8_t**)&mask, 3 * sizeof(uint32_t)) ==
           NULL) {
         bmp_ptr->skip_size = skip_size_org;
         return 2;
@@ -259,14 +259,14 @@
         bmp_ptr->pal_num = bmp_ptr->color_used;
       }
       uint8_t* src_pal_ptr = NULL;
-      FX_DWORD src_pal_size = bmp_ptr->pal_num * (bmp_ptr->pal_type ? 3 : 4);
+      uint32_t src_pal_size = bmp_ptr->pal_num * (bmp_ptr->pal_type ? 3 : 4);
       if (bmp_read_data(bmp_ptr, (uint8_t**)&src_pal_ptr, src_pal_size) ==
           NULL) {
         bmp_ptr->skip_size = skip_size_org;
         return 2;
       }
       FX_Free(bmp_ptr->pal_ptr);
-      bmp_ptr->pal_ptr = FX_Alloc(FX_DWORD, bmp_ptr->pal_num);
+      bmp_ptr->pal_ptr = FX_Alloc(uint32_t, bmp_ptr->pal_num);
       int32_t src_pal_index = 0;
       if (bmp_ptr->pal_type == BMP_PAL_OLD) {
         while (src_pal_index < bmp_ptr->pal_num) {
@@ -388,7 +388,7 @@
   uint8_t* second_byte_ptr = NULL;
   bmp_ptr->col_num = 0;
   while (TRUE) {
-    FX_DWORD skip_size_org = bmp_ptr->skip_size;
+    uint32_t skip_size_org = bmp_ptr->skip_size;
     if (bmp_read_data(bmp_ptr, &first_byte_ptr, 1) == NULL) {
       return 2;
     }
@@ -490,7 +490,7 @@
   uint8_t* second_byte_ptr = NULL;
   bmp_ptr->col_num = 0;
   while (TRUE) {
-    FX_DWORD skip_size_org = bmp_ptr->skip_size;
+    uint32_t skip_size_org = bmp_ptr->skip_size;
     if (bmp_read_data(bmp_ptr, &first_byte_ptr, 1) == NULL) {
       return 2;
     }
@@ -608,7 +608,7 @@
 }
 uint8_t* bmp_read_data(bmp_decompress_struct_p bmp_ptr,
                        uint8_t** des_buf_pp,
-                       FX_DWORD data_size) {
+                       uint32_t data_size) {
   if (bmp_ptr == NULL || bmp_ptr->avail_in < bmp_ptr->skip_size + data_size) {
     return NULL;
   }
@@ -624,12 +624,12 @@
 }
 void bmp_input_buffer(bmp_decompress_struct_p bmp_ptr,
                       uint8_t* src_buf,
-                      FX_DWORD src_size) {
+                      uint32_t src_size) {
   bmp_ptr->next_in = src_buf;
   bmp_ptr->avail_in = src_size;
   bmp_ptr->skip_size = 0;
 }
-FX_DWORD bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr,
+uint32_t bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr,
                              uint8_t** avial_buf_ptr) {
   if (avial_buf_ptr) {
     *avial_buf_ptr = NULL;
@@ -656,7 +656,7 @@
   }
 }
 static void WriteFileHeader(BmpFileHeaderPtr head_ptr, uint8_t* dst_buf) {
-  FX_DWORD offset;
+  uint32_t offset;
   offset = 0;
   SetWord_LSBFirst(&dst_buf[offset], head_ptr->bfType);
   offset += 2;
@@ -670,7 +670,7 @@
   offset += 4;
 }
 static void WriteInfoHeader(BmpInfoHeaderPtr info_head_ptr, uint8_t* dst_buf) {
-  FX_DWORD offset;
+  uint32_t offset;
   offset = sizeof(BmpFileHeader);
   SetDWord_LSBFirst(&dst_buf[offset], info_head_ptr->biSize);
   offset += 4;
@@ -697,12 +697,12 @@
 }
 static void bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr,
                                  uint8_t*& dst_buf,
-                                 FX_DWORD& dst_size) {
+                                 uint32_t& dst_size) {
   if (bmp_ptr->info_header.biBitCount != 16 &&
       bmp_ptr->info_header.biBitCount != 32) {
     return;
   }
-  FX_DWORD size, dst_pos, i;
+  uint32_t size, dst_pos, i;
   size = bmp_ptr->src_pitch * bmp_ptr->src_row *
          bmp_ptr->info_header.biBitCount / 16;
   dst_pos = bmp_ptr->file_header.bfOffBits;
@@ -712,9 +712,9 @@
     return;
   }
   FXSYS_memset(&dst_buf[dst_pos], 0, size);
-  FX_DWORD mask_red;
-  FX_DWORD mask_green;
-  FX_DWORD mask_blue;
+  uint32_t mask_red;
+  uint32_t mask_green;
+  uint32_t mask_blue;
   mask_red = 0x7C00;
   mask_green = 0x03E0;
   mask_blue = 0x001F;
@@ -765,7 +765,7 @@
       if (bmp_ptr->src_bpp == 32) {
         i++;
       }
-      FX_DWORD pix_val = 0;
+      uint32_t pix_val = 0;
       pix_val |= (b >> blue_bits) & mask_blue;
       pix_val |= (g << green_bits) & mask_green;
       pix_val |= (r << red_bits) & mask_red;
@@ -783,13 +783,13 @@
 
 static void bmp_encode_rgb(bmp_compress_struct_p bmp_ptr,
                            uint8_t*& dst_buf,
-                           FX_DWORD& dst_size) {
+                           uint32_t& dst_size) {
   if (bmp_ptr->info_header.biBitCount == 16) {
     bmp_encode_bitfields(bmp_ptr, dst_buf, dst_size);
     return;
   }
-  FX_DWORD size, dst_pos;
-  FX_DWORD dst_pitch =
+  uint32_t size, dst_pos;
+  uint32_t dst_pitch =
       (bmp_ptr->src_width * bmp_ptr->info_header.biBitCount + 31) / 32 * 4;
   size = dst_pitch * bmp_ptr->src_row;
   dst_pos = bmp_ptr->file_header.bfOffBits;
@@ -820,8 +820,8 @@
 }
 static void bmp_encode_rle8(bmp_compress_struct_p bmp_ptr,
                             uint8_t*& dst_buf,
-                            FX_DWORD& dst_size) {
-  FX_DWORD size, dst_pos, index;
+                            uint32_t& dst_size) {
+  uint32_t size, dst_pos, index;
   uint8_t rle[2] = {0};
   size = bmp_ptr->src_pitch * bmp_ptr->src_row * 2;
   dst_pos = bmp_ptr->file_header.bfOffBits;
@@ -868,8 +868,8 @@
 }
 static void bmp_encode_rle4(bmp_compress_struct_p bmp_ptr,
                             uint8_t*& dst_buf,
-                            FX_DWORD& dst_size) {
-  FX_DWORD size, dst_pos, index;
+                            uint32_t& dst_size) {
+  uint32_t size, dst_pos, index;
   uint8_t rle[2] = {0};
   size = bmp_ptr->src_pitch * bmp_ptr->src_row;
   dst_pos = bmp_ptr->file_header.bfOffBits;
@@ -907,14 +907,14 @@
 }
 FX_BOOL bmp_encode_image(bmp_compress_struct_p bmp_ptr,
                          uint8_t*& dst_buf,
-                         FX_DWORD& dst_size) {
-  FX_DWORD head_size = sizeof(BmpFileHeader) + sizeof(BmpInfoHeader);
-  FX_DWORD pal_size = sizeof(FX_DWORD) * bmp_ptr->pal_num;
+                         uint32_t& dst_size) {
+  uint32_t head_size = sizeof(BmpFileHeader) + sizeof(BmpInfoHeader);
+  uint32_t pal_size = sizeof(uint32_t) * bmp_ptr->pal_num;
   if (bmp_ptr->info_header.biClrUsed > 0 &&
       bmp_ptr->info_header.biClrUsed < bmp_ptr->pal_num) {
-    pal_size = sizeof(FX_DWORD) * bmp_ptr->info_header.biClrUsed;
+    pal_size = sizeof(uint32_t) * bmp_ptr->info_header.biClrUsed;
   }
-  dst_size = head_size + sizeof(FX_DWORD) * bmp_ptr->pal_num;
+  dst_size = head_size + sizeof(uint32_t) * bmp_ptr->pal_num;
   dst_buf = FX_TryAlloc(uint8_t, dst_size);
   if (dst_buf == NULL) {
     return FALSE;
diff --git a/core/fxcodec/lbmp/fx_bmp.h b/core/fxcodec/lbmp/fx_bmp.h
index c0baf86..870eae4 100644
--- a/core/fxcodec/lbmp/fx_bmp.h
+++ b/core/fxcodec/lbmp/fx_bmp.h
@@ -13,7 +13,7 @@
 
 #define BMP_WIDTHBYTES(width, bitCount) ((width * bitCount) + 31) / 32 * 4
 #define BMP_PAL_ENCODE(a, r, g, b) \
-  (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
+  (((uint32_t)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
 #define BMP_D_STATUS_HEADER 0x01
 #define BMP_D_STATUS_PAL 0x02
 #define BMP_D_STATUS_DATA_PRE 0x03
@@ -36,30 +36,30 @@
 #pragma pack(1)
 typedef struct tagBmpFileHeader {
   uint16_t bfType;
-  FX_DWORD bfSize;
+  uint32_t bfSize;
   uint16_t bfReserved1;
   uint16_t bfReserved2;
-  FX_DWORD bfOffBits;
+  uint32_t bfOffBits;
 } BmpFileHeader, *BmpFileHeaderPtr;
 typedef struct tagBmpCoreHeader {
-  FX_DWORD bcSize;
+  uint32_t bcSize;
   uint16_t bcWidth;
   uint16_t bcHeight;
   uint16_t bcPlanes;
   uint16_t bcBitCount;
 } BmpCoreHeader, *BmpCoreHeaderPtr;
 typedef struct tagBmpInfoHeader {
-  FX_DWORD biSize;
+  uint32_t biSize;
   int32_t biWidth;
   int32_t biHeight;
   uint16_t biPlanes;
   uint16_t biBitCount;
-  FX_DWORD biCompression;
-  FX_DWORD biSizeImage;
+  uint32_t biCompression;
+  uint32_t biSizeImage;
   int32_t biXPelsPerMeter;
   int32_t biYPelsPerMeter;
-  FX_DWORD biClrUsed;
-  FX_DWORD biClrImportant;
+  uint32_t biClrUsed;
+  uint32_t biClrImportant;
 } BmpInfoHeader, *BmpInfoHeaderPtr;
 #pragma pack()
 
@@ -77,36 +77,36 @@
   BmpInfoHeaderPtr bmp_infoheader_ptr;
   int32_t width;
   int32_t height;
-  FX_DWORD compress_flag;
+  uint32_t compress_flag;
   int32_t components;
   int32_t src_row_bytes;
   int32_t out_row_bytes;
   uint8_t* out_row_buffer;
   uint16_t bitCounts;
-  FX_DWORD color_used;
+  uint32_t color_used;
   FX_BOOL imgTB_flag;
   int32_t pal_num;
   int32_t pal_type;
-  FX_DWORD* pal_ptr;
-  FX_DWORD data_size;
-  FX_DWORD img_data_offset;
-  FX_DWORD img_ifh_size;
+  uint32_t* pal_ptr;
+  uint32_t data_size;
+  uint32_t img_data_offset;
+  uint32_t img_ifh_size;
   int32_t row_num;
   int32_t col_num;
   int32_t dpi_x;
   int32_t dpi_y;
-  FX_DWORD mask_red;
-  FX_DWORD mask_green;
-  FX_DWORD mask_blue;
+  uint32_t mask_red;
+  uint32_t mask_green;
+  uint32_t mask_blue;
 
   FX_BOOL (*bmp_get_data_position_fn)(bmp_decompress_struct_p bmp_ptr,
-                                       FX_DWORD cur_pos);
+                                       uint32_t cur_pos);
   void (*bmp_get_row_fn)(bmp_decompress_struct_p bmp_ptr,
                          int32_t row_num,
                          uint8_t* row_buf);
   uint8_t* next_in;
-  FX_DWORD avail_in;
-  FX_DWORD skip_size;
+  uint32_t avail_in;
+  uint32_t skip_size;
   int32_t decode_status;
 };
 void bmp_error(bmp_decompress_struct_p bmp_ptr, const FX_CHAR* err_msg);
@@ -119,12 +119,12 @@
 int32_t bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr);
 uint8_t* bmp_read_data(bmp_decompress_struct_p bmp_ptr,
                        uint8_t** des_buf_pp,
-                       FX_DWORD data_size);
+                       uint32_t data_size);
 void bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, int32_t status);
 void bmp_input_buffer(bmp_decompress_struct_p bmp_ptr,
                       uint8_t* src_buf,
-                      FX_DWORD src_size);
-FX_DWORD bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr,
+                      uint32_t src_size);
+uint32_t bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr,
                              uint8_t** avial_buf_ptr);
 typedef struct tag_bmp_compress_struct bmp_compress_struct;
 typedef bmp_compress_struct* bmp_compress_struct_p;
@@ -133,12 +133,12 @@
   BmpFileHeader file_header;
   BmpInfoHeader info_header;
   uint8_t* src_buf;
-  FX_DWORD src_pitch;
-  FX_DWORD src_row;
+  uint32_t src_pitch;
+  uint32_t src_row;
   uint8_t src_bpp;
-  FX_DWORD src_width;
+  uint32_t src_width;
   FX_BOOL src_free;
-  FX_DWORD* pal_ptr;
+  uint32_t* pal_ptr;
   uint16_t pal_num;
   uint8_t bit_type;
 };
@@ -147,7 +147,7 @@
 void bmp_destroy_compress(bmp_compress_struct_p bmp_ptr);
 FX_BOOL bmp_encode_image(bmp_compress_struct_p bmp_ptr,
                          uint8_t*& dst_buf,
-                         FX_DWORD& dst_size);
+                         uint32_t& dst_size);
 
 uint16_t GetWord_LSBFirst(uint8_t* p);
 void SetWord_LSBFirst(uint8_t* p, uint16_t v);
diff --git a/core/fxcodec/lgif/fx_gif.cpp b/core/fxcodec/lgif/fx_gif.cpp
index b20b4df..059fa9a 100644
--- a/core/fxcodec/lgif/fx_gif.cpp
+++ b/core/fxcodec/lgif/fx_gif.cpp
@@ -8,11 +8,11 @@
 
 #include "core/fxcodec/lbmp/fx_bmp.h"
 
-void CGifLZWDecoder::Input(uint8_t* src_buf, FX_DWORD src_size) {
+void CGifLZWDecoder::Input(uint8_t* src_buf, uint32_t src_size) {
   next_in = src_buf;
   avail_in = src_size;
 }
-FX_DWORD CGifLZWDecoder::GetAvailInput() {
+uint32_t CGifLZWDecoder::GetAvailInput() {
   return avail_in;
 }
 void CGifLZWDecoder::InitTable(uint8_t code_len) {
@@ -62,11 +62,11 @@
     }
   }
 }
-int32_t CGifLZWDecoder::Decode(uint8_t* des_buf, FX_DWORD& des_size) {
+int32_t CGifLZWDecoder::Decode(uint8_t* des_buf, uint32_t& des_size) {
   if (des_size == 0) {
     return 3;
   }
-  FX_DWORD i = 0;
+  uint32_t i = 0;
   if (stack_size != 0) {
     if (des_size < stack_size) {
       FXSYS_memcpy(des_buf, &stack[GIF_MAX_LZW_CODE - stack_size], des_size);
@@ -145,10 +145,10 @@
   return 0;
 }
 static FX_BOOL gif_grow_buf(uint8_t*& dst_buf,
-                            FX_DWORD& dst_len,
-                            FX_DWORD size) {
+                            uint32_t& dst_len,
+                            uint32_t size) {
   if (dst_len < size) {
-    FX_DWORD len_org = dst_len;
+    uint32_t len_org = dst_len;
     while (dst_buf && dst_len < size) {
       dst_len <<= 1;
       dst_buf = FX_Realloc(uint8_t, dst_buf, dst_len);
@@ -166,18 +166,18 @@
   return TRUE;
 }
 static inline void gif_cut_index(uint8_t& val,
-                                 FX_DWORD index,
+                                 uint32_t index,
                                  uint8_t index_bit,
                                  uint8_t index_bit_use,
                                  uint8_t bit_use) {
-  FX_DWORD cut = ((1 << (index_bit - index_bit_use)) - 1) << index_bit_use;
+  uint32_t cut = ((1 << (index_bit - index_bit_use)) - 1) << index_bit_use;
   val |= ((index & cut) >> index_bit_use) << bit_use;
 }
 static inline uint8_t gif_cut_buf(const uint8_t* buf,
-                                  FX_DWORD& offset,
+                                  uint32_t& offset,
                                   uint8_t bit_cut,
                                   uint8_t& bit_offset,
-                                  FX_DWORD& bit_num) {
+                                  uint32_t& bit_num) {
   if (bit_cut != 8) {
     uint16_t index = 0;
     index |= ((1 << bit_cut) - 1) << (7 - bit_offset);
@@ -212,7 +212,7 @@
 void CGifLZWEncoder::Start(uint8_t code_len,
                            const uint8_t* src_buf,
                            uint8_t*& dst_buf,
-                           FX_DWORD& offset) {
+                           uint32_t& offset) {
   code_size = code_len + 1;
   src_bit_cut = code_size;
   if (code_len == 0) {
@@ -233,8 +233,8 @@
                                              src_bit_offset, src_bit_num);
 }
 void CGifLZWEncoder::WriteBlock(uint8_t*& dst_buf,
-                                FX_DWORD& dst_len,
-                                FX_DWORD& offset) {
+                                uint32_t& dst_len,
+                                uint32_t& offset) {
   if (!gif_grow_buf(dst_buf, dst_len, offset + GIF_DATA_BLOCK + 1)) {
     longjmp(jmp, 1);
   }
@@ -244,10 +244,10 @@
   FXSYS_memset(index_buf, 0, GIF_DATA_BLOCK);
   index_buf_len = 0;
 }
-void CGifLZWEncoder::EncodeString(FX_DWORD index,
+void CGifLZWEncoder::EncodeString(uint32_t index,
                                   uint8_t*& dst_buf,
-                                  FX_DWORD& dst_len,
-                                  FX_DWORD& offset) {
+                                  uint32_t& dst_len,
+                                  uint32_t& offset) {
   uint8_t index_bit_use;
   index_bit_use = 0;
   if (index_buf_len == GIF_DATA_BLOCK) {
@@ -302,10 +302,10 @@
   }
 }
 FX_BOOL CGifLZWEncoder::Encode(const uint8_t* src_buf,
-                               FX_DWORD src_len,
+                               uint32_t src_len,
                                uint8_t*& dst_buf,
-                               FX_DWORD& dst_len,
-                               FX_DWORD& offset) {
+                               uint32_t& dst_len,
+                               uint32_t& offset) {
   uint8_t suffix;
   if (setjmp(jmp)) {
     return FALSE;
@@ -333,7 +333,7 @@
   return TRUE;
 }
 FX_BOOL CGifLZWEncoder::LookUpInTable(const uint8_t* buf,
-                                      FX_DWORD& offset,
+                                      uint32_t& offset,
                                       uint8_t& bit_offset) {
   for (uint16_t i = table_cur; i < index_num; i++) {
     if (code_table[i].prefix == code_table[index_num].prefix &&
@@ -349,8 +349,8 @@
   return FALSE;
 }
 void CGifLZWEncoder::Finish(uint8_t*& dst_buf,
-                            FX_DWORD& dst_len,
-                            FX_DWORD& offset) {
+                            uint32_t& dst_len,
+                            uint32_t& offset) {
   EncodeString(code_table[index_num].prefix, dst_buf, dst_len, offset);
   EncodeString(code_end, dst_buf, dst_len, offset);
   bit_offset = 0;
@@ -491,7 +491,7 @@
   if (gif_ptr == NULL) {
     return 0;
   }
-  FX_DWORD skip_size_org = gif_ptr->skip_size;
+  uint32_t skip_size_org = gif_ptr->skip_size;
   ASSERT(sizeof(GifHeader) == 6);
   GifHeader* gif_header_ptr = NULL;
   if (gif_read_data(gif_ptr, (uint8_t**)&gif_header_ptr, 6) == NULL) {
@@ -600,7 +600,7 @@
       case GIF_D_STATUS_IMG_DATA: {
         uint8_t* data_size_ptr = NULL;
         uint8_t* data_ptr = NULL;
-        FX_DWORD skip_size_org = gif_ptr->skip_size;
+        uint32_t skip_size_org = gif_ptr->skip_size;
         if (gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) {
           return 2;
         }
@@ -640,7 +640,7 @@
 int32_t gif_decode_extension(gif_decompress_struct_p gif_ptr) {
   uint8_t* data_size_ptr = NULL;
   uint8_t* data_ptr = NULL;
-  FX_DWORD skip_size_org = gif_ptr->skip_size;
+  uint32_t skip_size_org = gif_ptr->skip_size;
   switch (gif_ptr->decode_status) {
     case GIF_D_STATUS_EXT_CE: {
       if (gif_read_data(gif_ptr, &data_size_ptr, 1) == NULL) {
@@ -751,7 +751,7 @@
     gif_error(gif_ptr, "No Image Header Info");
     return 0;
   }
-  FX_DWORD skip_size_org = gif_ptr->skip_size;
+  uint32_t skip_size_org = gif_ptr->skip_size;
   ASSERT(sizeof(GifImageInfo) == 9);
   GifImageInfo* gif_img_info_ptr = NULL;
   if (gif_read_data(gif_ptr, (uint8_t**)&gif_img_info_ptr, 9) == NULL) {
@@ -826,9 +826,9 @@
   }
   uint8_t* data_size_ptr = NULL;
   uint8_t* data_ptr = NULL;
-  FX_DWORD skip_size_org = gif_ptr->skip_size;
+  uint32_t skip_size_org = gif_ptr->skip_size;
   GifImage* gif_image_ptr = gif_ptr->img_ptr_arr_ptr->GetAt(frame_num);
-  FX_DWORD gif_img_row_bytes = gif_image_ptr->image_info_ptr->width;
+  uint32_t gif_img_row_bytes = gif_image_ptr->image_info_ptr->width;
   if (gif_ptr->decode_status == GIF_D_STATUS_TAIL) {
     if (gif_image_ptr->image_row_buf) {
       FX_Free(gif_image_ptr->image_row_buf);
@@ -991,7 +991,7 @@
 }
 uint8_t* gif_read_data(gif_decompress_struct_p gif_ptr,
                        uint8_t** des_buf_pp,
-                       FX_DWORD data_size) {
+                       uint32_t data_size) {
   if (gif_ptr == NULL || gif_ptr->avail_in < gif_ptr->skip_size + data_size) {
     return NULL;
   }
@@ -1001,12 +1001,12 @@
 }
 void gif_input_buffer(gif_decompress_struct_p gif_ptr,
                       uint8_t* src_buf,
-                      FX_DWORD src_size) {
+                      uint32_t src_size) {
   gif_ptr->next_in = src_buf;
   gif_ptr->avail_in = src_size;
   gif_ptr->skip_size = 0;
 }
-FX_DWORD gif_get_avail_input(gif_decompress_struct_p gif_ptr,
+uint32_t gif_get_avail_input(gif_decompress_struct_p gif_ptr,
                              uint8_t** avial_buf_ptr) {
   if (avial_buf_ptr) {
     *avial_buf_ptr = NULL;
@@ -1021,7 +1021,7 @@
 }
 static FX_BOOL gif_write_header(gif_compress_struct_p gif_ptr,
                                 uint8_t*& dst_buf,
-                                FX_DWORD& dst_len) {
+                                uint32_t& dst_len) {
   if (gif_ptr->cur_offset) {
     return TRUE;
   }
@@ -1050,10 +1050,10 @@
   }
   return TRUE;
 }
-void interlace_buf(const uint8_t* buf, FX_DWORD pitch, FX_DWORD height) {
+void interlace_buf(const uint8_t* buf, uint32_t pitch, uint32_t height) {
   CFX_ArrayTemplate<uint8_t*> pass[4];
   int i, j;
-  FX_DWORD row;
+  uint32_t row;
   row = 0;
   uint8_t* temp;
   while (row < height) {
@@ -1082,11 +1082,11 @@
   }
 }
 static void gif_write_block_data(const uint8_t* src_buf,
-                                 FX_DWORD src_len,
+                                 uint32_t src_len,
                                  uint8_t*& dst_buf,
-                                 FX_DWORD& dst_len,
-                                 FX_DWORD& dst_offset) {
-  FX_DWORD src_offset = 0;
+                                 uint32_t& dst_len,
+                                 uint32_t& dst_offset) {
+  uint32_t src_offset = 0;
   while (src_len > GIF_DATA_BLOCK) {
     dst_buf[dst_offset++] = GIF_DATA_BLOCK;
     FXSYS_memcpy(&dst_buf[dst_offset], &src_buf[src_offset], GIF_DATA_BLOCK);
@@ -1100,7 +1100,7 @@
 }
 static FX_BOOL gif_write_data(gif_compress_struct_p gif_ptr,
                               uint8_t*& dst_buf,
-                              FX_DWORD& dst_len) {
+                              uint32_t& dst_len) {
   if (!gif_grow_buf(dst_buf, dst_len, gif_ptr->cur_offset + GIF_DATA_BLOCK)) {
     return FALSE;
   }
@@ -1134,7 +1134,7 @@
   GifLF& lf = (GifLF&)gif_ptr->image_info_ptr->local_flag;
   dst_buf[gif_ptr->cur_offset++] = gif_ptr->image_info_ptr->local_flag;
   if (gif_ptr->local_pal) {
-    FX_DWORD pal_size = sizeof(GifPalette) * gif_ptr->lpal_num;
+    uint32_t pal_size = sizeof(GifPalette) * gif_ptr->lpal_num;
     if (!gif_grow_buf(dst_buf, dst_len, pal_size + gif_ptr->cur_offset)) {
       return FALSE;
     }
@@ -1152,7 +1152,7 @@
   }
   gif_ptr->img_encoder_ptr->Start(code_bit, gif_ptr->src_buf, dst_buf,
                                   gif_ptr->cur_offset);
-  FX_DWORD i;
+  uint32_t i;
   for (i = 0; i < gif_ptr->src_row; i++) {
     if (!gif_ptr->img_encoder_ptr->Encode(
             &gif_ptr->src_buf[i * gif_ptr->src_pitch],
@@ -1207,11 +1207,11 @@
 }
 FX_BOOL gif_encode(gif_compress_struct_p gif_ptr,
                    uint8_t*& dst_buf,
-                   FX_DWORD& dst_len) {
+                   uint32_t& dst_len) {
   if (!gif_write_header(gif_ptr, dst_buf, dst_len)) {
     return FALSE;
   }
-  FX_DWORD cur_offset = gif_ptr->cur_offset;
+  uint32_t cur_offset = gif_ptr->cur_offset;
   FX_BOOL res = TRUE;
   if (gif_ptr->frames) {
     gif_ptr->cur_offset--;
diff --git a/core/fxcodec/lgif/fx_gif.h b/core/fxcodec/lgif/fx_gif.h
index 5ed9ce1..47e5eeb 100644
--- a/core/fxcodec/lgif/fx_gif.h
+++ b/core/fxcodec/lgif/fx_gif.h
@@ -103,7 +103,7 @@
   GifPalette* local_pal_ptr;
   GifImageInfo* image_info_ptr;
   uint8_t image_code_size;
-  FX_DWORD image_data_pos;
+  uint32_t image_data_pos;
   uint8_t* image_row_buf;
   int32_t image_row_num;
 } GifImage;
@@ -121,10 +121,10 @@
   CGifLZWDecoder(FX_CHAR* error_ptr = NULL) { err_msg_ptr = error_ptr; }
   void InitTable(uint8_t code_len);
 
-  int32_t Decode(uint8_t* des_buf, FX_DWORD& des_size);
+  int32_t Decode(uint8_t* des_buf, uint32_t& des_size);
 
-  void Input(uint8_t* src_buf, FX_DWORD src_size);
-  FX_DWORD GetAvailInput();
+  void Input(uint8_t* src_buf, uint32_t src_size);
+  uint32_t GetAvailInput();
 
  private:
   void ClearTable();
@@ -142,10 +142,10 @@
   uint16_t code_old;
 
   uint8_t* next_in;
-  FX_DWORD avail_in;
+  uint32_t avail_in;
 
   uint8_t bits_left;
-  FX_DWORD code_store;
+  uint32_t code_store;
 
   FX_CHAR* err_msg_ptr;
 };
@@ -160,29 +160,29 @@
   void Start(uint8_t code_len,
              const uint8_t* src_buf,
              uint8_t*& dst_buf,
-             FX_DWORD& offset);
+             uint32_t& offset);
   FX_BOOL Encode(const uint8_t* src_buf,
-                 FX_DWORD src_len,
+                 uint32_t src_len,
                  uint8_t*& dst_buf,
-                 FX_DWORD& dst_len,
-                 FX_DWORD& offset);
-  void Finish(uint8_t*& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);
+                 uint32_t& dst_len,
+                 uint32_t& offset);
+  void Finish(uint8_t*& dst_buf, uint32_t& dst_len, uint32_t& offset);
 
  private:
   void ClearTable();
   FX_BOOL LookUpInTable(const uint8_t* buf,
-                        FX_DWORD& offset,
+                        uint32_t& offset,
                         uint8_t& bit_offset);
-  void EncodeString(FX_DWORD index,
+  void EncodeString(uint32_t index,
                     uint8_t*& dst_buf,
-                    FX_DWORD& dst_len,
-                    FX_DWORD& offset);
-  void WriteBlock(uint8_t*& dst_buf, FX_DWORD& dst_len, FX_DWORD& offset);
+                    uint32_t& dst_len,
+                    uint32_t& offset);
+  void WriteBlock(uint8_t*& dst_buf, uint32_t& dst_len, uint32_t& offset);
   jmp_buf jmp;
-  FX_DWORD src_offset;
+  uint32_t src_offset;
   uint8_t src_bit_offset;
   uint8_t src_bit_cut;
-  FX_DWORD src_bit_num;
+  uint32_t src_bit_num;
   uint8_t code_size;
   uint16_t code_clear;
   uint16_t code_end;
@@ -213,23 +213,23 @@
   uint8_t bc_index;
   uint8_t pixel_aspect;
   CGifLZWDecoder* img_decoder_ptr;
-  FX_DWORD img_row_offset;
-  FX_DWORD img_row_avail_size;
+  uint32_t img_row_offset;
+  uint32_t img_row_avail_size;
   uint8_t img_pass_num;
   CFX_ArrayTemplate<GifImage*>* img_ptr_arr_ptr;
   uint8_t* (*gif_ask_buf_for_pal_fn)(gif_decompress_struct_p gif_ptr,
                                      int32_t pal_size);
   uint8_t* next_in;
-  FX_DWORD avail_in;
+  uint32_t avail_in;
   int32_t decode_status;
-  FX_DWORD skip_size;
+  uint32_t skip_size;
   void (*gif_record_current_position_fn)(gif_decompress_struct_p gif_ptr,
-                                         FX_DWORD* cur_pos_ptr);
+                                         uint32_t* cur_pos_ptr);
   void (*gif_get_row_fn)(gif_decompress_struct_p gif_ptr,
                          int32_t row_num,
                          uint8_t* row_buf);
   FX_BOOL (*gif_get_record_position_fn)(gif_decompress_struct_p gif_ptr,
-            FX_DWORD cur_pos,
+            uint32_t cur_pos,
             int32_t left, int32_t top, int32_t width, int32_t height,
             int32_t pal_num, void* pal_ptr,
             int32_t delay_time, FX_BOOL user_input,
@@ -243,11 +243,11 @@
 typedef gif_compress_struct_p* gif_compress_struct_pp;
 struct tag_gif_compress_struct {
   const uint8_t* src_buf;
-  FX_DWORD src_pitch;
-  FX_DWORD src_width;
-  FX_DWORD src_row;
-  FX_DWORD cur_offset;
-  FX_DWORD frames;
+  uint32_t src_pitch;
+  uint32_t src_width;
+  uint32_t src_row;
+  uint32_t cur_offset;
+  uint32_t frames;
   GifHeader* header_ptr;
   GifLSD* lsd_ptr;
   GifPalette* global_pal;
@@ -258,11 +258,11 @@
   CGifLZWEncoder* img_encoder_ptr;
 
   uint8_t* cmt_data_ptr;
-  FX_DWORD cmt_data_len;
+  uint32_t cmt_data_len;
   GifGCE* gce_ptr;
   GifPTE* pte_ptr;
   const uint8_t* pte_data_ptr;
-  FX_DWORD pte_data_len;
+  uint32_t pte_data_len;
 };
 
 void gif_error(gif_decompress_struct_p gif_ptr, const FX_CHAR* err_msg);
@@ -281,16 +281,16 @@
 int32_t gif_load_frame(gif_decompress_struct_p gif_ptr, int32_t frame_num);
 uint8_t* gif_read_data(gif_decompress_struct_p gif_ptr,
                        uint8_t** des_buf_pp,
-                       FX_DWORD data_size);
+                       uint32_t data_size);
 void gif_save_decoding_status(gif_decompress_struct_p gif_ptr, int32_t status);
 void gif_input_buffer(gif_decompress_struct_p gif_ptr,
                       uint8_t* src_buf,
-                      FX_DWORD src_size);
-FX_DWORD gif_get_avail_input(gif_decompress_struct_p gif_ptr,
+                      uint32_t src_size);
+uint32_t gif_get_avail_input(gif_decompress_struct_p gif_ptr,
                              uint8_t** avial_buf_ptr);
-void interlace_buf(const uint8_t* buf, FX_DWORD width, FX_DWORD height);
+void interlace_buf(const uint8_t* buf, uint32_t width, uint32_t height);
 FX_BOOL gif_encode(gif_compress_struct_p gif_ptr,
                    uint8_t*& dst_buf,
-                   FX_DWORD& dst_len);
+                   uint32_t& dst_len);
 
 #endif  // CORE_FXCODEC_LGIF_FX_GIF_H_
diff --git a/core/fxcrt/extension.h b/core/fxcrt/extension.h
index 1789de3..a9f3c23 100644
--- a/core/fxcrt/extension.h
+++ b/core/fxcrt/extension.h
@@ -15,8 +15,8 @@
 class IFXCRT_FileAccess {
  public:
   virtual ~IFXCRT_FileAccess() {}
-  virtual FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) = 0;
-  virtual FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) = 0;
+  virtual FX_BOOL Open(const CFX_ByteStringC& fileName, uint32_t dwMode) = 0;
+  virtual FX_BOOL Open(const CFX_WideStringC& fileName, uint32_t dwMode) = 0;
   virtual void Close() = 0;
   virtual void Release() = 0;
   virtual FX_FILESIZE GetSize() const = 0;
@@ -51,7 +51,7 @@
 
   void GetPath(CFX_WideString& wsPath) override { wsPath = m_path; }
 
-  IFX_FileStream* CreateFileStream(FX_DWORD dwModes) override {
+  IFX_FileStream* CreateFileStream(uint32_t dwModes) override {
     return FX_CreateFileStream(m_path, dwModes);
   }
 
@@ -63,7 +63,7 @@
 
  protected:
   CFX_WideString m_path;
-  FX_DWORD m_RefCount;
+  uint32_t m_RefCount;
 };
 #endif  // PDF_ENABLE_XFA
 
@@ -87,7 +87,7 @@
 
  protected:
   IFXCRT_FileAccess* m_pFile;
-  FX_DWORD m_dwCount;
+  uint32_t m_dwCount;
 };
 
 #define FX_MEMSTREAM_BlockSize (64 * 1024)
@@ -129,7 +129,7 @@
     return this;
   }
   void Release() override {
-    FX_DWORD nCount = --m_dwCount;
+    uint32_t nCount = --m_dwCount;
     if (nCount) {
       return;
     }
@@ -282,12 +282,12 @@
 
  protected:
   CFX_ArrayTemplate<uint8_t*> m_Blocks;
-  FX_DWORD m_dwCount;
+  uint32_t m_dwCount;
   size_t m_nTotalSize;
   size_t m_nCurSize;
   size_t m_nCurPos;
   size_t m_nGrowSize;
-  FX_DWORD m_dwFlags;
+  uint32_t m_dwFlags;
   FX_BOOL ExpandBlocks(size_t size) {
     if (m_nCurSize < size) {
       m_nCurSize = size;
@@ -320,12 +320,12 @@
     mti = MT_N + 1;
     bHaveSeed = FALSE;
   }
-  FX_DWORD mti;
+  uint32_t mti;
   FX_BOOL bHaveSeed;
-  FX_DWORD mt[MT_N];
+  uint32_t mt[MT_N];
 };
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount);
+FX_BOOL FX_GenerateCryptoRandom(uint32_t* pBuffer, int32_t iCount);
 #endif
 #ifdef __cplusplus
 }
diff --git a/core/fxcrt/fx_arabic.cpp b/core/fxcrt/fx_arabic.cpp
index 10113c9..95fa8f5 100644
--- a/core/fxcrt/fx_arabic.cpp
+++ b/core/fxcrt/fx_arabic.cpp
@@ -149,7 +149,7 @@
   return new CFX_ArabicChar;
 }
 FX_BOOL CFX_ArabicChar::IsArabicChar(FX_WCHAR wch) const {
-  FX_DWORD dwRet =
+  uint32_t dwRet =
       kTextLayoutCodeProperties[(uint16_t)wch] & FX_CHARTYPEBITSMASK;
   return dwRet >= FX_CHARTYPE_ArabicAlef;
 }
diff --git a/core/fxcrt/fx_basic_bstring.cpp b/core/fxcrt/fx_basic_bstring.cpp
index 191694e..ab92996 100644
--- a/core/fxcrt/fx_basic_bstring.cpp
+++ b/core/fxcrt/fx_basic_bstring.cpp
@@ -11,14 +11,14 @@
 #include "core/fxcrt/include/fx_basic.h"
 #include "third_party/base/numerics/safe_math.h"
 
-static int _Buffer_itoa(char* buf, int i, FX_DWORD flags) {
+static int _Buffer_itoa(char* buf, int i, uint32_t flags) {
   if (i == 0) {
     buf[0] = '0';
     return 1;
   }
   char buf1[32];
   int buf_pos = 31;
-  FX_DWORD u = i;
+  uint32_t u = i;
   if ((flags & FXFORMAT_SIGNED) && i < 0) {
     u = -i;
   }
@@ -43,7 +43,7 @@
   }
   return len;
 }
-CFX_ByteString CFX_ByteString::FormatInteger(int i, FX_DWORD flags) {
+CFX_ByteString CFX_ByteString::FormatInteger(int i, uint32_t flags) {
   char buf[32];
   return CFX_ByteStringC(buf, _Buffer_itoa(buf, i, flags));
 }
@@ -1012,17 +1012,17 @@
 void CFX_ByteString::TrimLeft() {
   TrimLeft("\x09\x0a\x0b\x0c\x0d\x20");
 }
-FX_DWORD CFX_ByteString::GetID(FX_STRSIZE start_pos) const {
+uint32_t CFX_ByteString::GetID(FX_STRSIZE start_pos) const {
   return CFX_ByteStringC(*this).GetID(start_pos);
 }
-FX_DWORD CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const {
+uint32_t CFX_ByteStringC::GetID(FX_STRSIZE start_pos) const {
   if (m_Length == 0) {
     return 0;
   }
   if (start_pos < 0 || start_pos >= m_Length) {
     return 0;
   }
-  FX_DWORD strid = 0;
+  uint32_t strid = 0;
   if (start_pos + 4 > m_Length) {
     for (FX_STRSIZE i = 0; i < m_Length - start_pos; i++) {
       strid = strid * 256 + m_Ptr[start_pos + i];
diff --git a/core/fxcrt/fx_basic_buffer.cpp b/core/fxcrt/fx_basic_buffer.cpp
index aa899b6..28c8ac0 100644
--- a/core/fxcrt/fx_basic_buffer.cpp
+++ b/core/fxcrt/fx_basic_buffer.cpp
@@ -116,7 +116,7 @@
   return *this;
 }
 
-CFX_ByteTextBuf& CFX_ByteTextBuf::operator<<(FX_DWORD i) {
+CFX_ByteTextBuf& CFX_ByteTextBuf::operator<<(uint32_t i) {
   char buf[32];
   FXSYS_itoa(i, buf, 10);
   AppendBlock(buf, FXSYS_strlen(buf));
@@ -208,11 +208,11 @@
   }
   return *this;
 }
-CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(FX_DWORD i) {
+CFX_ArchiveSaver& CFX_ArchiveSaver::operator<<(uint32_t i) {
   if (m_pStream) {
-    m_pStream->WriteBlock(&i, sizeof(FX_DWORD));
+    m_pStream->WriteBlock(&i, sizeof(uint32_t));
   } else {
-    m_SavingBuf.AppendBlock(&i, sizeof(FX_DWORD));
+    m_SavingBuf.AppendBlock(&i, sizeof(uint32_t));
   }
   return *this;
 }
@@ -257,7 +257,7 @@
     m_SavingBuf.AppendBlock(pData, dwSize);
   }
 }
-CFX_ArchiveLoader::CFX_ArchiveLoader(const uint8_t* pData, FX_DWORD dwSize) {
+CFX_ArchiveLoader::CFX_ArchiveLoader(const uint8_t* pData, uint32_t dwSize) {
   m_pLoadingBuf = pData;
   m_LoadingPos = 0;
   m_LoadingSize = dwSize;
@@ -276,8 +276,8 @@
   Read(&i, sizeof(int));
   return *this;
 }
-CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(FX_DWORD& i) {
-  Read(&i, sizeof(FX_DWORD));
+CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(uint32_t& i) {
+  Read(&i, sizeof(uint32_t));
   return *this;
 }
 CFX_ArchiveLoader& CFX_ArchiveLoader::operator>>(FX_FLOAT& i) {
@@ -308,7 +308,7 @@
       encoded.GetLength() / sizeof(unsigned short));
   return *this;
 }
-FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, FX_DWORD dwSize) {
+FX_BOOL CFX_ArchiveLoader::Read(void* pBuf, uint32_t dwSize) {
   if (m_LoadingPos + dwSize > m_LoadingSize) {
     return FALSE;
   }
@@ -318,7 +318,7 @@
 }
 #endif  // PDF_ENABLE_XFA
 
-void CFX_BitStream::Init(const uint8_t* pData, FX_DWORD dwSize) {
+void CFX_BitStream::Init(const uint8_t* pData, uint32_t dwSize) {
   m_pData = pData;
   m_BitSize = dwSize * 8;
   m_BitPos = 0;
@@ -330,7 +330,7 @@
   }
   m_BitPos += 8 - mod;
 }
-FX_DWORD CFX_BitStream::GetBits(FX_DWORD nBits) {
+uint32_t CFX_BitStream::GetBits(uint32_t nBits) {
   if (nBits > m_BitSize || m_BitPos + nBits > m_BitSize) {
     return 0;
   }
@@ -339,9 +339,9 @@
     m_BitPos++;
     return bit;
   }
-  FX_DWORD byte_pos = m_BitPos / 8;
-  FX_DWORD bit_pos = m_BitPos % 8, bit_left = nBits;
-  FX_DWORD result = 0;
+  uint32_t byte_pos = m_BitPos / 8;
+  uint32_t bit_pos = m_BitPos % 8, bit_left = nBits;
+  uint32_t result = 0;
   if (bit_pos) {
     if (8 - bit_pos >= bit_left) {
       result =
@@ -412,7 +412,7 @@
   return AppendBlock(&byte, 1);
 }
 
-int32_t CFX_FileBufferArchive::AppendDWord(FX_DWORD i) {
+int32_t CFX_FileBufferArchive::AppendDWord(uint32_t i) {
   char buf[32];
   FXSYS_itoa(i, buf, 10);
   return AppendBlock(buf, (size_t)FXSYS_strlen(buf));
diff --git a/core/fxcrt/fx_basic_gcc.cpp b/core/fxcrt/fx_basic_gcc.cpp
index c29c995..1b2f01e 100644
--- a/core/fxcrt/fx_basic_gcc.cpp
+++ b/core/fxcrt/fx_basic_gcc.cpp
@@ -107,8 +107,8 @@
 int FXSYS_GetACP() {
   return 0;
 }
-FX_DWORD FXSYS_GetFullPathName(const FX_CHAR* filename,
-                               FX_DWORD buflen,
+uint32_t FXSYS_GetFullPathName(const FX_CHAR* filename,
+                               uint32_t buflen,
                                FX_CHAR* buf,
                                FX_CHAR** filepart) {
   int srclen = FXSYS_strlen(filename);
@@ -118,8 +118,8 @@
   FXSYS_strcpy(buf, filename);
   return srclen;
 }
-FX_DWORD FXSYS_GetModuleFileName(void* hModule, char* buf, FX_DWORD bufsize) {
-  return (FX_DWORD)-1;
+uint32_t FXSYS_GetModuleFileName(void* hModule, char* buf, uint32_t bufsize) {
+  return (uint32_t)-1;
 }
 #ifdef __cplusplus
 }
@@ -212,8 +212,8 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-int FXSYS_WideCharToMultiByte(FX_DWORD codepage,
-                              FX_DWORD dwFlags,
+int FXSYS_WideCharToMultiByte(uint32_t codepage,
+                              uint32_t dwFlags,
                               const FX_WCHAR* wstr,
                               int wlen,
                               FX_CHAR* buf,
@@ -231,8 +231,8 @@
   }
   return len;
 }
-int FXSYS_MultiByteToWideChar(FX_DWORD codepage,
-                              FX_DWORD dwFlags,
+int FXSYS_MultiByteToWideChar(uint32_t codepage,
+                              uint32_t dwFlags,
                               const FX_CHAR* bstr,
                               int blen,
                               FX_WCHAR* buf,
diff --git a/core/fxcrt/fx_basic_maps.cpp b/core/fxcrt/fx_basic_maps.cpp
index 935c998..660306b 100644
--- a/core/fxcrt/fx_basic_maps.cpp
+++ b/core/fxcrt/fx_basic_maps.cpp
@@ -28,8 +28,8 @@
   RemoveAll();
   ASSERT(m_nCount == 0);
 }
-FX_DWORD CFX_MapPtrToPtr::HashKey(void* key) const {
-  return ((FX_DWORD)(uintptr_t)key) >> 4;
+uint32_t CFX_MapPtrToPtr::HashKey(void* key) const {
+  return ((uint32_t)(uintptr_t)key) >> 4;
 }
 void CFX_MapPtrToPtr::GetNextAssoc(FX_POSITION& rNextPosition,
                                    void*& rKey,
@@ -38,7 +38,7 @@
   CAssoc* pAssocRet = (CAssoc*)rNextPosition;
   ASSERT(pAssocRet);
   if (pAssocRet == (CAssoc*)-1) {
-    for (FX_DWORD nBucket = 0; nBucket < m_nHashTableSize; nBucket++) {
+    for (uint32_t nBucket = 0; nBucket < m_nHashTableSize; nBucket++) {
       pAssocRet = m_pHashTable[nBucket];
       if (pAssocRet)
         break;
@@ -46,7 +46,7 @@
     ASSERT(pAssocRet);
   }
   CAssoc* pAssocNext = pAssocRet->pNext;
-  for (FX_DWORD nBucket = (HashKey(pAssocRet->key) % m_nHashTableSize) + 1;
+  for (uint32_t nBucket = (HashKey(pAssocRet->key) % m_nHashTableSize) + 1;
        nBucket < m_nHashTableSize && !pAssocNext; nBucket++) {
     pAssocNext = m_pHashTable[nBucket];
   }
@@ -55,7 +55,7 @@
   rValue = pAssocRet->value;
 }
 FX_BOOL CFX_MapPtrToPtr::Lookup(void* key, void*& rValue) const {
-  FX_DWORD nHash;
+  uint32_t nHash;
   CAssoc* pAssoc = GetAssocAt(key, nHash);
   if (!pAssoc) {
     return FALSE;
@@ -64,7 +64,7 @@
   return TRUE;
 }
 void* CFX_MapPtrToPtr::GetValueAt(void* key) const {
-  FX_DWORD nHash;
+  uint32_t nHash;
   CAssoc* pAssoc = GetAssocAt(key, nHash);
   if (!pAssoc) {
     return NULL;
@@ -72,7 +72,7 @@
   return pAssoc->value;
 }
 void*& CFX_MapPtrToPtr::operator[](void* key) {
-  FX_DWORD nHash;
+  uint32_t nHash;
   CAssoc* pAssoc;
   if ((pAssoc = GetAssocAt(key, nHash)) == NULL) {
     if (!m_pHashTable) {
@@ -86,7 +86,7 @@
   return pAssoc->value;
 }
 CFX_MapPtrToPtr::CAssoc* CFX_MapPtrToPtr::GetAssocAt(void* key,
-                                                     FX_DWORD& nHash) const {
+                                                     uint32_t& nHash) const {
   nHash = HashKey(key) % m_nHashTableSize;
   if (!m_pHashTable) {
     return NULL;
@@ -118,7 +118,7 @@
   pAssoc->value = 0;
   return pAssoc;
 }
-void CFX_MapPtrToPtr::InitHashTable(FX_DWORD nHashSize, FX_BOOL bAllocNow) {
+void CFX_MapPtrToPtr::InitHashTable(uint32_t nHashSize, FX_BOOL bAllocNow) {
   ASSERT(m_nCount == 0);
   ASSERT(nHashSize > 0);
   FX_Free(m_pHashTable);
diff --git a/core/fxcrt/fx_basic_plex.cpp b/core/fxcrt/fx_basic_plex.cpp
index 805f059..99cc700 100644
--- a/core/fxcrt/fx_basic_plex.cpp
+++ b/core/fxcrt/fx_basic_plex.cpp
@@ -8,8 +8,8 @@
 #include "core/fxcrt/plex.h"
 
 CFX_Plex* CFX_Plex::Create(CFX_Plex*& pHead,
-                           FX_DWORD nMax,
-                           FX_DWORD cbElement) {
+                           uint32_t nMax,
+                           uint32_t cbElement) {
   CFX_Plex* p =
       (CFX_Plex*)FX_Alloc(uint8_t, sizeof(CFX_Plex) + nMax * cbElement);
   p->pNext = pHead;
diff --git a/core/fxcrt/fx_basic_utf.cpp b/core/fxcrt/fx_basic_utf.cpp
index 08b9ca6..e199699 100644
--- a/core/fxcrt/fx_basic_utf.cpp
+++ b/core/fxcrt/fx_basic_utf.cpp
@@ -10,7 +10,7 @@
   m_Buffer.Clear();
   m_PendingBytes = 0;
 }
-void CFX_UTF8Decoder::AppendChar(FX_DWORD ch) {
+void CFX_UTF8Decoder::AppendChar(uint32_t ch) {
   m_Buffer.AppendChar((FX_WCHAR)ch);
 }
 void CFX_UTF8Decoder::Input(uint8_t byte) {
@@ -44,20 +44,20 @@
   }
 }
 void CFX_UTF8Encoder::Input(FX_WCHAR unicode) {
-  if ((FX_DWORD)unicode < 0x80) {
+  if ((uint32_t)unicode < 0x80) {
     m_Buffer.AppendChar(unicode);
   } else {
-    if ((FX_DWORD)unicode >= 0x80000000) {
+    if ((uint32_t)unicode >= 0x80000000) {
       return;
     }
     int nbytes = 0;
-    if ((FX_DWORD)unicode < 0x800) {
+    if ((uint32_t)unicode < 0x800) {
       nbytes = 2;
-    } else if ((FX_DWORD)unicode < 0x10000) {
+    } else if ((uint32_t)unicode < 0x10000) {
       nbytes = 3;
-    } else if ((FX_DWORD)unicode < 0x200000) {
+    } else if ((uint32_t)unicode < 0x200000) {
       nbytes = 4;
-    } else if ((FX_DWORD)unicode < 0x4000000) {
+    } else if ((uint32_t)unicode < 0x4000000) {
       nbytes = 5;
     } else {
       nbytes = 6;
diff --git a/core/fxcrt/fx_bidi.cpp b/core/fxcrt/fx_bidi.cpp
index 30b1a6d..d8a8f88 100644
--- a/core/fxcrt/fx_bidi.cpp
+++ b/core/fxcrt/fx_bidi.cpp
@@ -13,7 +13,7 @@
     : m_CurrentSegment({0, 0, NEUTRAL}), m_LastSegment({0, 0, NEUTRAL}) {}
 
 bool CFX_BidiChar::AppendChar(FX_WCHAR wch) {
-  FX_DWORD dwProps = FX_GetUnicodeProperties(wch);
+  uint32_t dwProps = FX_GetUnicodeProperties(wch);
   int32_t iBidiCls = (dwProps & FX_BIDICLASSBITSMASK) >> FX_BIDICLASSBITS;
   Direction direction = NEUTRAL;
   switch (iBidiCls) {
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index 9919085..7e8029b 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -29,7 +29,7 @@
 }
 
 void CFX_CRTFileStream::Release() {
-  FX_DWORD nCount = --m_dwCount;
+  uint32_t nCount = --m_dwCount;
   if (!nCount) {
     delete this;
   }
@@ -82,7 +82,7 @@
 }
 #endif  // PDF_ENABLE_XFA
 
-IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes) {
+IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, uint32_t dwModes) {
   IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create();
   if (!pFA) {
     return NULL;
@@ -94,7 +94,7 @@
   return new CFX_CRTFileStream(pFA);
 }
 IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename,
-                                    FX_DWORD dwModes) {
+                                    uint32_t dwModes) {
   IFXCRT_FileAccess* pFA = FXCRT_FileAccess_Create();
   if (!pFA) {
     return NULL;
@@ -217,7 +217,7 @@
   }
   return ch1 - ch2;
 }
-FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr,
+uint32_t FX_HashCode_String_GetA(const FX_CHAR* pStr,
                                  int32_t iLength,
                                  FX_BOOL bIgnoreCase) {
   FXSYS_assert(pStr);
@@ -225,7 +225,7 @@
     iLength = (int32_t)FXSYS_strlen(pStr);
   }
   const FX_CHAR* pStrEnd = pStr + iLength;
-  FX_DWORD dwHashCode = 0;
+  uint32_t dwHashCode = 0;
   if (bIgnoreCase) {
     while (pStr < pStrEnd) {
       dwHashCode = 31 * dwHashCode + FXSYS_tolower(*pStr++);
@@ -237,7 +237,7 @@
   }
   return dwHashCode;
 }
-FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr,
+uint32_t FX_HashCode_String_GetW(const FX_WCHAR* pStr,
                                  int32_t iLength,
                                  FX_BOOL bIgnoreCase) {
   FXSYS_assert(pStr);
@@ -245,7 +245,7 @@
     iLength = (int32_t)FXSYS_wcslen(pStr);
   }
   const FX_WCHAR* pStrEnd = pStr + iLength;
-  FX_DWORD dwHashCode = 0;
+  uint32_t dwHashCode = 0;
   if (bIgnoreCase) {
     while (pStr < pStrEnd) {
       dwHashCode = 1313 * dwHashCode + FXSYS_tolower(*pStr++);
@@ -258,29 +258,29 @@
   return dwHashCode;
 }
 
-void* FX_Random_MT_Start(FX_DWORD dwSeed) {
+void* FX_Random_MT_Start(uint32_t dwSeed) {
   FX_MTRANDOMCONTEXT* pContext = FX_Alloc(FX_MTRANDOMCONTEXT, 1);
   pContext->mt[0] = dwSeed;
-  FX_DWORD& i = pContext->mti;
-  FX_DWORD* pBuf = pContext->mt;
+  uint32_t& i = pContext->mti;
+  uint32_t* pBuf = pContext->mt;
   for (i = 1; i < MT_N; i++) {
     pBuf[i] = (1812433253UL * (pBuf[i - 1] ^ (pBuf[i - 1] >> 30)) + i);
   }
   pContext->bHaveSeed = TRUE;
   return pContext;
 }
-FX_DWORD FX_Random_MT_Generate(void* pContext) {
+uint32_t FX_Random_MT_Generate(void* pContext) {
   FXSYS_assert(pContext);
   FX_MTRANDOMCONTEXT* pMTC = static_cast<FX_MTRANDOMCONTEXT*>(pContext);
-  FX_DWORD v;
-  static FX_DWORD mag[2] = {0, MT_Matrix_A};
-  FX_DWORD& mti = pMTC->mti;
-  FX_DWORD* pBuf = pMTC->mt;
+  uint32_t v;
+  static uint32_t mag[2] = {0, MT_Matrix_A};
+  uint32_t& mti = pMTC->mti;
+  uint32_t* pBuf = pMTC->mt;
   if ((int)mti < 0 || mti >= MT_N) {
     if (mti > MT_N && !pMTC->bHaveSeed) {
       return 0;
     }
-    FX_DWORD kk;
+    uint32_t kk;
     for (kk = 0; kk < MT_N - MT_M; kk++) {
       v = (pBuf[kk] & MT_Upper_Mask) | (pBuf[kk + 1] & MT_Lower_Mask);
       pBuf[kk] = pBuf[kk + MT_M] ^ (v >> 1) ^ mag[v & 1];
@@ -304,8 +304,8 @@
   FXSYS_assert(pContext);
   FX_Free(pContext);
 }
-void FX_Random_GenerateMT(FX_DWORD* pBuffer, int32_t iCount) {
-  FX_DWORD dwSeed;
+void FX_Random_GenerateMT(uint32_t* pBuffer, int32_t iCount) {
+  uint32_t dwSeed;
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
   if (!FX_GenerateCryptoRandom(&dwSeed, 1)) {
     FX_Random_GenerateBase(&dwSeed, 1);
@@ -319,18 +319,18 @@
   }
   FX_Random_MT_Close(pContext);
 }
-void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount) {
+void FX_Random_GenerateBase(uint32_t* pBuffer, int32_t iCount) {
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
   SYSTEMTIME st1, st2;
   ::GetSystemTime(&st1);
   do {
     ::GetSystemTime(&st2);
   } while (FXSYS_memcmp(&st1, &st2, sizeof(SYSTEMTIME)) == 0);
-  FX_DWORD dwHash1 =
+  uint32_t dwHash1 =
       FX_HashCode_String_GetA((const FX_CHAR*)&st1, sizeof(st1), TRUE);
-  FX_DWORD dwHash2 =
+  uint32_t dwHash2 =
       FX_HashCode_String_GetA((const FX_CHAR*)&st2, sizeof(st2), TRUE);
-  ::srand((dwHash1 << 16) | (FX_DWORD)dwHash2);
+  ::srand((dwHash1 << 16) | (uint32_t)dwHash2);
 #else
   time_t tmLast = time(NULL);
   time_t tmCur;
@@ -341,21 +341,21 @@
   ::srand((tmCur << 16) | (tmLast & 0xFFFF));
 #endif
   while (iCount-- > 0) {
-    *pBuffer++ = (FX_DWORD)((::rand() << 16) | (::rand() & 0xFFFF));
+    *pBuffer++ = (uint32_t)((::rand() << 16) | (::rand() & 0xFFFF));
   }
 }
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
-FX_BOOL FX_GenerateCryptoRandom(FX_DWORD* pBuffer, int32_t iCount) {
+FX_BOOL FX_GenerateCryptoRandom(uint32_t* pBuffer, int32_t iCount) {
   HCRYPTPROV hCP = NULL;
   if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || !hCP) {
     return FALSE;
   }
-  ::CryptGenRandom(hCP, iCount * sizeof(FX_DWORD), (uint8_t*)pBuffer);
+  ::CryptGenRandom(hCP, iCount * sizeof(uint32_t), (uint8_t*)pBuffer);
   ::CryptReleaseContext(hCP, 0);
   return TRUE;
 }
 #endif
-void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount) {
+void FX_Random_GenerateCrypto(uint32_t* pBuffer, int32_t iCount) {
 #if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
   FX_GenerateCryptoRandom(pBuffer, iCount);
 #else
@@ -365,7 +365,7 @@
 
 #ifdef PDF_ENABLE_XFA
 void FX_GUID_CreateV4(FX_LPGUID pGUID) {
-  FX_Random_GenerateMT((FX_DWORD*)pGUID, 4);
+  FX_Random_GenerateMT((uint32_t*)pGUID, 4);
   uint8_t& b = ((uint8_t*)pGUID)[6];
   b = (b & 0x0F) | 0x40;
 }
diff --git a/core/fxcrt/fx_ucddata.cpp b/core/fxcrt/fx_ucddata.cpp
index 783d565..1567d45 100644
--- a/core/fxcrt/fx_ucddata.cpp
+++ b/core/fxcrt/fx_ucddata.cpp
@@ -7,7 +7,7 @@
 #include "core/fxcrt/include/fx_basic.h"
 #include "core/fxcrt/include/fx_ucd.h"
 
-const FX_DWORD kTextLayoutCodeProperties[] = {
+const uint32_t kTextLayoutCodeProperties[] = {
     0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93,
     0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe8ae5, 0xfffe9b5c, 0xfffe9ada,
     0xfffe9b1a, 0xfffe9b5b, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93, 0xfffe9a93,
diff --git a/core/fxcrt/fx_unicode.cpp b/core/fxcrt/fx_unicode.cpp
index 296ead8..d042283 100644
--- a/core/fxcrt/fx_unicode.cpp
+++ b/core/fxcrt/fx_unicode.cpp
@@ -6,7 +6,7 @@
 
 #include "core/fxcrt/include/fx_ucd.h"
 
-FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch) {
+uint32_t FX_GetUnicodeProperties(FX_WCHAR wch) {
   size_t idx = static_cast<size_t>(wch);
   if (idx < kTextLayoutCodePropertiesSize)
     return kTextLayoutCodeProperties[(uint16_t)wch];
@@ -15,14 +15,14 @@
 
 #ifdef PDF_ENABLE_XFA
 FX_BOOL FX_IsCtrlCode(FX_WCHAR ch) {
-  FX_DWORD dwRet = (FX_GetUnicodeProperties(ch) & FX_CHARTYPEBITSMASK);
+  uint32_t dwRet = (FX_GetUnicodeProperties(ch) & FX_CHARTYPEBITSMASK);
   return dwRet == FX_CHARTYPE_Tab || dwRet == FX_CHARTYPE_Control;
 }
 #endif  // PDF_ENABLE_XFA
 
 FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical) {
-  FX_DWORD dwProps = FX_GetUnicodeProperties(wch);
-  FX_DWORD dwTemp = (dwProps & 0xFF800000);
+  uint32_t dwProps = FX_GetUnicodeProperties(wch);
+  uint32_t dwTemp = (dwProps & 0xFF800000);
   if (bRTL && dwTemp < 0xFF800000) {
     size_t idx = dwTemp >> 23;
     if (idx < kFXTextLayoutBidiMirrorSize) {
@@ -43,10 +43,10 @@
 
 #ifdef PDF_ENABLE_XFA
 FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch,
-                          FX_DWORD dwProps,
+                          uint32_t dwProps,
                           FX_BOOL bRTL,
                           FX_BOOL bVertical) {
-  FX_DWORD dwTemp = (dwProps & 0xFF800000);
+  uint32_t dwTemp = (dwProps & 0xFF800000);
   if (bRTL && dwTemp < 0xFF800000) {
     size_t idx = dwTemp >> 23;
     if (idx < kFXTextLayoutBidiMirrorSize) {
diff --git a/core/fxcrt/fx_xml_parser.cpp b/core/fxcrt/fx_xml_parser.cpp
index 43f8c54..9cdf73c 100644
--- a/core/fxcrt/fx_xml_parser.cpp
+++ b/core/fxcrt/fx_xml_parser.cpp
@@ -179,7 +179,7 @@
   }
   m_dwIndex = m_dwBufferSize;
 }
-FX_DWORD CXML_Parser::GetCharRef() {
+uint32_t CXML_Parser::GetCharRef() {
   m_nOffset = m_nBufferOffset + (FX_FILESIZE)m_dwIndex;
   if (IsEOF()) {
     return 0;
@@ -187,7 +187,7 @@
   uint8_t ch;
   int32_t iState = 0;
   CFX_ByteTextBuf buf;
-  FX_DWORD code = 0;
+  uint32_t code = 0;
   do {
     while (m_dwIndex < m_dwBufferSize) {
       ch = m_pBuffer[m_dwIndex];
@@ -689,10 +689,10 @@
   }
   return FALSE;
 }
-CXML_Element::ChildType CXML_Element::GetChildType(FX_DWORD index) const {
+CXML_Element::ChildType CXML_Element::GetChildType(uint32_t index) const {
   return index < m_Children.size() ? m_Children[index].type : Invalid;
 }
-CFX_WideString CXML_Element::GetContent(FX_DWORD index) const {
+CFX_WideString CXML_Element::GetContent(uint32_t index) const {
   if (index < m_Children.size() && m_Children[index].type == Content) {
     CXML_Content* pContent =
         static_cast<CXML_Content*>(m_Children[index].child);
@@ -701,13 +701,13 @@
   }
   return CFX_WideString();
 }
-CXML_Element* CXML_Element::GetElement(FX_DWORD index) const {
+CXML_Element* CXML_Element::GetElement(uint32_t index) const {
   if (index < m_Children.size() && m_Children[index].type == Element) {
     return static_cast<CXML_Element*>(m_Children[index].child);
   }
   return nullptr;
 }
-FX_DWORD CXML_Element::CountElements(const CFX_ByteStringC& space,
+uint32_t CXML_Element::CountElements(const CFX_ByteStringC& space,
                                      const CFX_ByteStringC& tag) const {
   int count = 0;
   for (const ChildRecord& record : m_Children) {
@@ -741,7 +741,7 @@
   }
   return nullptr;
 }
-FX_DWORD CXML_Element::FindElement(CXML_Element* pChild) const {
+uint32_t CXML_Element::FindElement(CXML_Element* pChild) const {
   int index = 0;
   for (const ChildRecord& record : m_Children) {
     if (record.type == Element &&
@@ -750,7 +750,7 @@
     }
     ++index;
   }
-  return (FX_DWORD)-1;
+  return (uint32_t)-1;
 }
 
 bool CXML_AttrItem::Matches(const CFX_ByteStringC& space,
diff --git a/core/fxcrt/fxcrt_platforms.cpp b/core/fxcrt/fxcrt_platforms.cpp
index 4305c41..16e1a09 100644
--- a/core/fxcrt/fxcrt_platforms.cpp
+++ b/core/fxcrt/fxcrt_platforms.cpp
@@ -15,7 +15,7 @@
 IFXCRT_FileAccess* FXCRT_FileAccess_Create() {
   return new CFXCRT_FileAccess_CRT;
 }
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_ByteString& bsMode) {
+void FXCRT_GetFileModeString(uint32_t dwModes, CFX_ByteString& bsMode) {
   if (dwModes & FX_FILEMODE_ReadOnly) {
     bsMode = "rb";
   } else if (dwModes & FX_FILEMODE_Truncate) {
@@ -24,7 +24,7 @@
     bsMode = "a+b";
   }
 }
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_WideString& wsMode) {
+void FXCRT_GetFileModeString(uint32_t dwModes, CFX_WideString& wsMode) {
   if (dwModes & FX_FILEMODE_ReadOnly) {
     wsMode = FX_WSTRC(L"rb");
   } else if (dwModes & FX_FILEMODE_Truncate) {
@@ -38,7 +38,7 @@
   Close();
 }
 FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_ByteStringC& fileName,
-                                    FX_DWORD dwMode) {
+                                    uint32_t dwMode) {
   if (m_hFile) {
     return FALSE;
   }
@@ -48,7 +48,7 @@
   return m_hFile != NULL;
 }
 FX_BOOL CFXCRT_FileAccess_CRT::Open(const CFX_WideStringC& fileName,
-                                    FX_DWORD dwMode) {
+                                    uint32_t dwMode) {
   if (m_hFile) {
     return FALSE;
   }
diff --git a/core/fxcrt/fxcrt_platforms.h b/core/fxcrt/fxcrt_platforms.h
index 6bbebcb..736c116 100644
--- a/core/fxcrt/fxcrt_platforms.h
+++ b/core/fxcrt/fxcrt_platforms.h
@@ -10,16 +10,16 @@
 #include "core/fxcrt/extension.h"
 
 #if _FX_OS_ == _FX_ANDROID_
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_ByteString& bsMode);
-void FXCRT_GetFileModeString(FX_DWORD dwModes, CFX_WideString& wsMode);
+void FXCRT_GetFileModeString(uint32_t dwModes, CFX_ByteString& bsMode);
+void FXCRT_GetFileModeString(uint32_t dwModes, CFX_WideString& wsMode);
 class CFXCRT_FileAccess_CRT : public IFXCRT_FileAccess {
  public:
   CFXCRT_FileAccess_CRT();
   ~CFXCRT_FileAccess_CRT() override;
 
   // IFXCRT_FileAccess
-  FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) override;
-  FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) override;
+  FX_BOOL Open(const CFX_ByteStringC& fileName, uint32_t dwMode) override;
+  FX_BOOL Open(const CFX_WideStringC& fileName, uint32_t dwMode) override;
   void Close() override;
   void Release() override;
   FX_FILESIZE GetSize() const override;
diff --git a/core/fxcrt/fxcrt_posix.cpp b/core/fxcrt/fxcrt_posix.cpp
index 02556c1..2f17e71 100644
--- a/core/fxcrt/fxcrt_posix.cpp
+++ b/core/fxcrt/fxcrt_posix.cpp
@@ -14,7 +14,7 @@
 IFXCRT_FileAccess* FXCRT_FileAccess_Create() {
   return new CFXCRT_FileAccess_Posix;
 }
-void FXCRT_Posix_GetFileMode(FX_DWORD dwModes,
+void FXCRT_Posix_GetFileMode(uint32_t dwModes,
                              int32_t& nFlags,
                              int32_t& nMasks) {
   nFlags = O_BINARY | O_LARGEFILE;
@@ -34,7 +34,7 @@
   Close();
 }
 FX_BOOL CFXCRT_FileAccess_Posix::Open(const CFX_ByteStringC& fileName,
-                                      FX_DWORD dwMode) {
+                                      uint32_t dwMode) {
   if (m_nFD > -1) {
     return FALSE;
   }
@@ -44,7 +44,7 @@
   return m_nFD > -1;
 }
 FX_BOOL CFXCRT_FileAccess_Posix::Open(const CFX_WideStringC& fileName,
-                                      FX_DWORD dwMode) {
+                                      uint32_t dwMode) {
   return Open(FX_UTF8Encode(fileName), dwMode);
 }
 void CFXCRT_FileAccess_Posix::Close() {
diff --git a/core/fxcrt/fxcrt_posix.h b/core/fxcrt/fxcrt_posix.h
index cf5f634..969707a 100644
--- a/core/fxcrt/fxcrt_posix.h
+++ b/core/fxcrt/fxcrt_posix.h
@@ -18,8 +18,8 @@
   ~CFXCRT_FileAccess_Posix() override;
 
   // IFXCRT_FileAccess
-  FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) override;
-  FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) override;
+  FX_BOOL Open(const CFX_ByteStringC& fileName, uint32_t dwMode) override;
+  FX_BOOL Open(const CFX_WideStringC& fileName, uint32_t dwMode) override;
   void Close() override;
   void Release() override;
   FX_FILESIZE GetSize() const override;
diff --git a/core/fxcrt/fxcrt_windows.cpp b/core/fxcrt/fxcrt_windows.cpp
index 61c0eb6..340d225 100644
--- a/core/fxcrt/fxcrt_windows.cpp
+++ b/core/fxcrt/fxcrt_windows.cpp
@@ -12,10 +12,10 @@
 IFXCRT_FileAccess* FXCRT_FileAccess_Create() {
   return new CFXCRT_FileAccess_Win64;
 }
-void FXCRT_Windows_GetFileMode(FX_DWORD dwMode,
-                               FX_DWORD& dwAccess,
-                               FX_DWORD& dwShare,
-                               FX_DWORD& dwCreation) {
+void FXCRT_Windows_GetFileMode(uint32_t dwMode,
+                               uint32_t& dwAccess,
+                               uint32_t& dwShare,
+                               uint32_t& dwCreation) {
   dwAccess = GENERIC_READ;
   dwShare = FILE_SHARE_READ | FILE_SHARE_WRITE;
   if (!(dwMode & FX_FILEMODE_ReadOnly)) {
@@ -41,11 +41,11 @@
   Close();
 }
 FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_ByteStringC& fileName,
-                                      FX_DWORD dwMode) {
+                                      uint32_t dwMode) {
   if (m_hFile) {
     return FALSE;
   }
-  FX_DWORD dwAccess, dwShare, dwCreation;
+  uint32_t dwAccess, dwShare, dwCreation;
   FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
   m_hFile = ::CreateFileA(fileName.GetCStr(), dwAccess, dwShare, NULL,
                           dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -55,11 +55,11 @@
   return m_hFile != NULL;
 }
 FX_BOOL CFXCRT_FileAccess_Win64::Open(const CFX_WideStringC& fileName,
-                                      FX_DWORD dwMode) {
+                                      uint32_t dwMode) {
   if (m_hFile) {
     return FALSE;
   }
-  FX_DWORD dwAccess, dwShare, dwCreation;
+  uint32_t dwAccess, dwShare, dwCreation;
   FXCRT_Windows_GetFileMode(dwMode, dwAccess, dwShare, dwCreation);
   m_hFile = ::CreateFileW((LPCWSTR)fileName.GetPtr(), dwAccess, dwShare, NULL,
                           dwCreation, FILE_ATTRIBUTE_NORMAL, NULL);
diff --git a/core/fxcrt/fxcrt_windows.h b/core/fxcrt/fxcrt_windows.h
index 04a1a55..7444446 100644
--- a/core/fxcrt/fxcrt_windows.h
+++ b/core/fxcrt/fxcrt_windows.h
@@ -16,8 +16,8 @@
   ~CFXCRT_FileAccess_Win64() override;
 
   // IFXCRT_FileAccess
-  FX_BOOL Open(const CFX_ByteStringC& fileName, FX_DWORD dwMode) override;
-  FX_BOOL Open(const CFX_WideStringC& fileName, FX_DWORD dwMode) override;
+  FX_BOOL Open(const CFX_ByteStringC& fileName, uint32_t dwMode) override;
+  FX_BOOL Open(const CFX_WideStringC& fileName, uint32_t dwMode) override;
   void Close() override;
   void Release() override;
   FX_FILESIZE GetSize() const override;
diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h
index 4f2e83c..8a7afda 100644
--- a/core/fxcrt/include/fx_basic.h
+++ b/core/fxcrt/include/fx_basic.h
@@ -87,7 +87,7 @@
   CFX_ByteStringC GetByteString() const;
 
   CFX_ByteTextBuf& operator<<(int i);
-  CFX_ByteTextBuf& operator<<(FX_DWORD i);
+  CFX_ByteTextBuf& operator<<(uint32_t i);
   CFX_ByteTextBuf& operator<<(double f);
   CFX_ByteTextBuf& operator<<(const CFX_ByteStringC& lpsz);
   CFX_ByteTextBuf& operator<<(const CFX_ByteTextBuf& buf);
@@ -124,7 +124,7 @@
 
   CFX_ArchiveSaver& operator<<(int i);
 
-  CFX_ArchiveSaver& operator<<(FX_DWORD i);
+  CFX_ArchiveSaver& operator<<(uint32_t i);
 
   CFX_ArchiveSaver& operator<<(FX_FLOAT i);
 
@@ -151,13 +151,13 @@
 };
 class CFX_ArchiveLoader {
  public:
-  CFX_ArchiveLoader(const uint8_t* pData, FX_DWORD dwSize);
+  CFX_ArchiveLoader(const uint8_t* pData, uint32_t dwSize);
 
   CFX_ArchiveLoader& operator>>(uint8_t& i);
 
   CFX_ArchiveLoader& operator>>(int& i);
 
-  CFX_ArchiveLoader& operator>>(FX_DWORD& i);
+  CFX_ArchiveLoader& operator>>(uint32_t& i);
 
   CFX_ArchiveLoader& operator>>(FX_FLOAT& i);
 
@@ -169,14 +169,14 @@
 
   FX_BOOL IsEOF();
 
-  FX_BOOL Read(void* pBuf, FX_DWORD dwSize);
+  FX_BOOL Read(void* pBuf, uint32_t dwSize);
 
  protected:
-  FX_DWORD m_LoadingPos;
+  uint32_t m_LoadingPos;
 
   const uint8_t* m_pLoadingBuf;
 
-  FX_DWORD m_LoadingSize;
+  uint32_t m_LoadingSize;
 };
 #endif  // PDF_ENABLE_XFA
 
@@ -189,7 +189,7 @@
   bool Flush();
   int32_t AppendBlock(const void* pBuf, size_t size);
   int32_t AppendByte(uint8_t byte);
-  int32_t AppendDWord(FX_DWORD i);
+  int32_t AppendDWord(uint32_t i);
   int32_t AppendString(const CFX_ByteStringC& lpsz);
 
   // |pFile| must outlive the CFX_FileBufferArchive.
@@ -222,7 +222,7 @@
 
   void Input(uint8_t byte);
 
-  void AppendChar(FX_DWORD ch);
+  void AppendChar(uint32_t ch);
 
   void ClearStatus() { m_PendingBytes = 0; }
 
@@ -231,7 +231,7 @@
  protected:
   int m_PendingBytes;
 
-  FX_DWORD m_PendingChar;
+  uint32_t m_PendingChar;
 
   CFX_WideTextBuf m_Buffer;
 };
@@ -631,14 +631,14 @@
                     void*& rKey,
                     void*& rValue) const;
 
-  FX_DWORD GetHashTableSize() const { return m_nHashTableSize; }
+  uint32_t GetHashTableSize() const { return m_nHashTableSize; }
 
-  void InitHashTable(FX_DWORD hashSize, FX_BOOL bAllocNow = TRUE);
+  void InitHashTable(uint32_t hashSize, FX_BOOL bAllocNow = TRUE);
 
  protected:
   CAssoc** m_pHashTable;
 
-  FX_DWORD m_nHashTableSize;
+  uint32_t m_nHashTableSize;
 
   int m_nCount;
 
@@ -648,13 +648,13 @@
 
   int m_nBlockSize;
 
-  FX_DWORD HashKey(void* key) const;
+  uint32_t HashKey(void* key) const;
 
   CAssoc* NewAssoc();
 
   void FreeAssoc(CAssoc* pAssoc);
 
-  CAssoc* GetAssocAt(void* key, FX_DWORD& hash) const;
+  CAssoc* GetAssocAt(void* key, uint32_t& hash) const;
 };
 
 template <class KeyType, class ValueType>
@@ -792,8 +792,8 @@
     if (!module_id) {
       return FALSE;
     }
-    FX_DWORD nCount = m_DataList.GetSize();
-    for (FX_DWORD n = 0; n < nCount; n++) {
+    uint32_t nCount = m_DataList.GetSize();
+    for (uint32_t n = 0; n < nCount; n++) {
       if (m_DataList[n].m_pModuleId == module_id) {
         pData = m_DataList[n].m_pData;
         return TRUE;
@@ -815,28 +815,28 @@
 
 class CFX_BitStream {
  public:
-  void Init(const uint8_t* pData, FX_DWORD dwSize);
+  void Init(const uint8_t* pData, uint32_t dwSize);
 
-  FX_DWORD GetBits(FX_DWORD nBits);
+  uint32_t GetBits(uint32_t nBits);
 
   void ByteAlign();
 
   FX_BOOL IsEOF() { return m_BitPos >= m_BitSize; }
 
-  void SkipBits(FX_DWORD nBits) { m_BitPos += nBits; }
+  void SkipBits(uint32_t nBits) { m_BitPos += nBits; }
 
   void Rewind() { m_BitPos = 0; }
 
-  FX_DWORD GetPos() const { return m_BitPos; }
+  uint32_t GetPos() const { return m_BitPos; }
 
-  FX_DWORD BitsRemaining() const {
+  uint32_t BitsRemaining() const {
     return m_BitSize >= m_BitPos ? m_BitSize - m_BitPos : 0;
   }
 
  protected:
-  FX_DWORD m_BitPos;
+  uint32_t m_BitPos;
 
-  FX_DWORD m_BitSize;
+  uint32_t m_BitSize;
 
   const uint8_t* m_pData;
 };
@@ -1091,8 +1091,8 @@
 class IFX_Unknown {
  public:
   virtual ~IFX_Unknown() {}
-  virtual FX_DWORD Release() = 0;
-  virtual FX_DWORD AddRef() = 0;
+  virtual uint32_t Release() = 0;
+  virtual uint32_t AddRef() = 0;
 };
 #define FX_IsOdd(a) ((a)&1)
 #endif  // PDF_ENABLE_XFA
diff --git a/core/fxcrt/include/fx_ext.h b/core/fxcrt/include/fx_ext.h
index 2a39530..8492bc9 100644
--- a/core/fxcrt/include/fx_ext.h
+++ b/core/fxcrt/include/fx_ext.h
@@ -75,28 +75,28 @@
   return std::iswdigit(c) ? c - L'0' : 0;
 }
 
-FX_DWORD FX_HashCode_String_GetA(const FX_CHAR* pStr,
+uint32_t FX_HashCode_String_GetA(const FX_CHAR* pStr,
                                  int32_t iLength,
                                  FX_BOOL bIgnoreCase = FALSE);
-FX_DWORD FX_HashCode_String_GetW(const FX_WCHAR* pStr,
+uint32_t FX_HashCode_String_GetW(const FX_WCHAR* pStr,
                                  int32_t iLength,
                                  FX_BOOL bIgnoreCase = FALSE);
 
-void* FX_Random_MT_Start(FX_DWORD dwSeed);
+void* FX_Random_MT_Start(uint32_t dwSeed);
 
-FX_DWORD FX_Random_MT_Generate(void* pContext);
+uint32_t FX_Random_MT_Generate(void* pContext);
 
 void FX_Random_MT_Close(void* pContext);
 
-void FX_Random_GenerateBase(FX_DWORD* pBuffer, int32_t iCount);
+void FX_Random_GenerateBase(uint32_t* pBuffer, int32_t iCount);
 
-void FX_Random_GenerateMT(FX_DWORD* pBuffer, int32_t iCount);
+void FX_Random_GenerateMT(uint32_t* pBuffer, int32_t iCount);
 
-void FX_Random_GenerateCrypto(FX_DWORD* pBuffer, int32_t iCount);
+void FX_Random_GenerateCrypto(uint32_t* pBuffer, int32_t iCount);
 
 #ifdef PDF_ENABLE_XFA
 typedef struct FX_GUID {
-  FX_DWORD data1;
+  uint32_t data1;
   uint16_t data2;
   uint16_t data3;
   uint8_t data4[8];
diff --git a/core/fxcrt/include/fx_safe_types.h b/core/fxcrt/include/fx_safe_types.h
index 47eb55d..84ea55a 100644
--- a/core/fxcrt/include/fx_safe_types.h
+++ b/core/fxcrt/include/fx_safe_types.h
@@ -11,7 +11,7 @@
 #include "core/fxcrt/include/fx_system.h"
 #include "third_party/base/numerics/safe_math.h"
 
-typedef pdfium::base::CheckedNumeric<FX_DWORD> FX_SAFE_DWORD;
+typedef pdfium::base::CheckedNumeric<uint32_t> FX_SAFE_DWORD;
 typedef pdfium::base::CheckedNumeric<int32_t> FX_SAFE_INT32;
 typedef pdfium::base::CheckedNumeric<size_t> FX_SAFE_SIZE_T;
 typedef pdfium::base::CheckedNumeric<FX_FILESIZE> FX_SAFE_FILESIZE;
diff --git a/core/fxcrt/include/fx_stream.h b/core/fxcrt/include/fx_stream.h
index 4b77796..ba72994 100644
--- a/core/fxcrt/include/fx_stream.h
+++ b/core/fxcrt/include/fx_stream.h
@@ -114,8 +114,8 @@
   FX_BOOL Flush() override = 0;
 };
 
-IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, FX_DWORD dwModes);
-IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, FX_DWORD dwModes);
+IFX_FileStream* FX_CreateFileStream(const FX_CHAR* filename, uint32_t dwModes);
+IFX_FileStream* FX_CreateFileStream(const FX_WCHAR* filename, uint32_t dwModes);
 
 #ifdef PDF_ENABLE_XFA
 class IFX_FileAccess {
@@ -124,7 +124,7 @@
   virtual void Release() = 0;
   virtual IFX_FileAccess* Retain() = 0;
   virtual void GetPath(CFX_WideString& wsPath) = 0;
-  virtual IFX_FileStream* CreateFileStream(FX_DWORD dwModes) = 0;
+  virtual IFX_FileStream* CreateFileStream(uint32_t dwModes) = 0;
 };
 IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath);
 #endif  // PDF_ENABLE_XFA
diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h
index 4bca083..e5f9466 100644
--- a/core/fxcrt/include/fx_string.h
+++ b/core/fxcrt/include/fx_string.h
@@ -89,7 +89,7 @@
     return !(*this == other);
   }
 
-  FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
+  uint32_t GetID(FX_STRSIZE start_pos = 0) const;
 
   const uint8_t* GetPtr() const { return m_Ptr; }
 
@@ -296,13 +296,13 @@
 
   CFX_WideString UTF8Decode() const;
 
-  FX_DWORD GetID(FX_STRSIZE start_pos = 0) const;
+  uint32_t GetID(FX_STRSIZE start_pos = 0) const;
 
 #define FXFORMAT_SIGNED 1
 #define FXFORMAT_HEX 2
 #define FXFORMAT_CAPITAL 4
 
-  static CFX_ByteString FormatInteger(int i, FX_DWORD flags = 0);
+  static CFX_ByteString FormatInteger(int i, uint32_t flags = 0);
   static CFX_ByteString FormatFloat(FX_FLOAT f, int precision = 0);
 
  protected:
diff --git a/core/fxcrt/include/fx_system.h b/core/fxcrt/include/fx_system.h
index 1d51aec..22fdef2 100644
--- a/core/fxcrt/include/fx_system.h
+++ b/core/fxcrt/include/fx_system.h
@@ -68,7 +68,6 @@
 extern "C" {
 #endif
 typedef void* FX_POSITION;  // Keep until fxcrt containers gone
-typedef uint32_t FX_DWORD;  // Keep - "an efficient type"
 typedef float FX_FLOAT;     // Keep, allow upgrade to doubles.
 typedef double FX_DOUBLE;   // Keep, allow downgrade to floats.
 typedef int FX_BOOL;        // Keep, sadly not always 0 or 1.
@@ -209,25 +208,25 @@
 #else
 int FXSYS_GetACP(void);
 char* FXSYS_itoa(int value, char* str, int radix);
-int FXSYS_WideCharToMultiByte(FX_DWORD codepage,
-                              FX_DWORD dwFlags,
+int FXSYS_WideCharToMultiByte(uint32_t codepage,
+                              uint32_t dwFlags,
                               const wchar_t* wstr,
                               int wlen,
                               char* buf,
                               int buflen,
                               const char* default_str,
                               int* pUseDefault);
-int FXSYS_MultiByteToWideChar(FX_DWORD codepage,
-                              FX_DWORD dwFlags,
+int FXSYS_MultiByteToWideChar(uint32_t codepage,
+                              uint32_t dwFlags,
                               const char* bstr,
                               int blen,
                               wchar_t* buf,
                               int buflen);
-FX_DWORD FXSYS_GetFullPathName(const char* filename,
-                               FX_DWORD buflen,
+uint32_t FXSYS_GetFullPathName(const char* filename,
+                               uint32_t buflen,
                                char* buf,
                                char** filepart);
-FX_DWORD FXSYS_GetModuleFileName(void* hModule, char* buf, FX_DWORD bufsize);
+uint32_t FXSYS_GetModuleFileName(void* hModule, char* buf, uint32_t bufsize);
 char* FXSYS_strlwr(char* str);
 char* FXSYS_strupr(char* str);
 int FXSYS_stricmp(const char*, const char*);
@@ -254,11 +253,11 @@
 #define FXSYS_fmod(a, b) (FX_FLOAT) fmod(a, b)
 #define FXSYS_abs abs
 #define FXDWORD_GET_LSBFIRST(p)                                                \
-  ((static_cast<FX_DWORD>(p[3]) << 24) | (static_cast<FX_DWORD>(p[2]) << 16) | \
-   (static_cast<FX_DWORD>(p[1]) << 8) | (static_cast<FX_DWORD>(p[0])))
+  ((static_cast<uint32_t>(p[3]) << 24) | (static_cast<uint32_t>(p[2]) << 16) | \
+   (static_cast<uint32_t>(p[1]) << 8) | (static_cast<uint32_t>(p[0])))
 #define FXDWORD_GET_MSBFIRST(p)                                                \
-  ((static_cast<FX_DWORD>(p[0]) << 24) | (static_cast<FX_DWORD>(p[1]) << 16) | \
-   (static_cast<FX_DWORD>(p[2]) << 8) | (static_cast<FX_DWORD>(p[3])))
+  ((static_cast<uint32_t>(p[0]) << 24) | (static_cast<uint32_t>(p[1]) << 16) | \
+   (static_cast<uint32_t>(p[2]) << 8) | (static_cast<uint32_t>(p[3])))
 #define FXSYS_HIBYTE(word) ((uint8_t)((word) >> 8))
 #define FXSYS_LOBYTE(word) ((uint8_t)(word))
 #define FXSYS_HIWORD(dword) ((uint16_t)((dword) >> 16))
diff --git a/core/fxcrt/include/fx_ucd.h b/core/fxcrt/include/fx_ucd.h
index f2e4215..90f8948 100644
--- a/core/fxcrt/include/fx_ucd.h
+++ b/core/fxcrt/include/fx_ucd.h
@@ -35,7 +35,7 @@
   FX_BIDICLASS_N = FX_BIDICLASS_ON,
 };
 
-extern const FX_DWORD kTextLayoutCodeProperties[];
+extern const uint32_t kTextLayoutCodeProperties[];
 extern const size_t kTextLayoutCodePropertiesSize;
 
 extern const uint16_t kFXTextLayoutVerticalMirror[];
@@ -44,7 +44,7 @@
 extern const uint16_t kFXTextLayoutBidiMirror[];
 extern const size_t kFXTextLayoutBidiMirrorSize;
 
-FX_DWORD FX_GetUnicodeProperties(FX_WCHAR wch);
+uint32_t FX_GetUnicodeProperties(FX_WCHAR wch);
 FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch, FX_BOOL bRTL, FX_BOOL bVertical);
 
 #ifdef PDF_ENABLE_XFA
@@ -110,7 +110,7 @@
 
 FX_BOOL FX_IsCtrlCode(FX_WCHAR ch);
 FX_WCHAR FX_GetMirrorChar(FX_WCHAR wch,
-                          FX_DWORD dwProps,
+                          uint32_t dwProps,
                           FX_BOOL bRTL,
                           FX_BOOL bVertical);
 class CFX_Char {
@@ -124,7 +124,7 @@
         m_iCharWidth(0),
         m_iHorizontalScale(100),
         m_iVertialScale(100) {}
-  CFX_Char(uint16_t wCharCode, FX_DWORD dwCharProps)
+  CFX_Char(uint16_t wCharCode, uint32_t dwCharProps)
       : m_wCharCode(wCharCode),
         m_nBreakType(0),
         m_nRotation(0),
@@ -133,12 +133,12 @@
         m_iCharWidth(0),
         m_iHorizontalScale(100),
         m_iVertialScale(100) {}
-  FX_DWORD GetCharType() const { return m_dwCharProps & FX_CHARTYPEBITSMASK; }
+  uint32_t GetCharType() const { return m_dwCharProps & FX_CHARTYPEBITSMASK; }
   uint16_t m_wCharCode;
   uint8_t m_nBreakType;
   int8_t m_nRotation;
-  FX_DWORD m_dwCharProps;
-  FX_DWORD m_dwCharStyles;
+  uint32_t m_dwCharProps;
+  uint32_t m_dwCharStyles;
   int32_t m_iCharWidth;
   int32_t m_iHorizontalScale;
   int32_t m_iVertialScale;
@@ -154,7 +154,7 @@
         m_iBidiPos(0),
         m_iBidiOrder(0),
         m_pUserData(NULL) {}
-  FX_DWORD m_dwStatus;
+  uint32_t m_dwStatus;
   int16_t m_iBidiClass;
   int16_t m_iBidiLevel;
   int16_t m_iBidiPos;
@@ -175,15 +175,15 @@
         m_dwLayoutStyles(0),
         m_dwIdentity(0),
         m_pUserData(NULL) {}
-  FX_DWORD m_dwStatus;
+  uint32_t m_dwStatus;
   int32_t m_iFontSize;
   int32_t m_iFontHeight;
   int16_t m_iBidiClass;
   int16_t m_iBidiLevel;
   int16_t m_iBidiPos;
   int16_t m_iBidiOrder;
-  FX_DWORD m_dwLayoutStyles;
-  FX_DWORD m_dwIdentity;
+  uint32_t m_dwLayoutStyles;
+  uint32_t m_dwIdentity;
   IFX_Unknown* m_pUserData;
 };
 typedef CFX_ArrayTemplate<CFX_RTFChar> CFX_RTFCharArray;
diff --git a/core/fxcrt/include/fx_xml.h b/core/fxcrt/include/fx_xml.h
index 66add1b..3e22883 100644
--- a/core/fxcrt/include/fx_xml.h
+++ b/core/fxcrt/include/fx_xml.h
@@ -71,7 +71,7 @@
   CFX_ByteString GetNamespace(FX_BOOL bQualified = FALSE) const;
   CFX_ByteString GetNamespaceURI(const CFX_ByteStringC& qName) const;
   CXML_Element* GetParent() const { return m_pParent; }
-  FX_DWORD CountAttrs() const { return m_AttrMap.GetSize(); }
+  uint32_t CountAttrs() const { return m_AttrMap.GetSize(); }
   void GetAttrByIndex(int index,
                       CFX_ByteString& space,
                       CFX_ByteString& name,
@@ -129,26 +129,26 @@
     return attr;
   }
 
-  FX_DWORD CountChildren() const { return m_Children.size(); }
-  ChildType GetChildType(FX_DWORD index) const;
-  CFX_WideString GetContent(FX_DWORD index) const;
-  CXML_Element* GetElement(FX_DWORD index) const;
+  uint32_t CountChildren() const { return m_Children.size(); }
+  ChildType GetChildType(uint32_t index) const;
+  CFX_WideString GetContent(uint32_t index) const;
+  CXML_Element* GetElement(uint32_t index) const;
   CXML_Element* GetElement(const CFX_ByteStringC& space,
                            const CFX_ByteStringC& tag) const {
     return GetElement(space, tag, 0);
   }
 
-  FX_DWORD CountElements(const CFX_ByteStringC& space,
+  uint32_t CountElements(const CFX_ByteStringC& space,
                          const CFX_ByteStringC& tag) const;
   CXML_Element* GetElement(const CFX_ByteStringC& space,
                            const CFX_ByteStringC& tag,
                            int index) const;
 
-  FX_DWORD FindElement(CXML_Element* pChild) const;
+  uint32_t FindElement(CXML_Element* pChild) const;
   void SetTag(const CFX_ByteStringC& qSpace, const CFX_ByteStringC& tagname);
   void SetTag(const CFX_ByteStringC& qTagName);
   void RemoveChildren();
-  void RemoveChild(FX_DWORD index);
+  void RemoveChild(uint32_t index);
 
  protected:
   struct ChildRecord {
diff --git a/core/fxcrt/plex.h b/core/fxcrt/plex.h
index 8bb9607..5391566 100644
--- a/core/fxcrt/plex.h
+++ b/core/fxcrt/plex.h
@@ -12,7 +12,7 @@
 struct CFX_Plex {
   CFX_Plex* pNext;
   void* data() { return this + 1; }
-  static CFX_Plex* Create(CFX_Plex*& head, FX_DWORD nMax, FX_DWORD cbElement);
+  static CFX_Plex* Create(CFX_Plex*& head, uint32_t nMax, uint32_t cbElement);
   void FreeDataChain();
 };
 
diff --git a/core/fxcrt/xml_int.h b/core/fxcrt/xml_int.h
index 9a2c28c..2dae7b5 100644
--- a/core/fxcrt/xml_int.h
+++ b/core/fxcrt/xml_int.h
@@ -110,7 +110,7 @@
   void SkipWhiteSpaces();
   void GetName(CFX_ByteString& space, CFX_ByteString& name);
   void GetAttrValue(CFX_WideString& value);
-  FX_DWORD GetCharRef();
+  uint32_t GetCharRef();
   void GetTagName(CFX_ByteString& space,
                   CFX_ByteString& name,
                   FX_BOOL& bEndTag,
diff --git a/core/fxge/agg/fx_agg_driver.cpp b/core/fxge/agg/fx_agg_driver.cpp
index cd72865..8bda709 100644
--- a/core/fxge/agg/fx_agg_driver.cpp
+++ b/core/fxge/agg/fx_agg_driver.cpp
@@ -233,7 +233,7 @@
                                             CFX_FontCache* pCache,
                                             const CFX_Matrix* pObject2Device,
                                             FX_FLOAT font_size,
-                                            FX_DWORD color,
+                                            uint32_t color,
                                             int alpha_flag,
                                             void* pIccTransform) {
   return FALSE;
@@ -384,7 +384,7 @@
 class CFX_Renderer {
  private:
   int m_Alpha, m_Red, m_Green, m_Blue, m_Gray;
-  FX_DWORD m_Color;
+  uint32_t m_Color;
   FX_BOOL m_bFullCover;
   FX_BOOL m_bRgbByteOrder;
   CFX_DIBitmap* m_pOriDevice;
@@ -746,7 +746,7 @@
         }
         if (src_alpha) {
           if (src_alpha == 255) {
-            *(FX_DWORD*)dest_scan = m_Color;
+            *(uint32_t*)dest_scan = m_Color;
           } else {
             uint8_t dest_alpha =
                 dest_scan[3] + src_alpha - dest_scan[3] * src_alpha / 255;
@@ -782,7 +782,7 @@
       }
       if (src_alpha) {
         if (src_alpha == 255) {
-          *(FX_DWORD*)dest_scan = m_Color;
+          *(uint32_t*)dest_scan = m_Color;
         } else {
           if (dest_scan[3] == 0) {
             dest_scan[3] = src_alpha;
@@ -834,7 +834,7 @@
         if (src_alpha) {
           if (src_alpha == 255) {
             if (Bpp == 4) {
-              *(FX_DWORD*)dest_scan = m_Color;
+              *(uint32_t*)dest_scan = m_Color;
             } else if (Bpp == 3) {
               *dest_scan++ = m_Red;
               *dest_scan++ = m_Green;
@@ -914,7 +914,7 @@
         if (src_alpha) {
           if (src_alpha == 255) {
             if (Bpp == 4) {
-              *(FX_DWORD*)dest_scan = m_Color;
+              *(uint32_t*)dest_scan = m_Color;
             } else if (Bpp == 3) {
               *dest_scan++ = m_Blue;
               *dest_scan++ = m_Green;
@@ -1081,7 +1081,7 @@
   FX_BOOL Init(CFX_DIBitmap* pDevice,
                CFX_DIBitmap* pOriDevice,
                const CFX_ClipRgn* pClipRgn,
-               FX_DWORD color,
+               uint32_t color,
                FX_BOOL bFullCover,
                FX_BOOL bRgbByteOrder,
                int alpha_flag = 0,
@@ -1211,7 +1211,7 @@
 
 FX_BOOL CFX_AggDeviceDriver::RenderRasterizer(
     agg::rasterizer_scanline_aa& rasterizer,
-    FX_DWORD color,
+    uint32_t color,
     FX_BOOL bFullCover,
     FX_BOOL bGroupKnockout,
     int alpha_flag,
@@ -1231,8 +1231,8 @@
 FX_BOOL CFX_AggDeviceDriver::DrawPath(const CFX_PathData* pPathData,
                                       const CFX_Matrix* pObject2Device,
                                       const CFX_GraphStateData* pGraphState,
-                                      FX_DWORD fill_color,
-                                      FX_DWORD stroke_color,
+                                      uint32_t fill_color,
+                                      uint32_t stroke_color,
                                       int fill_mode,
                                       int alpha_flag,
                                       void* pIccTransform,
@@ -1312,7 +1312,7 @@
   return TRUE;
 }
 
-void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, FX_DWORD argb) {
+void RgbByteOrderSetPixel(CFX_DIBitmap* pBitmap, int x, int y, uint32_t argb) {
   if (x < 0 || x >= pBitmap->GetWidth() || y < 0 || y >= pBitmap->GetHeight()) {
     return;
   }
@@ -1351,7 +1351,7 @@
       uint8_t* dest_scan =
           pBuffer + row * pBitmap->GetPitch() + rect.left * Bpp;
       if (Bpp == 4) {
-        FX_DWORD* scan = (FX_DWORD*)dest_scan;
+        uint32_t* scan = (uint32_t*)dest_scan;
         for (int col = 0; col < width; col++) {
           *scan++ = dib_argb;
         }
@@ -1523,7 +1523,7 @@
 FX_BOOL _DibSetPixel(CFX_DIBitmap* pDevice,
                      int x,
                      int y,
-                     FX_DWORD color,
+                     uint32_t color,
                      int alpha_flag,
                      void* pIccTransform) {
   FX_BOOL bObjCMYK = FXGETFLAG_COLORTYPE(alpha_flag);
@@ -1558,7 +1558,7 @@
 
 FX_BOOL CFX_AggDeviceDriver::SetPixel(int x,
                                       int y,
-                                      FX_DWORD color,
+                                      uint32_t color,
                                       int alpha_flag,
                                       void* pIccTransform) {
   if (!m_pBitmap->GetBuffer()) {
@@ -1604,7 +1604,7 @@
 }
 
 FX_BOOL CFX_AggDeviceDriver::FillRect(const FX_RECT* pRect,
-                                      FX_DWORD fill_color,
+                                      uint32_t fill_color,
                                       int alpha_flag,
                                       void* pIccTransform,
                                       int blend_type) {
@@ -1704,7 +1704,7 @@
 }
 
 FX_BOOL CFX_AggDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
-                                       FX_DWORD argb,
+                                       uint32_t argb,
                                        const FX_RECT* pSrcRect,
                                        int left,
                                        int top,
@@ -1725,13 +1725,13 @@
 }
 
 FX_BOOL CFX_AggDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource,
-                                           FX_DWORD argb,
+                                           uint32_t argb,
                                            int dest_left,
                                            int dest_top,
                                            int dest_width,
                                            int dest_height,
                                            const FX_RECT* pClipRect,
-                                           FX_DWORD flags,
+                                           uint32_t flags,
                                            int alpha_flag,
                                            void* pIccTransform,
                                            int blend_type) {
@@ -1764,9 +1764,9 @@
 
 FX_BOOL CFX_AggDeviceDriver::StartDIBits(const CFX_DIBSource* pSource,
                                          int bitmap_alpha,
-                                         FX_DWORD argb,
+                                         uint32_t argb,
                                          const CFX_Matrix* pMatrix,
-                                         FX_DWORD render_flags,
+                                         uint32_t render_flags,
                                          void*& handle,
                                          int alpha_flag,
                                          void* pIccTransform,
diff --git a/core/fxge/agg/fx_agg_driver.h b/core/fxge/agg/fx_agg_driver.h
index 2b6b668..5bc9283 100644
--- a/core/fxge/agg/fx_agg_driver.h
+++ b/core/fxge/agg/fx_agg_driver.h
@@ -50,19 +50,19 @@
   FX_BOOL DrawPath(const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_color,
-                   FX_DWORD stroke_color,
+                   uint32_t fill_color,
+                   uint32_t stroke_color,
                    int fill_mode,
                    int alpha_flag,
                    void* pIccTransform,
                    int blend_type) override;
   FX_BOOL SetPixel(int x,
                    int y,
-                   FX_DWORD color,
+                   uint32_t color,
                    int alpha_flag,
                    void* pIccTransform) override;
   FX_BOOL FillRect(const FX_RECT* pRect,
-                   FX_DWORD fill_color,
+                   uint32_t fill_color,
                    int alpha_flag,
                    void* pIccTransform,
                    int blend_type) override;
@@ -70,7 +70,7 @@
                            FX_FLOAT y1,
                            FX_FLOAT x2,
                            FX_FLOAT y2,
-                           FX_DWORD color,
+                           uint32_t color,
                            int alpha_flag,
                            void* pIccTransform,
                            int blend_type) override {
@@ -84,7 +84,7 @@
                     FX_BOOL bDEdge = FALSE) override;
   CFX_DIBitmap* GetBackDrop() override { return m_pOriDevice; }
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                    FX_DWORD color,
+                    uint32_t color,
                     const FX_RECT* pSrcRect,
                     int left,
                     int top,
@@ -92,21 +92,21 @@
                     int alpha_flag,
                     void* pIccTransform) override;
   FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                        FX_DWORD color,
+                        uint32_t color,
                         int dest_left,
                         int dest_top,
                         int dest_width,
                         int dest_height,
                         const FX_RECT* pClipRect,
-                        FX_DWORD flags,
+                        uint32_t flags,
                         int alpha_flag,
                         void* pIccTransform,
                         int blend_type) override;
   FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                       int bitmap_alpha,
-                      FX_DWORD color,
+                      uint32_t color,
                       const CFX_Matrix* pMatrix,
-                      FX_DWORD flags,
+                      uint32_t flags,
                       void*& handle,
                       int alpha_flag,
                       void* pIccTransform,
@@ -119,13 +119,13 @@
                          CFX_FontCache* pCache,
                          const CFX_Matrix* pObject2Device,
                          FX_FLOAT font_size,
-                         FX_DWORD color,
+                         uint32_t color,
                          int alpha_flag,
                          void* pIccTransform) override;
   int GetDriverType() const override { return 1; }
 
   FX_BOOL RenderRasterizer(agg::rasterizer_scanline_aa& rasterizer,
-                           FX_DWORD color,
+                           uint32_t color,
                            FX_BOOL bFullCover,
                            FX_BOOL bGroupKnockout,
                            int alpha_flag,
diff --git a/core/fxge/android/fpf_skiafont.cpp b/core/fxge/android/fpf_skiafont.cpp
index 58b937f..bd9b549 100644
--- a/core/fxge/android/fpf_skiafont.cpp
+++ b/core/fxge/android/fpf_skiafont.cpp
@@ -167,9 +167,9 @@
   }
   return 0;
 }
-FX_DWORD CFPF_SkiaFont::GetFontData(FX_DWORD dwTable,
+uint32_t CFPF_SkiaFont::GetFontData(uint32_t dwTable,
                                     uint8_t* pBuffer,
-                                    FX_DWORD dwSize) {
+                                    uint32_t dwSize) {
   if (!m_Face) {
     return 0;
   }
@@ -177,12 +177,12 @@
   if (FXFT_Load_Sfnt_Table(m_Face, dwTable, 0, pBuffer, &ulSize)) {
     return 0;
   }
-  return pdfium::base::checked_cast<FX_DWORD>(ulSize);
+  return pdfium::base::checked_cast<uint32_t>(ulSize);
 }
 FX_BOOL CFPF_SkiaFont::InitFont(CFPF_SkiaFontMgr* pFontMgr,
                                 CFPF_SkiaFontDescriptor* pFontDes,
                                 const CFX_ByteStringC& bsFamily,
-                                FX_DWORD dwStyle,
+                                uint32_t dwStyle,
                                 uint8_t uCharset) {
   if (!pFontMgr || !pFontDes) {
     return FALSE;
diff --git a/core/fxge/android/fpf_skiafont.h b/core/fxge/android/fpf_skiafont.h
index d077f38..9e35c94 100644
--- a/core/fxge/android/fpf_skiafont.h
+++ b/core/fxge/android/fpf_skiafont.h
@@ -27,7 +27,7 @@
   FPF_HFONT GetHandle() override;
   CFX_ByteString GetFamilyName() override;
   CFX_WideString GetPsName() override;
-  FX_DWORD GetFontStyle() const override { return m_dwStyle; }
+  uint32_t GetFontStyle() const override { return m_dwStyle; }
   uint8_t GetCharset() const override { return m_uCharset; }
   int32_t GetGlyphIndex(FX_WCHAR wUnicode) override;
   int32_t GetGlyphWidth(int32_t iGlyphIndex) override;
@@ -37,23 +37,23 @@
   FX_BOOL GetBBox(FX_RECT& rtBBox) override;
   int32_t GetHeight() const override;
   int32_t GetItalicAngle() const override;
-  FX_DWORD GetFontData(FX_DWORD dwTable,
+  uint32_t GetFontData(uint32_t dwTable,
                        uint8_t* pBuffer,
-                       FX_DWORD dwSize) override;
+                       uint32_t dwSize) override;
 
   FX_BOOL InitFont(CFPF_SkiaFontMgr* pFontMgr,
                    CFPF_SkiaFontDescriptor* pFontDes,
                    const CFX_ByteStringC& bsFamily,
-                   FX_DWORD dwStyle,
+                   uint32_t dwStyle,
                    uint8_t uCharset);
 
  protected:
   CFPF_SkiaFontMgr* m_pFontMgr;
   CFPF_SkiaFontDescriptor* m_pFontDes;
   FXFT_Face m_Face;
-  FX_DWORD m_dwStyle;
+  uint32_t m_dwStyle;
   uint8_t m_uCharset;
-  FX_DWORD m_dwRefCount;
+  uint32_t m_dwRefCount;
 };
 #endif
 
diff --git a/core/fxge/android/fpf_skiafontmgr.cpp b/core/fxge/android/fpf_skiafontmgr.cpp
index 13d030c..c9748da 100644
--- a/core/fxge/android/fpf_skiafontmgr.cpp
+++ b/core/fxge/android/fpf_skiafontmgr.cpp
@@ -42,8 +42,8 @@
 };
 #endif
 struct FPF_SKIAFONTMAP {
-  FX_DWORD dwFamily;
-  FX_DWORD dwSubSt;
+  uint32_t dwFamily;
+  uint32_t dwSubSt;
 };
 static const FPF_SKIAFONTMAP g_SkiaFontmap[] = {
     {0x58c5083, 0xc8d2e345},  {0x5dfade2, 0xe1633081},
@@ -58,7 +58,7 @@
     {0xcad5eaf6, 0x59b9f8f1}, {0xcb7a04c8, 0xc8d2e345},
     {0xfb4ce0de, 0xe1633081},
 };
-FX_DWORD FPF_SkiaGetSubstFont(FX_DWORD dwHash) {
+uint32_t FPF_SkiaGetSubstFont(uint32_t dwHash) {
   int32_t iStart = 0;
   int32_t iEnd = sizeof(g_SkiaFontmap) / sizeof(FPF_SKIAFONTMAP);
   while (iStart <= iEnd) {
@@ -79,7 +79,7 @@
     {0x779ce19d, 0xd5b8d10f}, {0xcb7a04c8, 0xd5b8d10f},
     {0xfb4ce0de, 0xd5b8d10f},
 };
-FX_DWORD FPF_SkiaGetSansFont(FX_DWORD dwHash) {
+uint32_t FPF_SkiaGetSansFont(uint32_t dwHash) {
   int32_t iStart = 0;
   int32_t iEnd = sizeof(g_SkiaSansFontMap) / sizeof(FPF_SKIAFONTMAP);
   while (iStart <= iEnd) {
@@ -138,7 +138,7 @@
   FPF_SKIACHARSET_PC = 1 << 17,
   FPF_SKIACHARSET_OEM = 1 << 18,
 };
-static FX_DWORD FPF_SkiaGetCharset(uint8_t uCharset) {
+static uint32_t FPF_SkiaGetCharset(uint8_t uCharset) {
   switch (uCharset) {
     case FXFONT_ANSI_CHARSET:
       return FPF_SKIACHARSET_Ansi;
@@ -173,8 +173,8 @@
   }
   return FPF_SKIACHARSET_Default;
 }
-static FX_DWORD FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) {
-  FX_DWORD dwHash = 0;
+static uint32_t FPF_SKIANormalizeFontName(const CFX_ByteStringC& bsfamily) {
+  uint32_t dwHash = 0;
   int32_t iLength = bsfamily.GetLength();
   const FX_CHAR* pBuffer = bsfamily.GetCStr();
   for (int32_t i = 0; i < iLength; i++) {
@@ -186,8 +186,8 @@
   }
   return dwHash;
 }
-static FX_DWORD FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily,
-                                      FX_DWORD dwStyle,
+static uint32_t FPF_SKIAGetFamilyHash(const CFX_ByteStringC& bsFamily,
+                                      uint32_t dwStyle,
                                       uint8_t uCharset) {
   CFX_ByteString bsFont(bsFamily);
   if (dwStyle & FXFONT_BOLD) {
@@ -252,16 +252,16 @@
 void CFPF_SkiaFontMgr::LoadPrivateFont(void* pBuffer, size_t szBuffer) {}
 IFPF_Font* CFPF_SkiaFontMgr::CreateFont(const CFX_ByteStringC& bsFamilyname,
                                         uint8_t uCharset,
-                                        FX_DWORD dwStyle,
-                                        FX_DWORD dwMatch) {
-  FX_DWORD dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset);
+                                        uint32_t dwStyle,
+                                        uint32_t dwMatch) {
+  uint32_t dwHash = FPF_SKIAGetFamilyHash(bsFamilyname, dwStyle, uCharset);
   auto it = m_FamilyFonts.find(dwHash);
   if (it != m_FamilyFonts.end() && it->second)
     return it->second->Retain();
 
-  FX_DWORD dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname);
-  FX_DWORD dwSubst = FPF_SkiaGetSubstFont(dwFaceName);
-  FX_DWORD dwSubstSans = FPF_SkiaGetSansFont(dwFaceName);
+  uint32_t dwFaceName = FPF_SKIANormalizeFontName(bsFamilyname);
+  uint32_t dwSubst = FPF_SkiaGetSubstFont(dwFaceName);
+  uint32_t dwSubstSans = FPF_SkiaGetSansFont(dwFaceName);
   FX_BOOL bMaybeSymbol = FPF_SkiaMaybeSymbol(bsFamilyname);
   if (uCharset != FXFONT_ARABIC_CHARSET && FPF_SkiaMaybeArabic(bsFamilyname)) {
     uCharset = FXFONT_ARABIC_CHARSET;
@@ -280,7 +280,7 @@
       continue;
     }
     int32_t nFind = 0;
-    FX_DWORD dwSysFontName = FPF_SKIANormalizeFontName(pFontDes->m_pFamily);
+    uint32_t dwSysFontName = FPF_SKIANormalizeFontName(pFontDes->m_pFamily);
     if (dwFaceName == dwSysFontName) {
       nFind += FPF_SKIAMATCHWEIGHT_NAME1;
     }
@@ -440,7 +440,7 @@
     FXFT_Done_Face(face);
   }
 }
-static const FX_DWORD g_FPFSkiaFontCharsets[] = {
+static const uint32_t g_FPFSkiaFontCharsets[] = {
     FPF_SKIACHARSET_Ansi,
     FPF_SKIACHARSET_EeasternEuropean,
     FPF_SKIACHARSET_Cyrillic,
@@ -474,8 +474,8 @@
     FPF_SKIACHARSET_OEM,
     FPF_SKIACHARSET_Symbol,
 };
-static FX_DWORD FPF_SkiaGetFaceCharset(TT_OS2* pOS2) {
-  FX_DWORD dwCharset = 0;
+static uint32_t FPF_SkiaGetFaceCharset(TT_OS2* pOS2) {
+  uint32_t dwCharset = 0;
   if (pOS2) {
     for (int32_t i = 0; i < 32; i++) {
       if (pOS2->ulCodePageRange1 & (1 << i)) {
diff --git a/core/fxge/android/fpf_skiafontmgr.h b/core/fxge/android/fpf_skiafontmgr.h
index 5ba5b16..5ed409c 100644
--- a/core/fxge/android/fpf_skiafontmgr.h
+++ b/core/fxge/android/fpf_skiafontmgr.h
@@ -44,9 +44,9 @@
     m_pFamily[iSize] = 0;
   }
   FX_CHAR* m_pFamily;
-  FX_DWORD m_dwStyle;
+  uint32_t m_dwStyle;
   int32_t m_iFaceIndex;
-  FX_DWORD m_dwCharsets;
+  uint32_t m_dwCharsets;
   int32_t m_iGlyphNum;
 };
 
@@ -100,8 +100,8 @@
   void LoadPrivateFont(void* pBuffer, size_t szBuffer) override;
   IFPF_Font* CreateFont(const CFX_ByteStringC& bsFamilyname,
                         uint8_t uCharset,
-                        FX_DWORD dwStyle,
-                        FX_DWORD dwMatch = 0) override;
+                        uint32_t dwStyle,
+                        uint32_t dwMatch = 0) override;
 
   FX_BOOL InitFTLibrary();
   FXFT_Face GetFontFace(IFX_FileRead* pFileRead, int32_t iFaceIndex = 0);
@@ -119,7 +119,7 @@
   FX_BOOL m_bLoaded;
   FXFT_Library m_FTLibrary;
   std::vector<CFPF_SkiaFontDescriptor*> m_FontFaces;
-  std::map<FX_DWORD, CFPF_SkiaFont*> m_FamilyFonts;
+  std::map<uint32_t, CFPF_SkiaFont*> m_FamilyFonts;
 };
 
 #endif
diff --git a/core/fxge/android/fx_android_font.cpp b/core/fxge/android/fx_android_font.cpp
index 7218b5e..d663ac0 100644
--- a/core/fxge/android/fx_android_font.cpp
+++ b/core/fxge/android/fx_android_font.cpp
@@ -32,7 +32,7 @@
   if (!m_pFontMgr) {
     return NULL;
   }
-  FX_DWORD dwStyle = 0;
+  uint32_t dwStyle = 0;
   if (weight >= 700) {
     dwStyle |= FXFONT_BOLD;
   }
@@ -54,10 +54,10 @@
 void* CFX_AndroidFontInfo::GetFont(const FX_CHAR* face) {
   return NULL;
 }
-FX_DWORD CFX_AndroidFontInfo::GetFontData(void* hFont,
-                                          FX_DWORD table,
+uint32_t CFX_AndroidFontInfo::GetFontData(void* hFont,
+                                          uint32_t table,
                                           uint8_t* buffer,
-                                          FX_DWORD size) {
+                                          uint32_t size) {
   if (!hFont) {
     return 0;
   }
diff --git a/core/fxge/android/fx_android_font.h b/core/fxge/android/fx_android_font.h
index 1ce4694..ee88591 100644
--- a/core/fxge/android/fx_android_font.h
+++ b/core/fxge/android/fx_android_font.h
@@ -30,10 +30,10 @@
                         int& bExact);
 
   virtual void* GetFont(const FX_CHAR* face);
-  virtual FX_DWORD GetFontData(void* hFont,
-                               FX_DWORD table,
+  virtual uint32_t GetFontData(void* hFont,
+                               uint32_t table,
                                uint8_t* buffer,
-                               FX_DWORD size);
+                               uint32_t size);
   virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name);
   virtual FX_BOOL GetFontCharset(void* hFont, int& charset);
 
diff --git a/core/fxge/apple/apple_int.h b/core/fxge/apple/apple_int.h
index c4f95d6..66d1daf 100644
--- a/core/fxge/apple/apple_int.h
+++ b/core/fxge/apple/apple_int.h
@@ -43,17 +43,17 @@
   eFXFontFlagScript = 1 << 4,
 } FX_IOSFONTFLAG;
 typedef struct IOS_FONTDATA_ {
-  FX_DWORD nHashCode;
+  uint32_t nHashCode;
   const char* psName;
-  FX_DWORD charsets;
-  FX_DWORD styles;
+  uint32_t charsets;
+  uint32_t styles;
 } IOS_FONTDATA;
 class CQuartz2D {
  public:
   void* createGraphics(CFX_DIBitmap* bitmap);
   void destroyGraphics(void* graphics);
 
-  void* CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize);
+  void* CreateFont(const uint8_t* pFontData, uint32_t dwFontSize);
   void DestroyFont(void* pFont);
   void setGraphicsTextMatrix(void* graphics, CFX_Matrix* matrix);
   FX_BOOL drawGraphicsString(void* graphics,
@@ -97,21 +97,21 @@
   FX_BOOL DrawPath(const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_color,
-                   FX_DWORD stroke_color,
+                   uint32_t fill_color,
+                   uint32_t stroke_color,
                    int fill_mode,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL,
                    int blend_type = FXDIB_BLEND_NORMAL) override;
   FX_BOOL SetPixel(int x,
                    int y,
-                   FX_DWORD color,
+                   uint32_t color,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL) override {
     return FALSE;
   }
   FX_BOOL FillRect(const FX_RECT* pRect,
-                   FX_DWORD fill_color,
+                   uint32_t fill_color,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL,
                    int blend_type = FXDIB_BLEND_NORMAL) override;
@@ -119,7 +119,7 @@
                            FX_FLOAT y1,
                            FX_FLOAT x2,
                            FX_FLOAT y2,
-                           FX_DWORD color,
+                           uint32_t color,
                            int alpha_flag = 0,
                            void* pIccTransform = NULL,
                            int blend_type = FXDIB_BLEND_NORMAL) override;
@@ -131,7 +131,7 @@
                     FX_BOOL bDEdge = FALSE) override;
   CFX_DIBitmap* GetBackDrop() override { return NULL; }
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                    FX_DWORD color,
+                    uint32_t color,
                     const FX_RECT* pSrcRect,
                     int dest_left,
                     int dest_top,
@@ -139,21 +139,21 @@
                     int alpha_flag = 0,
                     void* pIccTransform = NULL) override;
   FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                        FX_DWORD color,
+                        uint32_t color,
                         int dest_left,
                         int dest_top,
                         int dest_width,
                         int dest_height,
                         const FX_RECT* pClipRect,
-                        FX_DWORD flags,
+                        uint32_t flags,
                         int alpha_flag = 0,
                         void* pIccTransform = NULL,
                         int blend_type = FXDIB_BLEND_NORMAL) override;
   FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                       int bitmap_alpha,
-                      FX_DWORD color,
+                      uint32_t color,
                       const CFX_Matrix* pMatrix,
-                      FX_DWORD flags,
+                      uint32_t flags,
                       void*& handle,
                       int alpha_flag = 0,
                       void* pIccTransform = NULL,
@@ -170,7 +170,7 @@
                          CFX_FontCache* pCache,
                          const CFX_Matrix* pObject2Device,
                          FX_FLOAT font_size,
-                         FX_DWORD color,
+                         uint32_t color,
                          int alpha_flag = 0,
                          void* pIccTransform = NULL) override;
   void* GetPlatformSurface() const override { return NULL; }
@@ -191,7 +191,7 @@
                          const CFX_Matrix* pGlyphMatrix,
                          const CFX_Matrix* pObject2Device,
                          FX_FLOAT font_size,
-                         FX_DWORD argb,
+                         uint32_t argb,
                          int alpha_flag,
                          void* pIccTransform);
   void CG_SetImageTransform(int dest_left,
@@ -263,7 +263,7 @@
 };
 
 uint32_t FX_GetHashCode(const FX_CHAR* pStr);
-FX_DWORD FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName);
+uint32_t FX_IOSGetMatchFamilyNameHashcode(const FX_CHAR* pFontName);
 uint32_t FX_IOSGetFamilyNamesCount();
 const FX_CHAR* FX_IOSGetFamilyName(uint32_t uIndex);
 #endif
diff --git a/core/fxge/apple/fx_apple_platform.cpp b/core/fxge/apple/fx_apple_platform.cpp
index 33dfbbc..9683b5c 100644
--- a/core/fxge/apple/fx_apple_platform.cpp
+++ b/core/fxge/apple/fx_apple_platform.cpp
@@ -33,7 +33,7 @@
 void CFX_FaceCache::DestroyPlatform() {}
 CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph_Nativetext(
     CFX_Font* pFont,
-    FX_DWORD glyph_index,
+    uint32_t glyph_index,
     const CFX_Matrix* pMatrix,
     int dest_width,
     int anti_alias) {
@@ -46,7 +46,7 @@
                                CFX_FontCache* pCache,
                                const CFX_Matrix* pObject2Device,
                                FX_FLOAT font_size,
-                               FX_DWORD argb,
+                               uint32_t argb,
                                int alpha_flag,
                                void* pIccTransform) {
   if (nChars == 0) {
@@ -103,7 +103,7 @@
                                             CFX_FontCache* pCache,
                                             const CFX_Matrix* pObject2Device,
                                             FX_FLOAT font_size,
-                                            FX_DWORD argb,
+                                            uint32_t argb,
                                             int alpha_flag,
                                             void* pIccTransform) {
   if (!pFont) {
diff --git a/core/fxge/apple/fx_quartz_device.cpp b/core/fxge/apple/fx_quartz_device.cpp
index dae396f..b525660 100644
--- a/core/fxge/apple/fx_quartz_device.cpp
+++ b/core/fxge/apple/fx_quartz_device.cpp
@@ -43,7 +43,7 @@
     CGContextRelease((CGContextRef)graphics);
   }
 }
-void* CQuartz2D::CreateFont(const uint8_t* pFontData, FX_DWORD dwFontSize) {
+void* CQuartz2D::CreateFont(const uint8_t* pFontData, uint32_t dwFontSize) {
   CGDataProviderRef pDataProvider =
       CGDataProviderCreateWithData(NULL, pFontData, (size_t)dwFontSize, NULL);
   if (NULL == pDataProvider) {
@@ -337,8 +337,8 @@
 FX_BOOL CFX_QuartzDeviceDriver::DrawPath(const CFX_PathData* pathData,
                                          const CFX_Matrix* matrix,
                                          const CFX_GraphStateData* graphState,
-                                         FX_DWORD fillArgb,
-                                         FX_DWORD strokeArgb,
+                                         uint32_t fillArgb,
+                                         uint32_t strokeArgb,
                                          int fillMode,
                                          int alpha_flag,
                                          void* pIccTransform,
@@ -414,7 +414,7 @@
                                                  FX_FLOAT y1,
                                                  FX_FLOAT x2,
                                                  FX_FLOAT y2,
-                                                 FX_DWORD argb,
+                                                 uint32_t argb,
                                                  int alphaFlag,
                                                  void* iccTransform,
                                                  int blend_type) {
@@ -636,7 +636,7 @@
                                               int dest_width,
                                               int dest_height,
                                               const FX_RECT* clipRect,
-                                              FX_DWORD flags,
+                                              uint32_t flags,
                                               int alphaFlag,
                                               void* iccTransform,
                                               int blend_type) {
@@ -742,7 +742,7 @@
                                                const CFX_Matrix* pGlyphMatrix,
                                                const CFX_Matrix* pObject2Device,
                                                FX_FLOAT font_size,
-                                               FX_DWORD argb,
+                                               uint32_t argb,
                                                int alpha_flag,
                                                void* pIccTransform) {
   if (nChars == 0) {
@@ -807,7 +807,7 @@
                                                CFX_FontCache* pCache,
                                                const CFX_Matrix* pObject2Device,
                                                FX_FLOAT font_size,
-                                               FX_DWORD color,
+                                               uint32_t color,
                                                int alpha_flag,
                                                void* pIccTransform) {
   if (NULL == pFont || NULL == _context) {
diff --git a/core/fxge/dib/dib_int.h b/core/fxge/dib/dib_int.h
index 7022ec9..1d2193e 100644
--- a/core/fxge/dib/dib_int.h
+++ b/core/fxge/dib/dib_int.h
@@ -82,7 +82,7 @@
   uint8_t* m_pDestMaskScanline;
   FX_RECT m_SrcClip;
   const CFX_DIBSource* m_pSource;
-  FX_DWORD* m_pSrcPalette;
+  uint32_t* m_pSrcPalette;
   int m_SrcWidth, m_SrcHeight;
   int m_SrcPitch, m_InterPitch;
   int m_ExtraMaskPitch;
diff --git a/core/fxge/dib/fx_dib_composite.cpp b/core/fxge/dib/fx_dib_composite.cpp
index 5bfe46e..b10180d 100644
--- a/core/fxge/dib/fx_dib_composite.cpp
+++ b/core/fxge/dib/fx_dib_composite.cpp
@@ -2149,7 +2149,7 @@
 }
 inline void _CompositeRow_8bppRgb2Rgb_NoBlend(uint8_t* dest_scan,
                                               const uint8_t* src_scan,
-                                              FX_DWORD* pPalette,
+                                              uint32_t* pPalette,
                                               int pixel_count,
                                               int DestBpp,
                                               const uint8_t* clip_scan,
@@ -2217,7 +2217,7 @@
 inline void _CompositeRow_1bppRgb2Rgb_NoBlend(uint8_t* dest_scan,
                                               const uint8_t* src_scan,
                                               int src_left,
-                                              FX_DWORD* pPalette,
+                                              uint32_t* pPalette,
                                               int pixel_count,
                                               int DestBpp,
                                               const uint8_t* clip_scan) {
@@ -2260,7 +2260,7 @@
 inline void _CompositeRow_8bppRgb2Argb_NoBlend(uint8_t* dest_scan,
                                                const uint8_t* src_scan,
                                                int width,
-                                               FX_DWORD* pPalette,
+                                               uint32_t* pPalette,
                                                const uint8_t* clip_scan,
                                                const uint8_t* src_alpha_scan) {
   if (src_alpha_scan) {
@@ -2345,7 +2345,7 @@
 void _CompositeRow_8bppRgb2Rgba_NoBlend(uint8_t* dest_scan,
                                         const uint8_t* src_scan,
                                         int width,
-                                        FX_DWORD* pPalette,
+                                        uint32_t* pPalette,
                                         const uint8_t* clip_scan,
                                         uint8_t* dest_alpha_scan,
                                         const uint8_t* src_alpha_scan) {
@@ -2433,7 +2433,7 @@
                                                const uint8_t* src_scan,
                                                int src_left,
                                                int width,
-                                               FX_DWORD* pPalette,
+                                               uint32_t* pPalette,
                                                const uint8_t* clip_scan) {
   int reset_r, reset_g, reset_b;
   int set_r, set_g, set_b;
@@ -2483,7 +2483,7 @@
                                         const uint8_t* src_scan,
                                         int src_left,
                                         int width,
-                                        FX_DWORD* pPalette,
+                                        uint32_t* pPalette,
                                         const uint8_t* clip_scan,
                                         uint8_t* dest_alpha_scan) {
   int reset_r, reset_g, reset_b;
@@ -3959,7 +3959,7 @@
 }
 inline FX_BOOL _ScanlineCompositor_InitSourceMask(FXDIB_Format dest_format,
                                                   int alpha_flag,
-                                                  FX_DWORD mask_color,
+                                                  uint32_t mask_color,
                                                   int& mask_alpha,
                                                   int& mask_red,
                                                   int& mask_green,
@@ -4026,8 +4026,8 @@
 }
 inline void _ScanlineCompositor_InitSourcePalette(FXDIB_Format src_format,
                                                   FXDIB_Format dest_format,
-                                                  FX_DWORD*& pDestPalette,
-                                                  FX_DWORD* pSrcPalette,
+                                                  uint32_t*& pDestPalette,
+                                                  uint32_t* pSrcPalette,
                                                   void* icc_module,
                                                   void* pIccTransform) {
   ICodec_IccModule* pIccModule = (ICodec_IccModule*)icc_module;
@@ -4039,9 +4039,9 @@
       if ((dest_format & 0xff) == 8) {
         int pal_count = 1 << (src_format & 0xff);
         uint8_t* gray_pal = FX_Alloc(uint8_t, pal_count);
-        pDestPalette = (FX_DWORD*)gray_pal;
+        pDestPalette = (uint32_t*)gray_pal;
         for (int i = 0; i < pal_count; i++) {
-          FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i])
+          uint32_t color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i])
                                      : FXARGB_TODIB(pSrcPalette[i]);
           pIccModule->TranslateScanline(pIccTransform, gray_pal,
                                         (const uint8_t*)&color, 1);
@@ -4049,9 +4049,9 @@
         }
       } else {
         int palsize = 1 << (src_format & 0xff);
-        pDestPalette = FX_Alloc(FX_DWORD, palsize);
+        pDestPalette = FX_Alloc(uint32_t, palsize);
         for (int i = 0; i < palsize; i++) {
-          FX_DWORD color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i])
+          uint32_t color = isSrcCmyk ? FXCMYK_TODIB(pSrcPalette[i])
                                      : FXARGB_TODIB(pSrcPalette[i]);
           pIccModule->TranslateScanline(pIccTransform, (uint8_t*)&color,
                                         (const uint8_t*)&color, 1);
@@ -4073,9 +4073,9 @@
       if ((dest_format & 0xff) == 8) {
         pIccModule->TranslateScanline(pIccTransform, gray_pal, gray_pal,
                                       pal_count);
-        pDestPalette = (FX_DWORD*)gray_pal;
+        pDestPalette = (uint32_t*)gray_pal;
       } else {
-        pDestPalette = FX_Alloc(FX_DWORD, pal_count);
+        pDestPalette = FX_Alloc(uint32_t, pal_count);
         for (int i = 0; i < pal_count; i++) {
           pIccModule->TranslateScanline(
               pIccTransform, (uint8_t*)&pDestPalette[i], &gray_pal[i], 1);
@@ -4090,7 +4090,7 @@
       if ((dest_format & 0xff) == 8) {
         int pal_count = 1 << (src_format & 0xff);
         uint8_t* gray_pal = FX_Alloc(uint8_t, pal_count);
-        pDestPalette = (FX_DWORD*)gray_pal;
+        pDestPalette = (uint32_t*)gray_pal;
         if (isSrcCmyk) {
           for (int i = 0; i < pal_count; i++) {
             FX_CMYK cmyk = pSrcPalette[i];
@@ -4109,9 +4109,9 @@
         }
       } else {
         int palsize = 1 << (src_format & 0xff);
-        pDestPalette = FX_Alloc(FX_DWORD, palsize);
+        pDestPalette = FX_Alloc(uint32_t, palsize);
         if (isDstCmyk == isSrcCmyk) {
-          FXSYS_memcpy(pDestPalette, pSrcPalette, palsize * sizeof(FX_DWORD));
+          FXSYS_memcpy(pDestPalette, pSrcPalette, palsize * sizeof(uint32_t));
         } else {
           for (int i = 0; i < palsize; i++) {
             FX_CMYK cmyk = pSrcPalette[i];
@@ -4135,10 +4135,10 @@
             gray_pal[i] = i;
           }
         }
-        pDestPalette = (FX_DWORD*)gray_pal;
+        pDestPalette = (uint32_t*)gray_pal;
       } else {
         int palsize = 1 << (src_format & 0xff);
-        pDestPalette = FX_Alloc(FX_DWORD, palsize);
+        pDestPalette = FX_Alloc(uint32_t, palsize);
         if (palsize == 2) {
           pDestPalette[0] = isSrcCmyk ? 255 : 0xff000000;
           pDestPalette[1] = isSrcCmyk ? 0 : 0xffffffff;
@@ -4175,8 +4175,8 @@
 FX_BOOL CFX_ScanlineCompositor::Init(FXDIB_Format dest_format,
                                      FXDIB_Format src_format,
                                      int32_t width,
-                                     FX_DWORD* pSrcPalette,
-                                     FX_DWORD mask_color,
+                                     uint32_t* pSrcPalette,
+                                     uint32_t mask_color,
                                      int blend_type,
                                      FX_BOOL bClip,
                                      FX_BOOL bRgbByteOrder,
@@ -4706,7 +4706,7 @@
                                     int width,
                                     int height,
                                     const CFX_DIBSource* pMask,
-                                    FX_DWORD color,
+                                    uint32_t color,
                                     int src_left,
                                     int src_top,
                                     int blend_type,
@@ -4775,7 +4775,7 @@
                                     int top,
                                     int width,
                                     int height,
-                                    FX_DWORD color,
+                                    uint32_t color,
                                     int alpha_flag,
                                     void* pIccTransform) {
   if (!m_pBuffer) {
@@ -4791,7 +4791,7 @@
     return TRUE;
   }
   width = rect.Width();
-  FX_DWORD dst_color;
+  uint32_t dst_color;
   if (alpha_flag >> 8) {
     dst_color = FXCMYK_TODIB(color);
   } else {
@@ -4905,7 +4905,7 @@
         FXSYS_memset(dest_scan_alpha, 0xff, width);
       }
       if (Bpp == 4) {
-        FX_DWORD* scan = (FX_DWORD*)dest_scan;
+        uint32_t* scan = (uint32_t*)dest_scan;
         for (int col = 0; col < width; col++) {
           *scan++ = dst_color;
         }
@@ -4996,7 +4996,7 @@
 void CFX_BitmapComposer::Compose(CFX_DIBitmap* pDest,
                                  const CFX_ClipRgn* pClipRgn,
                                  int bitmap_alpha,
-                                 FX_DWORD mask_color,
+                                 uint32_t mask_color,
                                  FX_RECT& dest_rect,
                                  FX_BOOL bVertical,
                                  FX_BOOL bFlipX,
@@ -5028,7 +5028,7 @@
 FX_BOOL CFX_BitmapComposer::SetInfo(int width,
                                     int height,
                                     FXDIB_Format src_format,
-                                    FX_DWORD* pSrcPalette) {
+                                    uint32_t* pSrcPalette) {
   m_SrcFormat = src_format;
   if (!m_Compositor.Init(m_pBitmap->GetFormat(), src_format, width, pSrcPalette,
                          m_MaskColor, FXDIB_BLEND_NORMAL,
diff --git a/core/fxge/dib/fx_dib_convert.cpp b/core/fxge/dib/fx_dib_convert.cpp
index 9335800..d9d5a3b 100644
--- a/core/fxge/dib/fx_dib_convert.cpp
+++ b/core/fxge/dib/fx_dib_convert.cpp
@@ -14,20 +14,20 @@
   ~CFX_Palette();
 
   FX_BOOL BuildPalette(const CFX_DIBSource* pBitmap);
-  FX_DWORD* GetPalette() const { return m_pPalette; }
-  FX_DWORD* GetColorLut() const { return m_cLut; }
-  FX_DWORD* GetAmountLut() const { return m_aLut; }
+  uint32_t* GetPalette() const { return m_pPalette; }
+  uint32_t* GetColorLut() const { return m_cLut; }
+  uint32_t* GetAmountLut() const { return m_aLut; }
   int32_t Getlut() const { return m_lut; }
 
  protected:
-  FX_DWORD* m_pPalette;
-  FX_DWORD* m_cLut;
-  FX_DWORD* m_aLut;
+  uint32_t* m_pPalette;
+  uint32_t* m_cLut;
+  uint32_t* m_aLut;
   int m_lut;
 };
-int _Partition(FX_DWORD* alut, FX_DWORD* clut, int l, int r) {
-  FX_DWORD p_a = alut[l];
-  FX_DWORD p_c = clut[l];
+int _Partition(uint32_t* alut, uint32_t* clut, int l, int r) {
+  uint32_t p_a = alut[l];
+  uint32_t p_c = clut[l];
   while (l < r) {
     while (l < r && alut[r] >= p_a) {
       r--;
@@ -48,34 +48,34 @@
   clut[l] = p_c;
   return l;
 }
-void _Qsort(FX_DWORD* alut, FX_DWORD* clut, int l, int r) {
+void _Qsort(uint32_t* alut, uint32_t* clut, int l, int r) {
   if (l < r) {
     int pI = _Partition(alut, clut, l, r);
     _Qsort(alut, clut, l, pI - 1);
     _Qsort(alut, clut, pI + 1, r);
   }
 }
-void _ColorDecode(FX_DWORD pal_v, uint8_t& r, uint8_t& g, uint8_t& b) {
+void _ColorDecode(uint32_t pal_v, uint8_t& r, uint8_t& g, uint8_t& b) {
   r = (uint8_t)((pal_v & 0xf00) >> 4);
   g = (uint8_t)(pal_v & 0x0f0);
   b = (uint8_t)((pal_v & 0x00f) << 4);
 }
-void _Obtain_Pal(FX_DWORD* aLut,
-                 FX_DWORD* cLut,
-                 FX_DWORD* dest_pal,
-                 FX_DWORD lut) {
-  FX_DWORD lut_1 = lut - 1;
+void _Obtain_Pal(uint32_t* aLut,
+                 uint32_t* cLut,
+                 uint32_t* dest_pal,
+                 uint32_t lut) {
+  uint32_t lut_1 = lut - 1;
   for (int row = 0; row < 256; row++) {
     int lut_offset = lut_1 - row;
     if (lut_offset < 0) {
       lut_offset += 256;
     }
-    FX_DWORD color = cLut[lut_offset];
+    uint32_t color = cLut[lut_offset];
     uint8_t r;
     uint8_t g;
     uint8_t b;
     _ColorDecode(color, r, g, b);
-    dest_pal[row] = ((FX_DWORD)r << 16) | ((FX_DWORD)g << 8) | b | 0xff000000;
+    dest_pal[row] = ((uint32_t)r << 16) | ((uint32_t)g << 8) | b | 0xff000000;
     aLut[lut_offset] = row;
   }
 }
@@ -97,7 +97,7 @@
     return FALSE;
   }
   FX_Free(m_pPalette);
-  m_pPalette = FX_Alloc(FX_DWORD, 256);
+  m_pPalette = FX_Alloc(uint32_t, 256);
   int bpp = pBitmap->GetBPP() / 8;
   int width = pBitmap->GetWidth();
   int height = pBitmap->GetHeight();
@@ -105,18 +105,18 @@
   m_cLut = NULL;
   FX_Free(m_aLut);
   m_aLut = NULL;
-  m_cLut = FX_Alloc(FX_DWORD, 4096);
-  m_aLut = FX_Alloc(FX_DWORD, 4096);
+  m_cLut = FX_Alloc(uint32_t, 4096);
+  m_aLut = FX_Alloc(uint32_t, 4096);
   int row, col;
   m_lut = 0;
   for (row = 0; row < height; row++) {
     uint8_t* scan_line = (uint8_t*)pBitmap->GetScanline(row);
     for (col = 0; col < width; col++) {
       uint8_t* src_port = scan_line + col * bpp;
-      FX_DWORD b = src_port[0] & 0xf0;
-      FX_DWORD g = src_port[1] & 0xf0;
-      FX_DWORD r = src_port[2] & 0xf0;
-      FX_DWORD index = (r << 4) + g + (b >> 4);
+      uint32_t b = src_port[0] & 0xf0;
+      uint32_t g = src_port[1] & 0xf0;
+      uint32_t r = src_port[2] & 0xf0;
+      uint32_t index = (r << 4) + g + (b >> 4);
       m_aLut[index]++;
     }
   }
@@ -176,10 +176,10 @@
                                    int src_left,
                                    int src_top,
                                    void* pIccTransform) {
-  FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+  uint32_t* src_plt = pSrcBitmap->GetPalette();
   uint8_t gray[2];
   if (pIccTransform) {
-    FX_DWORD plt[2];
+    uint32_t plt[2];
     if (pSrcBitmap->IsCmykImage()) {
       plt[0] = FXCMYK_TODIB(src_plt[0]);
       plt[1] = FXCMYK_TODIB(src_plt[1]);
@@ -238,10 +238,10 @@
                                    int src_left,
                                    int src_top,
                                    void* pIccTransform) {
-  FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+  uint32_t* src_plt = pSrcBitmap->GetPalette();
   uint8_t gray[256];
   if (pIccTransform) {
-    FX_DWORD plt[256];
+    uint32_t plt[256];
     if (pSrcBitmap->IsCmykImage()) {
       for (int i = 0; i < 256; i++) {
         plt[i] = FXCMYK_TODIB(src_plt[i]);
@@ -323,10 +323,10 @@
             pSrcBitmap->GetScanline(src_top + row) + src_left * 4;
         for (int col = 0; col < width; col++) {
           uint8_t r, g, b;
-          AdobeCMYK_to_sRGB1(FXSYS_GetCValue((FX_DWORD)src_scan[0]),
-                             FXSYS_GetMValue((FX_DWORD)src_scan[1]),
-                             FXSYS_GetYValue((FX_DWORD)src_scan[2]),
-                             FXSYS_GetKValue((FX_DWORD)src_scan[3]), r, g, b);
+          AdobeCMYK_to_sRGB1(FXSYS_GetCValue((uint32_t)src_scan[0]),
+                             FXSYS_GetMValue((uint32_t)src_scan[1]),
+                             FXSYS_GetYValue((uint32_t)src_scan[2]),
+                             FXSYS_GetKValue((uint32_t)src_scan[3]), r, g, b);
           *dest_scan++ = FXRGB2GRAY(r, g, b);
           src_scan += 4;
         }
@@ -380,14 +380,14 @@
                                   const CFX_DIBSource* pSrcBitmap,
                                   int src_left,
                                   int src_top,
-                                  FX_DWORD* dst_plt,
+                                  uint32_t* dst_plt,
                                   void* pIccTransform) {
   ConvertBuffer_IndexCopy(dest_buf, dest_pitch, width, height, pSrcBitmap,
                           src_left, src_top);
-  FX_DWORD* src_plt = pSrcBitmap->GetPalette();
+  uint32_t* src_plt = pSrcBitmap->GetPalette();
   int plt_size = pSrcBitmap->GetPaletteSize();
   if (pIccTransform) {
-    FX_DWORD plt[256];
+    uint32_t plt[256];
     uint8_t* bgr_ptr = (uint8_t*)plt;
     if (pSrcBitmap->IsCmykImage()) {
       for (int i = 0; i < plt_size; i++) {
@@ -431,18 +431,18 @@
                                               const CFX_DIBSource* pSrcBitmap,
                                               int src_left,
                                               int src_top,
-                                              FX_DWORD* dst_plt) {
+                                              uint32_t* dst_plt) {
   int bpp = pSrcBitmap->GetBPP() / 8;
   int row, col;
   CFX_Palette palette;
   palette.BuildPalette(pSrcBitmap);
-  FX_DWORD* cLut = palette.GetColorLut();
-  FX_DWORD* aLut = palette.GetAmountLut();
+  uint32_t* cLut = palette.GetColorLut();
+  uint32_t* aLut = palette.GetAmountLut();
   if (!cLut || !aLut) {
     return FALSE;
   }
   int lut = palette.Getlut();
-  FX_DWORD* pPalette = palette.GetPalette();
+  uint32_t* pPalette = palette.GetPalette();
   if (lut > 256) {
     int err, min_err;
     int lut_256 = lut - 256;
@@ -452,7 +452,7 @@
       _ColorDecode(cLut[row], r, g, b);
       int clrindex = 0;
       for (int col = 0; col < 256; col++) {
-        FX_DWORD p_color = *(pPalette + col);
+        uint32_t p_color = *(pPalette + col);
         int d_r = r - (uint8_t)(p_color >> 16);
         int d_g = g - (uint8_t)(p_color >> 8);
         int d_b = b - (uint8_t)(p_color);
@@ -475,7 +475,7 @@
       int r = src_port[2] & 0xf0;
       int g = src_port[1] & 0xf0;
       int b = src_port[0] & 0xf0;
-      FX_DWORD clrindex = (r << 4) + g + (b >> 4);
+      uint32_t clrindex = (r << 4) + g + (b >> 4);
       for (int i = lut_1; i >= 0; i--)
         if (clrindex == cLut[i]) {
           *(dest_scan + col) = (uint8_t)(aLut[i]);
@@ -483,7 +483,7 @@
         }
     }
   }
-  FXSYS_memcpy(dst_plt, pPalette, sizeof(FX_DWORD) * 256);
+  FXSYS_memcpy(dst_plt, pPalette, sizeof(uint32_t) * 256);
   return TRUE;
 }
 FX_BOOL ConvertBuffer_Rgb2PltRgb8(uint8_t* dest_buf,
@@ -493,7 +493,7 @@
                                   const CFX_DIBSource* pSrcBitmap,
                                   int src_left,
                                   int src_top,
-                                  FX_DWORD* dst_plt,
+                                  uint32_t* dst_plt,
                                   void* pIccTransform) {
   FX_BOOL ret = ConvertBuffer_Rgb2PltRgb8_NoTransform(
       dest_buf, dest_pitch, width, height, pSrcBitmap, src_left, src_top,
@@ -574,8 +574,8 @@
                                   int src_top,
                                   void* pIccTransform) {
   int comps = (dst_format & 0xff) / 8;
-  FX_DWORD* src_plt = pSrcBitmap->GetPalette();
-  FX_DWORD plt[2];
+  uint32_t* src_plt = pSrcBitmap->GetPalette();
+  uint32_t plt[2];
   uint8_t* bgr_ptr = (uint8_t*)plt;
   if (pSrcBitmap->IsCmykImage()) {
     plt[0] = FXCMYK_TODIB(src_plt[0]);
@@ -633,8 +633,8 @@
                                   int src_top,
                                   void* pIccTransform) {
   int comps = (dst_format & 0xff) / 8;
-  FX_DWORD* src_plt = pSrcBitmap->GetPalette();
-  FX_DWORD plt[256];
+  uint32_t* src_plt = pSrcBitmap->GetPalette();
+  uint32_t plt[256];
   uint8_t* bgr_ptr = (uint8_t*)plt;
   if (!pSrcBitmap->IsCmykImage()) {
     for (int i = 0; i < 256; i++) {
@@ -817,7 +817,7 @@
                       const CFX_DIBSource* pSrcBitmap,
                       int src_left,
                       int src_top,
-                      FX_DWORD*& d_pal,
+                      uint32_t*& d_pal,
                       void* pIccTransform) {
   FXDIB_Format src_format = pSrcBitmap->GetFormat();
   if (!CFX_GEModule::Get()->GetCodecModule() ||
@@ -864,7 +864,7 @@
                              height, pSrcBitmap, src_left, src_top, d_pal,
                              pIccTransform);
       }
-      d_pal = FX_Alloc(FX_DWORD, 256);
+      d_pal = FX_Alloc(uint32_t, 256);
       if (((src_format & 0xff) == 1 || (src_format & 0xff) == 8) &&
           pSrcBitmap->GetPalette()) {
         return ConvertBuffer_Plt2PltRgb8(dest_buf, dest_pitch, width, height,
@@ -997,7 +997,7 @@
     delete pClone;
     return NULL;
   }
-  FX_DWORD* pal_8bpp = NULL;
+  uint32_t* pal_8bpp = NULL;
   ret = ConvertBuffer(dest_format, pClone->GetBuffer(), pClone->GetPitch(),
                       m_Width, m_Height, this, 0, 0, pal_8bpp, pIccTransform);
   if (!ret) {
@@ -1075,7 +1075,7 @@
     }
   }
   FX_BOOL ret = FALSE;
-  FX_DWORD* pal_8bpp = NULL;
+  uint32_t* pal_8bpp = NULL;
   ret = ConvertBuffer(dest_format, dest_buf, dest_pitch, m_Width, m_Height,
                       this, 0, 0, pal_8bpp, pIccTransform);
   if (!ret) {
diff --git a/core/fxge/dib/fx_dib_engine.cpp b/core/fxge/dib/fx_dib_engine.cpp
index 10e5e67..a68583b 100644
--- a/core/fxge/dib/fx_dib_engine.cpp
+++ b/core/fxge/dib/fx_dib_engine.cpp
@@ -231,7 +231,7 @@
   m_pExtraAlphaBuf = NULL;
   m_pDestMaskScanline = NULL;
   m_DestClip = clip_rect;
-  FX_DWORD size = clip_rect.Width();
+  uint32_t size = clip_rect.Width();
   if (size && m_DestBpp > (int)(INT_MAX / size)) {
     return;
   }
@@ -351,7 +351,7 @@
   if (m_pSource && m_bHasAlpha && m_pSource->m_pAlphaMask) {
     m_pExtraAlphaBuf =
         FX_Alloc2D(unsigned char, m_SrcClip.Height(), m_ExtraMaskPitch);
-    FX_DWORD size = (m_DestClip.Width() * 8 + 31) / 32 * 4;
+    uint32_t size = (m_DestClip.Width() * 8 + 31) / 32 * 4;
     m_pDestMaskScanline = FX_TryAlloc(unsigned char, size);
     if (!m_pDestMaskScanline) {
       return FALSE;
@@ -730,9 +730,9 @@
             dest_a = dest_a < 0 ? 0 : dest_a > 16711680 ? 16711680 : dest_a;
           }
           if (dest_a) {
-            int r = ((FX_DWORD)dest_r_y) * 255 / dest_a;
-            int g = ((FX_DWORD)dest_g_m) * 255 / dest_a;
-            int b = ((FX_DWORD)dest_b_c) * 255 / dest_a;
+            int r = ((uint32_t)dest_r_y) * 255 / dest_a;
+            int g = ((uint32_t)dest_g_m) * 255 / dest_a;
+            int b = ((uint32_t)dest_b_c) * 255 / dest_a;
             dest_scan[0] = b > 255 ? 255 : b < 0 ? 0 : b;
             dest_scan[1] = g > 255 ? 255 : g < 0 ? 0 : g;
             dest_scan[2] = r > 255 ? 255 : r < 0 ? 0 : r;
@@ -782,7 +782,7 @@
                                   int dest_width,
                                   int dest_height,
                                   const FX_RECT& rect,
-                                  FX_DWORD flags) {
+                                  uint32_t flags) {
   m_DestFormat = _GetStretchedFormat(pSource);
   m_DestBPP = m_DestFormat & 0xff;
   m_pDest = pDest;
@@ -863,7 +863,7 @@
     m_DestHeight = -m_DestHeight;
   }
   m_LineIndex = 0;
-  FX_DWORD size = m_ClipRect.Width();
+  uint32_t size = m_ClipRect.Width();
   if (size && m_DestBPP > (int)(INT_MAX / size)) {
     return FALSE;
   }
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index a7f7dc7..3772459 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -20,25 +20,25 @@
                       const CFX_DIBSource* pSrcBitmap,
                       int src_left,
                       int src_top,
-                      FX_DWORD*& pal,
+                      uint32_t*& pal,
                       void* pIccTransform);
-void CmykDecode(FX_DWORD cmyk, int& c, int& m, int& y, int& k) {
+void CmykDecode(uint32_t cmyk, int& c, int& m, int& y, int& k) {
   c = FXSYS_GetCValue(cmyk);
   m = FXSYS_GetMValue(cmyk);
   y = FXSYS_GetYValue(cmyk);
   k = FXSYS_GetKValue(cmyk);
 }
-void ArgbDecode(FX_DWORD argb, int& a, int& r, int& g, int& b) {
+void ArgbDecode(uint32_t argb, int& a, int& r, int& g, int& b) {
   a = FXARGB_A(argb);
   r = FXARGB_R(argb);
   g = FXARGB_G(argb);
   b = FXARGB_B(argb);
 }
-void ArgbDecode(FX_DWORD argb, int& a, FX_COLORREF& rgb) {
+void ArgbDecode(uint32_t argb, int& a, FX_COLORREF& rgb) {
   a = FXARGB_A(argb);
   rgb = FXSYS_RGB(FXARGB_R(argb), FXARGB_G(argb), FXARGB_B(argb));
 }
-FX_DWORD ArgbEncode(int a, FX_COLORREF rgb) {
+uint32_t ArgbEncode(int a, FX_COLORREF rgb) {
   return FXARGB_MAKE(a, FXSYS_GetRValue(rgb), FXSYS_GetGValue(rgb),
                      FXSYS_GetBValue(rgb));
 }
@@ -196,8 +196,8 @@
     int right_shift = 32 - left_shift;
     int dword_count = pNewBitmap->m_Pitch / 4;
     for (int row = rect.top; row < rect.bottom; row++) {
-      FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + rect.left / 32;
-      FX_DWORD* dest_scan = (FX_DWORD*)pNewBitmap->GetScanline(row - rect.top);
+      uint32_t* src_scan = (uint32_t*)GetScanline(row) + rect.left / 32;
+      uint32_t* dest_scan = (uint32_t*)pNewBitmap->GetScanline(row - rect.top);
       for (int i = 0; i < dword_count; i++) {
         dest_scan[i] =
             (src_scan[i] << left_shift) | (src_scan[i + 1] >> right_shift);
@@ -205,7 +205,7 @@
     }
   } else {
     int copy_len = (pNewBitmap->GetWidth() * pNewBitmap->GetBPP() + 7) / 8;
-    if (m_Pitch < (FX_DWORD)copy_len) {
+    if (m_Pitch < (uint32_t)copy_len) {
       copy_len = m_Pitch;
     }
     for (int row = rect.top; row < rect.bottom; row++) {
@@ -221,7 +221,7 @@
     return;
   }
   if (GetBPP() == 1) {
-    m_pPalette = FX_Alloc(FX_DWORD, 2);
+    m_pPalette = FX_Alloc(uint32_t, 2);
     if (IsCmykImage()) {
       m_pPalette[0] = 0xff;
       m_pPalette[1] = 0;
@@ -230,7 +230,7 @@
       m_pPalette[1] = 0xffffffff;
     }
   } else if (GetBPP() == 8) {
-    m_pPalette = FX_Alloc(FX_DWORD, 256);
+    m_pPalette = FX_Alloc(uint32_t, 256);
     if (IsCmykImage()) {
       for (int i = 0; i < 256; i++) {
         m_pPalette[i] = 0xff - i;
@@ -256,7 +256,7 @@
                m_pAlphaMask->GetHeight() * m_pAlphaMask->GetPitch());
   return TRUE;
 }
-FX_DWORD CFX_DIBSource::GetPaletteEntry(int index) const {
+uint32_t CFX_DIBSource::GetPaletteEntry(int index) const {
   ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
   if (m_pPalette) {
     return m_pPalette[index];
@@ -272,14 +272,14 @@
   }
   return index * 0x10101 | 0xff000000;
 }
-void CFX_DIBSource::SetPaletteEntry(int index, FX_DWORD color) {
+void CFX_DIBSource::SetPaletteEntry(int index, uint32_t color) {
   ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
   if (!m_pPalette) {
     BuildPalette();
   }
   m_pPalette[index] = color;
 }
-int CFX_DIBSource::FindPalette(FX_DWORD color) const {
+int CFX_DIBSource::FindPalette(uint32_t color) const {
   ASSERT((GetBPP() == 1 || GetBPP() == 8) && !IsAlphaMask());
   if (!m_pPalette) {
     if (IsCmykImage()) {
@@ -300,7 +300,7 @@
     }
   return -1;
 }
-void CFX_DIBitmap::Clear(FX_DWORD color) {
+void CFX_DIBitmap::Clear(uint32_t color) {
   if (!m_pBuffer) {
     return;
   }
@@ -345,7 +345,7 @@
     case FXDIB_Argb: {
       color = IsCmykImage() ? FXCMYK_TODIB(color) : FXARGB_TODIB(color);
       for (int i = 0; i < m_Width; i++) {
-        ((FX_DWORD*)m_pBuffer)[i] = color;
+        ((uint32_t*)m_pBuffer)[i] = color;
       }
       for (int row = 1; row < m_Height; row++) {
         FXSYS_memcpy(m_pBuffer + row * m_Pitch, m_pBuffer, m_Pitch);
@@ -446,7 +446,7 @@
     }
     uint8_t* dest_buf =
         m_pBuffer + dest_top * m_Pitch + dest_left * GetBPP() / 8;
-    FX_DWORD* d_plt = NULL;
+    uint32_t* d_plt = NULL;
     if (!ConvertBuffer(dest_format, dest_buf, m_Pitch, width, height,
                        pSrcBitmap, src_left, src_top, d_plt, pIccTransform)) {
       return FALSE;
@@ -459,7 +459,7 @@
                                    int width,
                                    int height,
                                    const CFX_DIBSource* pMask,
-                                   FX_DWORD color,
+                                   uint32_t color,
                                    int src_left,
                                    int src_top,
                                    int alpha_flag,
@@ -479,7 +479,7 @@
   }
   int src_bpp = pMask->GetBPP();
   int alpha;
-  FX_DWORD dst_color;
+  uint32_t dst_color;
   if (alpha_flag >> 8) {
     alpha = alpha_flag & 0xff;
     dst_color = FXCMYK_TODIB(color);
@@ -507,8 +507,8 @@
   }
   if (GetFormat() == FXDIB_Argb) {
     for (int row = 0; row < height; row++) {
-      FX_DWORD* dest_pos =
-          (FX_DWORD*)(m_pBuffer + (dest_top + row) * m_Pitch + dest_left * 4);
+      uint32_t* dest_pos =
+          (uint32_t*)(m_pBuffer + (dest_top + row) * m_Pitch + dest_left * 4);
       const uint8_t* src_scan = pMask->GetScanline(src_top + row);
       if (src_bpp == 1) {
         for (int col = 0; col < width; col++) {
@@ -563,22 +563,22 @@
   }
   return TRUE;
 }
-void CFX_DIBSource::CopyPalette(const FX_DWORD* pSrc, FX_DWORD size) {
+void CFX_DIBSource::CopyPalette(const uint32_t* pSrc, uint32_t size) {
   if (!pSrc || GetBPP() > 8) {
     FX_Free(m_pPalette);
     m_pPalette = NULL;
   } else {
-    FX_DWORD pal_size = 1 << GetBPP();
+    uint32_t pal_size = 1 << GetBPP();
     if (!m_pPalette) {
-      m_pPalette = FX_Alloc(FX_DWORD, pal_size);
+      m_pPalette = FX_Alloc(uint32_t, pal_size);
     }
     if (pal_size > size) {
       pal_size = size;
     }
-    FXSYS_memcpy(m_pPalette, pSrc, pal_size * sizeof(FX_DWORD));
+    FXSYS_memcpy(m_pPalette, pSrc, pal_size * sizeof(uint32_t));
   }
 }
-void CFX_DIBSource::GetPalette(FX_DWORD* pal, int alpha) const {
+void CFX_DIBSource::GetPalette(uint32_t* pal, int alpha) const {
   ASSERT(GetBPP() <= 8 && !IsCmykImage());
   if (GetBPP() == 1) {
     pal[0] =
@@ -1068,7 +1068,7 @@
   }
   return TRUE;
 }
-FX_DWORD CFX_DIBitmap::GetPixel(int x, int y) const {
+uint32_t CFX_DIBitmap::GetPixel(int x, int y) const {
   if (!m_pBuffer) {
     return 0;
   }
@@ -1101,7 +1101,7 @@
   }
   return 0;
 }
-void CFX_DIBitmap::SetPixel(int x, int y, FX_DWORD color) {
+void CFX_DIBitmap::SetPixel(int x, int y, uint32_t color) {
   if (!m_pBuffer) {
     return;
   }
@@ -1184,8 +1184,8 @@
   uint8_t* scanline = m_pBuffer + line * m_Pitch;
   if (src_Bpp == 0) {
     for (int i = 0; i < clip_width; i++) {
-      FX_DWORD dest_x = clip_left + i;
-      FX_DWORD src_x = dest_x * m_Width / dest_width;
+      uint32_t dest_x = clip_left + i;
+      uint32_t src_x = dest_x * m_Width / dest_width;
       if (bFlipX) {
         src_x = m_Width - src_x - 1;
       }
@@ -1194,8 +1194,8 @@
     }
   } else if (src_Bpp == 1) {
     for (int i = 0; i < clip_width; i++) {
-      FX_DWORD dest_x = clip_left + i;
-      FX_DWORD src_x = dest_x * m_Width / dest_width;
+      uint32_t dest_x = clip_left + i;
+      uint32_t src_x = dest_x * m_Width / dest_width;
       if (bFlipX) {
         src_x = m_Width - src_x - 1;
       }
@@ -1222,8 +1222,8 @@
     }
   } else {
     for (int i = 0; i < clip_width; i++) {
-      FX_DWORD dest_x = clip_left + i;
-      FX_DWORD src_x =
+      uint32_t dest_x = clip_left + i;
+      uint32_t src_x =
           bFlipX ? (m_Width - dest_x * m_Width / dest_width - 1) * src_Bpp
                  : (dest_x * m_Width / dest_width) * src_Bpp;
       src_x %= m_Width * src_Bpp;
@@ -1237,8 +1237,8 @@
 
 // TODO(weili): Split this function into two for handling CMYK and RGB
 // colors separately.
-FX_BOOL CFX_DIBitmap::ConvertColorScale(FX_DWORD forecolor,
-                                        FX_DWORD backcolor) {
+FX_BOOL CFX_DIBitmap::ConvertColorScale(uint32_t forecolor,
+                                        uint32_t backcolor) {
   ASSERT(!IsAlphaMask());
   if (!m_pBuffer || IsAlphaMask()) {
     return FALSE;
@@ -1371,7 +1371,7 @@
   }
   return TRUE;
 }
-FX_BOOL CFX_DIBitmap::DitherFS(const FX_DWORD* pPalette,
+FX_BOOL CFX_DIBitmap::DitherFS(const uint32_t* pPalette,
                                int pal_size,
                                const FX_RECT* pRect) {
   if (!m_pBuffer) {
@@ -1498,7 +1498,7 @@
       } else {
         ASSERT(Bpp == 4);
         for (int col = 0; col < m_Width; col++) {
-          *(FX_DWORD*)dest_scan = *(FX_DWORD*)src_scan;
+          *(uint32_t*)dest_scan = *(uint32_t*)src_scan;
           dest_scan -= 4;
           src_scan += 4;
         }
@@ -1507,7 +1507,7 @@
   }
   if (m_pAlphaMask) {
     pDestBuffer = pFlipped->m_pAlphaMask->GetBuffer();
-    FX_DWORD dest_pitch = pFlipped->m_pAlphaMask->GetPitch();
+    uint32_t dest_pitch = pFlipped->m_pAlphaMask->GetPitch();
     for (int row = 0; row < m_Height; row++) {
       const uint8_t* src_scan = m_pAlphaMask->GetScanline(row);
       uint8_t* dest_scan =
@@ -1595,9 +1595,9 @@
                                  const CFX_ClipRgn* pClipRgn,
                                  const CFX_DIBSource* pSource,
                                  int bitmap_alpha,
-                                 FX_DWORD mask_color,
+                                 uint32_t mask_color,
                                  const CFX_Matrix* pMatrix,
-                                 FX_DWORD dib_flags,
+                                 uint32_t dib_flags,
                                  FX_BOOL bRgbByteOrder,
                                  int alpha_flag,
                                  void* pIccTransform,
@@ -1748,7 +1748,7 @@
 FX_BOOL CFX_BitmapStorer::SetInfo(int width,
                                   int height,
                                   FXDIB_Format src_format,
-                                  FX_DWORD* pSrcPalette) {
+                                  uint32_t* pSrcPalette) {
   m_pBitmap = new CFX_DIBitmap;
   if (!m_pBitmap->Create(width, height, src_format)) {
     delete m_pBitmap;
diff --git a/core/fxge/dib/fx_dib_transform.cpp b/core/fxge/dib/fx_dib_transform.cpp
index dc6fb93..91c65fb 100644
--- a/core/fxge/dib/fx_dib_transform.cpp
+++ b/core/fxge/dib/fx_dib_transform.cpp
@@ -229,9 +229,9 @@
         dest_scan += (result_height - 1) * dest_pitch;
       }
       if (nBytes == 4) {
-        FX_DWORD* src_scan = (FX_DWORD*)GetScanline(row) + col_start;
+        uint32_t* src_scan = (uint32_t*)GetScanline(row) + col_start;
         for (int col = col_start; col < col_end; col++) {
-          *(FX_DWORD*)dest_scan = *src_scan++;
+          *(uint32_t*)dest_scan = *src_scan++;
           dest_scan += dest_step;
         }
       } else {
@@ -299,7 +299,7 @@
 CFX_DIBitmap* CFX_DIBSource::TransformTo(const CFX_Matrix* pDestMatrix,
                                          int& result_left,
                                          int& result_top,
-                                         FX_DWORD flags,
+                                         uint32_t flags,
                                          const FX_RECT* pDestClip) const {
   CFX_ImageTransformer transformer;
   transformer.Start(this, pDestMatrix, flags, pDestClip);
@@ -311,7 +311,7 @@
 }
 CFX_DIBitmap* CFX_DIBSource::StretchTo(int dest_width,
                                        int dest_height,
-                                       FX_DWORD flags,
+                                       uint32_t flags,
                                        const FX_RECT* pClip) const {
   FX_RECT clip_rect(0, 0, FXSYS_abs(dest_width), FXSYS_abs(dest_height));
   if (pClip) {
@@ -623,7 +623,7 @@
     int Bpp = m_Storer.GetBitmap()->GetBPP() / 8;
     int destBpp = pTransformed->GetBPP() / 8;
     if (Bpp == 1) {
-      FX_DWORD argb[256];
+      uint32_t argb[256];
       FX_ARGB* pPal = m_Storer.GetBitmap()->GetPalette();
       if (pPal) {
         for (int i = 0; i < 256; i++) {
@@ -667,7 +667,7 @@
               }
               int row_offset_l = src_row_l * stretch_pitch;
               int row_offset_r = src_row_r * stretch_pitch;
-              FX_DWORD r_bgra_cmyk = argb[bilinear_interpol(
+              uint32_t r_bgra_cmyk = argb[bilinear_interpol(
                   stretch_buf, row_offset_l, row_offset_r, src_col_l, src_col_r,
                   res_x, res_y, 1, 0)];
               if (transformF == FXDIB_Rgba) {
@@ -675,7 +675,7 @@
                 dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
                 dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
               } else {
-                *(FX_DWORD*)dest_pos = r_bgra_cmyk;
+                *(uint32_t*)dest_pos = r_bgra_cmyk;
               }
             }
             dest_pos += destBpp;
@@ -702,7 +702,7 @@
               bicubic_get_pos_weight(pos_pixel, u_w, v_w, src_col_l, src_row_l,
                                      res_x, res_y, stretch_width,
                                      stretch_height);
-              FX_DWORD r_bgra_cmyk =
+              uint32_t r_bgra_cmyk =
                   argb[bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel,
                                         u_w, v_w, res_x, res_y, 1, 0)];
               if (transformF == FXDIB_Rgba) {
@@ -710,7 +710,7 @@
                 dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
                 dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
               } else {
-                *(FX_DWORD*)dest_pos = r_bgra_cmyk;
+                *(uint32_t*)dest_pos = r_bgra_cmyk;
               }
             }
             dest_pos += destBpp;
@@ -731,14 +731,14 @@
               if (src_row == stretch_height) {
                 src_row--;
               }
-              FX_DWORD r_bgra_cmyk =
+              uint32_t r_bgra_cmyk =
                   argb[stretch_buf[src_row * stretch_pitch + src_col]];
               if (transformF == FXDIB_Rgba) {
                 dest_pos[0] = (uint8_t)(r_bgra_cmyk >> 24);
                 dest_pos[1] = (uint8_t)(r_bgra_cmyk >> 16);
                 dest_pos[2] = (uint8_t)(r_bgra_cmyk >> 8);
               } else {
-                *(FX_DWORD*)dest_pos = r_bgra_cmyk;
+                *(uint32_t*)dest_pos = r_bgra_cmyk;
               }
             }
             dest_pos += destBpp;
@@ -794,7 +794,7 @@
                     r_pos_k_r = bilinear_interpol(
                         stretch_buf, row_offset_l, row_offset_r, src_col_l,
                         src_col_r, res_x, res_y, Bpp, 3);
-                    *(FX_DWORD*)dest_pos =
+                    *(uint32_t*)dest_pos =
                         FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r,
                                                 r_pos_red_y_r, r_pos_k_r));
                   }
@@ -802,7 +802,7 @@
                   uint8_t r_pos_a_r = bilinear_interpol(
                       stretch_buf, row_offset_l, row_offset_r, src_col_l,
                       src_col_r, res_x, res_y, Bpp, 3);
-                  *(FX_DWORD*)dest_pos = FXARGB_TODIB(
+                  *(uint32_t*)dest_pos = FXARGB_TODIB(
                       FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r,
                                   r_pos_blue_c_r));
                 }
@@ -812,11 +812,11 @@
                   r_pos_k_r = bilinear_interpol(
                       stretch_buf, row_offset_l, row_offset_r, src_col_l,
                       src_col_r, res_x, res_y, Bpp, 3);
-                  *(FX_DWORD*)dest_pos =
+                  *(uint32_t*)dest_pos =
                       FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r,
                                               r_pos_red_y_r, r_pos_k_r));
                 } else {
-                  *(FX_DWORD*)dest_pos = FXARGB_TODIB(
+                  *(uint32_t*)dest_pos = FXARGB_TODIB(
                       FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r,
                                   r_pos_blue_c_r));
                 }
@@ -865,7 +865,7 @@
                     r_pos_k_r =
                         bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel,
                                          u_w, v_w, res_x, res_y, Bpp, 3);
-                    *(FX_DWORD*)dest_pos =
+                    *(uint32_t*)dest_pos =
                         FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r,
                                                 r_pos_red_y_r, r_pos_k_r));
                   }
@@ -873,7 +873,7 @@
                   uint8_t r_pos_a_r =
                       bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel,
                                        u_w, v_w, res_x, res_y, Bpp, 3);
-                  *(FX_DWORD*)dest_pos = FXARGB_TODIB(
+                  *(uint32_t*)dest_pos = FXARGB_TODIB(
                       FXARGB_MAKE(r_pos_a_r, r_pos_red_y_r, r_pos_green_m_r,
                                   r_pos_blue_c_r));
                 }
@@ -883,11 +883,11 @@
                   r_pos_k_r =
                       bicubic_interpol(stretch_buf, stretch_pitch, pos_pixel,
                                        u_w, v_w, res_x, res_y, Bpp, 3);
-                  *(FX_DWORD*)dest_pos =
+                  *(uint32_t*)dest_pos =
                       FXCMYK_TODIB(CmykEncode(r_pos_blue_c_r, r_pos_green_m_r,
                                               r_pos_red_y_r, r_pos_k_r));
                 } else {
-                  *(FX_DWORD*)dest_pos = FXARGB_TODIB(
+                  *(uint32_t*)dest_pos = FXARGB_TODIB(
                       FXARGB_MAKE(r_pos_k_r, r_pos_red_y_r, r_pos_green_m_r,
                                   r_pos_blue_c_r));
                 }
@@ -920,19 +920,19 @@
                     dest_pos[1] = src_pos[1];
                     dest_pos[2] = src_pos[2];
                   } else {
-                    *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(
+                    *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode(
                         src_pos[0], src_pos[1], src_pos[2], src_pos[3]));
                   }
                 } else {
-                  *(FX_DWORD*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(
+                  *(uint32_t*)dest_pos = FXARGB_TODIB(FXARGB_MAKE(
                       src_pos[3], src_pos[2], src_pos[1], src_pos[0]));
                 }
               } else {
                 if (transformF == FXDIB_Cmyka) {
-                  *(FX_DWORD*)dest_pos = FXCMYK_TODIB(CmykEncode(
+                  *(uint32_t*)dest_pos = FXCMYK_TODIB(CmykEncode(
                       src_pos[0], src_pos[1], src_pos[2], src_pos[3]));
                 } else {
-                  *(FX_DWORD*)dest_pos = FXARGB_TODIB(
+                  *(uint32_t*)dest_pos = FXARGB_TODIB(
                       FXARGB_MAKE(0xff, src_pos[2], src_pos[1], src_pos[0]));
                 }
               }
diff --git a/core/fxge/ge/fx_ge_device.cpp b/core/fxge/ge/fx_ge_device.cpp
index eefac5c..d791859 100644
--- a/core/fxge/ge/fx_ge_device.cpp
+++ b/core/fxge/ge/fx_ge_device.cpp
@@ -113,8 +113,8 @@
 FX_BOOL CFX_RenderDevice::DrawPath(const CFX_PathData* pPathData,
                                    const CFX_Matrix* pObject2Device,
                                    const CFX_GraphStateData* pGraphState,
-                                   FX_DWORD fill_color,
-                                   FX_DWORD stroke_color,
+                                   uint32_t fill_color,
+                                   uint32_t stroke_color,
                                    int fill_mode,
                                    int alpha_flag,
                                    void* pIccTransform,
@@ -201,7 +201,7 @@
                                    m_pDeviceDriver->GetDriverType())) {
       CFX_GraphStateData graphState;
       graphState.m_LineWidth = 0.0f;
-      FX_DWORD strokecolor = fill_color;
+      uint32_t strokecolor = fill_color;
       if (bThin) {
         if (FXGETFLAG_COLORTYPE(alpha_flag)) {
           FXSETFLAG_ALPHA_STROKE(alpha_flag, fill_alpha >> 2);
@@ -244,8 +244,8 @@
     const CFX_PathData* pPathData,
     const CFX_Matrix* pObject2Device,
     const CFX_GraphStateData* pGraphState,
-    FX_DWORD fill_color,
-    FX_DWORD stroke_color,
+    uint32_t fill_color,
+    uint32_t stroke_color,
     int fill_mode,
     int alpha_flag,
     void* pIccTransform,
@@ -302,7 +302,7 @@
 
 FX_BOOL CFX_RenderDevice::SetPixel(int x,
                                    int y,
-                                   FX_DWORD color,
+                                   uint32_t color,
                                    int alpha_flag,
                                    void* pIccTransform) {
   if (m_pDeviceDriver->SetPixel(x, y, color, alpha_flag, pIccTransform)) {
@@ -312,7 +312,7 @@
   return FillRect(&rect, color, alpha_flag, pIccTransform);
 }
 FX_BOOL CFX_RenderDevice::FillRect(const FX_RECT* pRect,
-                                   FX_DWORD fill_color,
+                                   uint32_t fill_color,
                                    int alpha_flag,
                                    void* pIccTransform,
                                    int blend_type) {
@@ -343,7 +343,7 @@
                                            FX_FLOAT y1,
                                            FX_FLOAT x2,
                                            FX_FLOAT y2,
-                                           FX_DWORD color,
+                                           uint32_t color,
                                            int fill_mode,
                                            int alpha_flag,
                                            void* pIccTransform,
@@ -436,7 +436,7 @@
                                         int top,
                                         int dest_width,
                                         int dest_height,
-                                        FX_DWORD flags,
+                                        uint32_t flags,
                                         void* pIccTransform,
                                         int blend_mode) {
   FX_RECT dest_rect(left, top, left + dest_width, top + dest_height);
@@ -452,7 +452,7 @@
 FX_BOOL CFX_RenderDevice::SetBitMask(const CFX_DIBSource* pBitmap,
                                      int left,
                                      int top,
-                                     FX_DWORD argb,
+                                     uint32_t argb,
                                      int alpha_flag,
                                      void* pIccTransform) {
   FX_RECT src_rect(0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
@@ -465,8 +465,8 @@
                                          int top,
                                          int dest_width,
                                          int dest_height,
-                                         FX_DWORD argb,
-                                         FX_DWORD flags,
+                                         uint32_t argb,
+                                         uint32_t flags,
                                          int alpha_flag,
                                          void* pIccTransform) {
   FX_RECT dest_rect(left, top, left + dest_width, top + dest_height);
@@ -478,9 +478,9 @@
 }
 FX_BOOL CFX_RenderDevice::StartDIBits(const CFX_DIBSource* pBitmap,
                                       int bitmap_alpha,
-                                      FX_DWORD argb,
+                                      uint32_t argb,
                                       const CFX_Matrix* pMatrix,
-                                      FX_DWORD flags,
+                                      uint32_t flags,
                                       void*& handle,
                                       int alpha_flag,
                                       void* pIccTransform,
diff --git a/core/fxge/ge/fx_ge_font.cpp b/core/fxge/ge/fx_ge_font.cpp
index b2c92f5..04019a0 100644
--- a/core/fxge/ge/fx_ge_font.cpp
+++ b/core/fxge/ge/fx_ge_font.cpp
@@ -13,7 +13,7 @@
 namespace {
 
 #ifdef PDF_ENABLE_XFA
-const FX_DWORD g_EncodingID[] = {
+const uint32_t g_EncodingID[] = {
     FXFM_ENCODING_MS_SYMBOL,     FXFM_ENCODING_UNICODE,
     FXFM_ENCODING_MS_SJIS,       FXFM_ENCODING_MS_GB2312,
     FXFM_ENCODING_MS_BIG5,       FXFM_ENCODING_MS_WANSUNG,
@@ -24,7 +24,7 @@
 };
 
 CFX_UnicodeEncodingEx* _FXFM_CreateFontEncoding(CFX_Font* pFont,
-                                                FX_DWORD nEncodingID) {
+                                                uint32_t nEncodingID) {
   if (FXFT_Select_Charmap(pFont->GetFace(), nEncodingID))
     return nullptr;
   return new CFX_UnicodeEncodingEx(pFont, nEncodingID);
@@ -127,7 +127,7 @@
 }
 void CFX_Font::LoadSubst(const CFX_ByteString& face_name,
                          FX_BOOL bTrueType,
-                         FX_DWORD flags,
+                         uint32_t flags,
                          int weight,
                          int italic_angle,
                          int CharsetCP,
@@ -213,7 +213,7 @@
 }
 #endif  // PDF_ENABLE_XFA
 
-int CFX_Font::GetGlyphWidth(FX_DWORD glyph_index) {
+int CFX_Font::GetGlyphWidth(uint32_t glyph_index) {
   if (!m_Face) {
     return 0;
   }
@@ -231,7 +231,7 @@
   return width;
 }
 
-FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, FX_DWORD size) {
+FX_BOOL CFX_Font::LoadEmbedded(const uint8_t* data, uint32_t size) {
   m_pFontDataAllocation = FX_Alloc(uint8_t, size);
   FXSYS_memcpy(m_pFontDataAllocation, data, size);
   m_Face = FT_LoadFont(m_pFontDataAllocation, size);
@@ -261,7 +261,7 @@
                    FXFT_Get_Face_Descender(m_Face));
 }
 
-FX_BOOL CFX_Font::GetGlyphBBox(FX_DWORD glyph_index, FX_RECT& bbox) {
+FX_BOOL CFX_Font::GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox) {
   if (!m_Face)
     return FALSE;
 
@@ -448,7 +448,7 @@
 
 CFX_UnicodeEncoding::~CFX_UnicodeEncoding() {}
 
-FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode) {
+uint32_t CFX_UnicodeEncoding::GlyphFromCharCode(uint32_t charcode) {
   FXFT_Face face = m_pFont->GetFace();
   if (!face)
     return charcode;
@@ -457,7 +457,7 @@
     return FXFT_Get_Char_Index(face, charcode);
 
   if (m_pFont->GetSubstFont() && m_pFont->GetSubstFont()->m_Charset == 2) {
-    FX_DWORD index = 0;
+    uint32_t index = 0;
     if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0)
       index = FXFT_Get_Char_Index(face, charcode);
     if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN))
@@ -468,12 +468,12 @@
 
 #ifdef PDF_ENABLE_XFA
 CFX_UnicodeEncodingEx::CFX_UnicodeEncodingEx(CFX_Font* pFont,
-                                             FX_DWORD EncodingID)
+                                             uint32_t EncodingID)
     : CFX_UnicodeEncoding(pFont), m_nEncodingID(EncodingID) {}
 
 CFX_UnicodeEncodingEx::~CFX_UnicodeEncodingEx() {}
 
-FX_DWORD CFX_UnicodeEncodingEx::GlyphFromCharCode(FX_DWORD charcode) {
+uint32_t CFX_UnicodeEncodingEx::GlyphFromCharCode(uint32_t charcode) {
   FXFT_Face face = m_pFont->GetFace();
   FT_UInt nIndex = FXFT_Get_Char_Index(face, charcode);
   if (nIndex > 0) {
@@ -482,7 +482,7 @@
   int nmaps = FXFT_Get_Face_CharmapCount(face);
   int m = 0;
   while (m < nmaps) {
-    FX_DWORD nEncodingID =
+    uint32_t nEncodingID =
         FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[m++]);
     if (m_nEncodingID == nEncodingID) {
       continue;
@@ -501,7 +501,7 @@
   return 0;
 }
 
-FX_DWORD CFX_UnicodeEncodingEx::CharCodeFromUnicode(FX_WCHAR Unicode) const {
+uint32_t CFX_UnicodeEncodingEx::CharCodeFromUnicode(FX_WCHAR Unicode) const {
   if (m_nEncodingID == FXFM_ENCODING_UNICODE ||
       m_nEncodingID == FXFM_ENCODING_MS_SYMBOL) {
     return Unicode;
@@ -516,11 +516,11 @@
       return Unicode;
     }
   }
-  return static_cast<FX_DWORD>(-1);
+  return static_cast<uint32_t>(-1);
 }
 
 CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(CFX_Font* pFont,
-                                               FX_DWORD nEncodingID) {
+                                               uint32_t nEncodingID) {
   if (!pFont || !pFont->GetFace())
     return nullptr;
 
diff --git a/core/fxge/ge/fx_ge_fontmap.cpp b/core/fxge/ge/fx_ge_fontmap.cpp
index 27b82f5..709ef00 100644
--- a/core/fxge/ge/fx_ge_fontmap.cpp
+++ b/core/fxge/ge/fx_ge_fontmap.cpp
@@ -16,7 +16,7 @@
 
 #define GET_TT_SHORT(w) (uint16_t)(((w)[0] << 8) | (w)[1])
 #define GET_TT_LONG(w) \
-  (FX_DWORD)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3])
+  (uint32_t)(((w)[0] << 24) | ((w)[1] << 16) | ((w)[2] << 8) | (w)[3])
 
 #define FX_FONT_STYLE_None 0x00
 #define FX_FONT_STYLE_Bold 0x01
@@ -27,7 +27,7 @@
 
 struct BuiltinFont {
   const uint8_t* m_pFontData;
-  FX_DWORD m_dwSize;
+  uint32_t m_dwSize;
 };
 
 const BuiltinFont g_FoxitFonts[14] = {
@@ -211,8 +211,8 @@
     {10081, 86},
 };
 
-const FX_DWORD kTableNAME = FXDWORD_GET_MSBFIRST("name");
-const FX_DWORD kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf");
+const uint32_t kTableNAME = FXDWORD_GET_MSBFIRST("name");
+const uint32_t kTableTTCF = FXDWORD_GET_MSBFIRST("ttcf");
 
 int CompareFontFamilyString(const void* key, const void* element) {
   CFX_ByteString str_key((const FX_CHAR*)key);
@@ -237,7 +237,7 @@
   return key;
 }
 
-CFX_ByteString KeyNameFromSize(int ttc_size, FX_DWORD checksum) {
+CFX_ByteString KeyNameFromSize(int ttc_size, uint32_t checksum) {
   CFX_ByteString key;
   key.Format("%d:%d", ttc_size, checksum);
   return key;
@@ -256,7 +256,7 @@
   return norm;
 }
 
-CFX_ByteString FPDF_ReadStringFromFile(FXSYS_FILE* pFile, FX_DWORD size) {
+CFX_ByteString FPDF_ReadStringFromFile(FXSYS_FILE* pFile, uint32_t size) {
   CFX_ByteString buffer;
   if (!FXSYS_fread(buffer.GetBuffer(size), size, 1, pFile)) {
     return CFX_ByteString();
@@ -267,13 +267,13 @@
 
 CFX_ByteString FPDF_LoadTableFromTT(FXSYS_FILE* pFile,
                                     const uint8_t* pTables,
-                                    FX_DWORD nTables,
-                                    FX_DWORD tag) {
-  for (FX_DWORD i = 0; i < nTables; i++) {
+                                    uint32_t nTables,
+                                    uint32_t tag) {
+  for (uint32_t i = 0; i < nTables; i++) {
     const uint8_t* p = pTables + i * 16;
     if (GET_TT_LONG(p) == tag) {
-      FX_DWORD offset = GET_TT_LONG(p + 8);
-      FX_DWORD size = GET_TT_LONG(p + 12);
+      uint32_t offset = GET_TT_LONG(p + 8);
+      uint32_t size = GET_TT_LONG(p + 12);
       FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
       return FPDF_ReadStringFromFile(pFile, size);
     }
@@ -362,7 +362,7 @@
   return FALSE;
 }
 
-FX_DWORD GetCharset(int charset) {
+uint32_t GetCharset(int charset) {
   switch (charset) {
     case FXFONT_SHIFTJIS_CHARSET:
       return CHARSET_FLAG_SHIFTJIS;
@@ -385,7 +385,7 @@
 int32_t GetSimilarValue(int weight,
                         FX_BOOL bItalic,
                         int pitch_family,
-                        FX_DWORD style) {
+                        uint32_t style) {
   int32_t iSimilarValue = 0;
   if (!!(style & FXFONT_BOLD) == (weight > 400)) {
     iSimilarValue += 16;
@@ -480,7 +480,7 @@
 
 FXFT_Face CFX_FontMgr::FindSubstFont(const CFX_ByteString& face_name,
                                      FX_BOOL bTrueType,
-                                     FX_DWORD flags,
+                                     uint32_t flags,
                                      int weight,
                                      int italic_angle,
                                      int CharsetCP,
@@ -507,7 +507,7 @@
                                      int weight,
                                      FX_BOOL bItalic,
                                      uint8_t* pData,
-                                     FX_DWORD size,
+                                     uint32_t size,
                                      int face_index) {
   CTTFontDesc* pFontDesc = new CTTFontDesc;
   pFontDesc->m_Type = 1;
@@ -535,12 +535,12 @@
 }
 
 int GetTTCIndex(const uint8_t* pFontData,
-                FX_DWORD ttc_size,
-                FX_DWORD font_offset) {
+                uint32_t ttc_size,
+                uint32_t font_offset) {
   int face_index = 0;
   const uint8_t* p = pFontData + 8;
-  FX_DWORD nfont = GET_TT_LONG(p);
-  FX_DWORD index;
+  uint32_t nfont = GET_TT_LONG(p);
+  uint32_t index;
   for (index = 0; index < nfont; index++) {
     p = pFontData + 12 + index * 4;
     if (GET_TT_LONG(p) == font_offset) {
@@ -555,7 +555,7 @@
   return face_index;
 }
 FXFT_Face CFX_FontMgr::GetCachedTTCFace(int ttc_size,
-                                        FX_DWORD checksum,
+                                        uint32_t checksum,
                                         int font_offset,
                                         uint8_t*& pFontData) {
   auto it = m_FaceMap.find(KeyNameFromSize(ttc_size, checksum));
@@ -573,9 +573,9 @@
   return pFontDesc->m_TTCFace.m_pFaces[face_index];
 }
 FXFT_Face CFX_FontMgr::AddCachedTTCFace(int ttc_size,
-                                        FX_DWORD checksum,
+                                        uint32_t checksum,
                                         uint8_t* pData,
-                                        FX_DWORD size,
+                                        uint32_t size,
                                         int font_offset) {
   CTTFontDesc* pFontDesc = new CTTFontDesc;
   pFontDesc->m_Type = 2;
@@ -592,7 +592,7 @@
 }
 
 FXFT_Face CFX_FontMgr::GetFixedFace(const uint8_t* pData,
-                                    FX_DWORD size,
+                                    uint32_t size,
                                     int face_index) {
   InitFTLibrary();
   FXFT_Library library = m_FTLibrary;
@@ -633,7 +633,7 @@
 
 bool CFX_FontMgr::GetBuiltinFont(size_t index,
                                  const uint8_t** pFontData,
-                                 FX_DWORD* size) {
+                                 uint32_t* size) {
   if (index < FX_ArraySize(g_FoxitFonts)) {
     *pFontData = g_FoxitFonts[index].m_pFontData;
     *size = g_FoxitFonts[index].m_dwSize;
@@ -682,7 +682,7 @@
   m_pFontInfo = pFontInfo;
 }
 static CFX_ByteString GetStringFromTable(const uint8_t* string_ptr,
-                                         FX_DWORD string_ptr_length,
+                                         uint32_t string_ptr_length,
                                          uint16_t offset,
                                          uint16_t length) {
   if (string_ptr_length < offset + length) {
@@ -691,13 +691,13 @@
   return CFX_ByteStringC(string_ptr + offset, length);
 }
 CFX_ByteString GetNameFromTT(const uint8_t* name_table,
-                             FX_DWORD name_table_size,
-                             FX_DWORD name_id) {
+                             uint32_t name_table_size,
+                             uint32_t name_id) {
   if (!name_table || name_table_size < 6) {
     return CFX_ByteString();
   }
-  FX_DWORD name_count = GET_TT_SHORT(name_table + 2);
-  FX_DWORD string_offset = GET_TT_SHORT(name_table + 4);
+  uint32_t name_count = GET_TT_SHORT(name_table + 2);
+  uint32_t string_offset = GET_TT_SHORT(name_table + 4);
   // We will ignore the possibility of overlap of structures and
   // string table as if it's all corrupt there's not a lot we can do.
   if (name_table_size < string_offset) {
@@ -705,14 +705,14 @@
   }
 
   const uint8_t* string_ptr = name_table + string_offset;
-  FX_DWORD string_ptr_size = name_table_size - string_offset;
+  uint32_t string_ptr_size = name_table_size - string_offset;
   name_table += 6;
   name_table_size -= 6;
   if (name_table_size < name_count * 12) {
     return CFX_ByteString();
   }
 
-  for (FX_DWORD i = 0; i < name_count; i++, name_table += 12) {
+  for (uint32_t i = 0; i < name_count; i++, name_table += 12) {
     if (GET_TT_SHORT(name_table + 6) == name_id &&
         GET_TT_SHORT(name_table) == 1 && GET_TT_SHORT(name_table + 2) == 0) {
       return GetStringFromTable(string_ptr, string_ptr_size,
@@ -727,13 +727,13 @@
   if (!m_pFontInfo)
     return CFX_ByteString();
 
-  FX_DWORD size = m_pFontInfo->GetFontData(hFont, kTableNAME, nullptr, 0);
+  uint32_t size = m_pFontInfo->GetFontData(hFont, kTableNAME, nullptr, 0);
   if (!size)
     return CFX_ByteString();
 
   std::vector<uint8_t> buffer(size);
   uint8_t* buffer_ptr = buffer.data();
-  FX_DWORD bytes_read =
+  uint32_t bytes_read =
       m_pFontInfo->GetFontData(hFont, kTableNAME, buffer_ptr, size);
   return bytes_read == size ? GetNameFromTT(buffer_ptr, bytes_read, 6)
                             : CFX_ByteString();
@@ -743,8 +743,8 @@
   if (!m_pFontInfo) {
     return;
   }
-  if (m_CharsetArray.Find((FX_DWORD)charset) == -1) {
-    m_CharsetArray.Add((FX_DWORD)charset);
+  if (m_CharsetArray.Find((uint32_t)charset) == -1) {
+    m_CharsetArray.Add((uint32_t)charset);
     m_FaceArray.push_back(name);
   }
   if (name == m_LastFamily) {
@@ -820,7 +820,7 @@
       return m_FoxitFaces[iBaseFont];
     }
     const uint8_t* pFontData = NULL;
-    FX_DWORD size = 0;
+    uint32_t size = 0;
     if (m_pFontMgr->GetBuiltinFont(iBaseFont, &pFontData, &size)) {
       m_FoxitFaces[iBaseFont] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
       return m_FoxitFaces[iBaseFont];
@@ -838,7 +838,7 @@
       return m_MMFaces[1];
     }
     const uint8_t* pFontData = NULL;
-    FX_DWORD size = 0;
+    uint32_t size = 0;
     m_pFontMgr->GetBuiltinFont(14, &pFontData, &size);
     m_MMFaces[1] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
     return m_MMFaces[1];
@@ -848,7 +848,7 @@
     return m_MMFaces[0];
   }
   const uint8_t* pFontData = NULL;
-  FX_DWORD size = 0;
+  uint32_t size = 0;
   m_pFontMgr->GetBuiltinFont(15, &pFontData, &size);
   m_MMFaces[0] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
   return m_MMFaces[0];
@@ -856,7 +856,7 @@
 
 FXFT_Face CFX_FontMapper::FindSubstFont(const CFX_ByteString& name,
                                         FX_BOOL bTrueType,
-                                        FX_DWORD flags,
+                                        uint32_t flags,
                                         int weight,
                                         int italic_angle,
                                         int WindowCP,
@@ -881,7 +881,7 @@
       return m_FoxitFaces[12];
     }
     const uint8_t* pFontData = NULL;
-    FX_DWORD size = 0;
+    uint32_t size = 0;
     m_pFontMgr->GetBuiltinFont(12, &pFontData, &size);
     m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
     return m_FoxitFaces[12];
@@ -894,7 +894,7 @@
       return m_FoxitFaces[13];
     }
     const uint8_t* pFontData = NULL;
-    FX_DWORD size = 0;
+    uint32_t size = 0;
     m_pFontMgr->GetBuiltinFont(13, &pFontData, &size);
     m_FoxitFaces[13] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
     return m_FoxitFaces[13];
@@ -918,7 +918,7 @@
     }
   int PitchFamily = 0;
   FX_BOOL bItalic = FALSE;
-  FX_DWORD nStyle = 0;
+  uint32_t nStyle = 0;
   FX_BOOL bStyleAvail = FALSE;
   if (iBaseFont < 12) {
     family = g_Base14FontNames[iBaseFont];
@@ -1139,7 +1139,7 @@
             return m_FoxitFaces[12];
           }
           const uint8_t* pFontData = NULL;
-          FX_DWORD size = 0;
+          uint32_t size = 0;
           m_pFontMgr->GetBuiltinFont(12, &pFontData, &size);
           m_FoxitFaces[12] = m_pFontMgr->GetFixedFace(pFontData, size, 0);
           return m_FoxitFaces[12];
@@ -1170,8 +1170,8 @@
   if (Charset == FXFONT_DEFAULT_CHARSET) {
     m_pFontInfo->GetFontCharset(hFont, Charset);
   }
-  FX_DWORD ttc_size = m_pFontInfo->GetFontData(hFont, kTableTTCF, nullptr, 0);
-  FX_DWORD font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0);
+  uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, kTableTTCF, nullptr, 0);
+  uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, nullptr, 0);
   if (font_size == 0 && ttc_size == 0) {
     m_pFontInfo->DeleteFont(hFont);
     return nullptr;
@@ -1180,9 +1180,9 @@
   if (ttc_size) {
     uint8_t temp[1024];
     m_pFontInfo->GetFontData(hFont, kTableTTCF, temp, 1024);
-    FX_DWORD checksum = 0;
+    uint32_t checksum = 0;
     for (int i = 0; i < 256; i++) {
-      checksum += ((FX_DWORD*)temp)[i];
+      checksum += ((uint32_t*)temp)[i];
     }
     uint8_t* pFontData;
     face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum,
@@ -1239,8 +1239,8 @@
   return face;
 }
 #ifdef PDF_ENABLE_XFA
-FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(FX_DWORD dwUnicode,
-                                                 FX_DWORD flags,
+FXFT_Face CFX_FontMapper::FindSubstFontByUnicode(uint32_t dwUnicode,
+                                                 uint32_t flags,
                                                  int weight,
                                                  int italic_angle) {
   if (m_pFontInfo == NULL) {
@@ -1262,8 +1262,8 @@
   if (hFont == NULL) {
     return NULL;
   }
-  FX_DWORD ttc_size = m_pFontInfo->GetFontData(hFont, 0x74746366, NULL, 0);
-  FX_DWORD font_size = m_pFontInfo->GetFontData(hFont, 0, NULL, 0);
+  uint32_t ttc_size = m_pFontInfo->GetFontData(hFont, 0x74746366, NULL, 0);
+  uint32_t font_size = m_pFontInfo->GetFontData(hFont, 0, NULL, 0);
   if (font_size == 0 && ttc_size == 0) {
     m_pFontInfo->DeleteFont(hFont);
     return NULL;
@@ -1272,9 +1272,9 @@
   if (ttc_size) {
     uint8_t temp[1024];
     m_pFontInfo->GetFontData(hFont, 0x74746366, temp, 1024);
-    FX_DWORD checksum = 0;
+    uint32_t checksum = 0;
     for (int i = 0; i < 256; i++) {
-      checksum += ((FX_DWORD*)temp)[i];
+      checksum += ((uint32_t*)temp)[i];
     }
     uint8_t* pFontData;
     face = m_pFontMgr->GetCachedTTCFace(ttc_size, checksum,
@@ -1308,7 +1308,7 @@
   return face;
 }
 
-void* IFX_SystemFontInfo::MapFontByUnicode(FX_DWORD dwUnicode,
+void* IFX_SystemFontInfo::MapFontByUnicode(uint32_t dwUnicode,
                                            int weight,
                                            FX_BOOL bItalic,
                                            int pitch_family) {
@@ -1415,7 +1415,7 @@
     return;
   }
   FXSYS_fseek(pFile, 0, FXSYS_SEEK_END);
-  FX_DWORD filesize = FXSYS_ftell(pFile);
+  uint32_t filesize = FXSYS_ftell(pFile);
   uint8_t buffer[16];
   FXSYS_fseek(pFile, 0, FXSYS_SEEK_SET);
   size_t readCnt = FXSYS_fread(buffer, 12, 1, pFile);
@@ -1425,12 +1425,12 @@
   }
 
   if (GET_TT_LONG(buffer) == kTableTTCF) {
-    FX_DWORD nFaces = GET_TT_LONG(buffer + 8);
-    if (nFaces > std::numeric_limits<FX_DWORD>::max() / 4) {
+    uint32_t nFaces = GET_TT_LONG(buffer + 8);
+    if (nFaces > std::numeric_limits<uint32_t>::max() / 4) {
       FXSYS_fclose(pFile);
       return;
     }
-    FX_DWORD face_bytes = nFaces * 4;
+    uint32_t face_bytes = nFaces * 4;
     uint8_t* offsets = FX_Alloc(uint8_t, face_bytes);
     readCnt = FXSYS_fread(offsets, 1, face_bytes, pFile);
     if (readCnt != face_bytes) {
@@ -1438,7 +1438,7 @@
       FXSYS_fclose(pFile);
       return;
     }
-    for (FX_DWORD i = 0; i < nFaces; i++) {
+    for (uint32_t i = 0; i < nFaces; i++) {
       uint8_t* p = offsets + i * 4;
       ReportFace(path, pFile, filesize, GET_TT_LONG(p));
     }
@@ -1450,14 +1450,14 @@
 }
 void CFX_FolderFontInfo::ReportFace(const CFX_ByteString& path,
                                     FXSYS_FILE* pFile,
-                                    FX_DWORD filesize,
-                                    FX_DWORD offset) {
+                                    uint32_t filesize,
+                                    uint32_t offset) {
   FXSYS_fseek(pFile, offset, FXSYS_SEEK_SET);
   char buffer[16];
   if (!FXSYS_fread(buffer, 12, 1, pFile)) {
     return;
   }
-  FX_DWORD nTables = GET_TT_SHORT(buffer + 4);
+  uint32_t nTables = GET_TT_SHORT(buffer + 4);
   CFX_ByteString tables = FPDF_ReadStringFromFile(pFile, nTables * 16);
   if (tables.IsEmpty()) {
     return;
@@ -1483,7 +1483,7 @@
   CFX_ByteString os2 = FPDF_LoadTableFromTT(pFile, tables, nTables, 0x4f532f32);
   if (os2.GetLength() >= 86) {
     const uint8_t* p = (const uint8_t*)os2 + 78;
-    FX_DWORD codepages = GET_TT_LONG(p);
+    uint32_t codepages = GET_TT_LONG(p);
     if (codepages & (1 << 17)) {
       m_pMapper->AddInstalledFont(facename, FXFONT_SHIFTJIS_CHARSET);
       pInfo->m_Charsets |= CHARSET_FLAG_SHIFTJIS;
@@ -1540,7 +1540,7 @@
   if (charset == FXFONT_ANSI_CHARSET && (pitch_family & FXFONT_FF_FIXEDPITCH)) {
     return GetFont("Courier New");
   }
-  FX_DWORD charset_flag = GetCharset(charset);
+  uint32_t charset_flag = GetCharset(charset);
   int32_t iBestSimilar = 0;
   for (const auto& it : m_FontList) {
     const CFX_ByteString& bsName = it.first;
@@ -1572,7 +1572,7 @@
 }
 
 #ifdef PDF_ENABLE_XFA
-void* CFX_FolderFontInfo::MapFontByUnicode(FX_DWORD dwUnicode,
+void* CFX_FolderFontInfo::MapFontByUnicode(uint32_t dwUnicode,
                                            int weight,
                                            FX_BOOL bItalic,
                                            int pitch_family) {
@@ -1585,23 +1585,23 @@
   return it != m_FontList.end() ? it->second : nullptr;
 }
 
-FX_DWORD CFX_FolderFontInfo::GetFontData(void* hFont,
-                                         FX_DWORD table,
+uint32_t CFX_FolderFontInfo::GetFontData(void* hFont,
+                                         uint32_t table,
                                          uint8_t* buffer,
-                                         FX_DWORD size) {
+                                         uint32_t size) {
   if (!hFont)
     return 0;
 
   const CFX_FontFaceInfo* pFont = static_cast<CFX_FontFaceInfo*>(hFont);
-  FX_DWORD datasize = 0;
-  FX_DWORD offset = 0;
+  uint32_t datasize = 0;
+  uint32_t offset = 0;
   if (table == 0) {
     datasize = pFont->m_FontOffset ? 0 : pFont->m_FileSize;
   } else if (table == kTableTTCF) {
     datasize = pFont->m_FontOffset ? pFont->m_FileSize : 0;
   } else {
-    FX_DWORD nTables = pFont->m_FontTables.GetLength() / 16;
-    for (FX_DWORD i = 0; i < nTables; i++) {
+    uint32_t nTables = pFont->m_FontTables.GetLength() / 16;
+    for (uint32_t i = 0; i < nTables; i++) {
       const uint8_t* p =
           static_cast<const uint8_t*>(pFont->m_FontTables) + i * 16;
       if (GET_TT_LONG(p) == table) {
diff --git a/core/fxge/ge/fx_ge_ps.cpp b/core/fxge/ge/fx_ge_ps.cpp
index 2470025..32f2fce 100644
--- a/core/fxge/ge/fx_ge_ps.cpp
+++ b/core/fxge/ge/fx_ge_ps.cpp
@@ -11,7 +11,7 @@
 
 struct PSGlyph {
   CFX_Font* m_pFont;
-  FX_DWORD m_GlyphIndex;
+  uint32_t m_GlyphIndex;
   FX_BOOL m_bGlyphAdjust;
   FX_FLOAT m_AdjustMatrix[4];
 };
@@ -178,8 +178,8 @@
 FX_BOOL CFX_PSRenderer::DrawPath(const CFX_PathData* pPathData,
                                  const CFX_Matrix* pObject2Device,
                                  const CFX_GraphStateData* pGraphState,
-                                 FX_DWORD fill_color,
-                                 FX_DWORD stroke_color,
+                                 uint32_t fill_color,
+                                 uint32_t stroke_color,
                                  int fill_mode,
                                  int alpha_flag,
                                  void* pIccTransform) {
@@ -275,7 +275,7 @@
                             int width,
                             int height,
                             uint8_t*& dest_buf,
-                            FX_DWORD& dest_size) {
+                            uint32_t& dest_size) {
   CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
   if (width * height > 128 && pEncoders &&
       pEncoders->GetFaxModule()->Encode(src_buf, width, height, (width + 7) / 8,
@@ -288,9 +288,9 @@
 }
 static void PSCompressData(int PSLevel,
                            uint8_t* src_buf,
-                           FX_DWORD src_size,
+                           uint32_t src_size,
                            uint8_t*& output_buf,
-                           FX_DWORD& output_size,
+                           uint32_t& output_size,
                            const FX_CHAR*& filter) {
   output_buf = src_buf;
   output_size = src_size;
@@ -300,7 +300,7 @@
   }
   CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
   uint8_t* dest_buf = NULL;
-  FX_DWORD dest_size = src_size;
+  uint32_t dest_size = src_size;
   if (PSLevel >= 3) {
     if (pEncoders &&
         pEncoders->GetFlateModule()->Encode(src_buf, src_size, dest_buf,
@@ -323,7 +323,7 @@
   }
 }
 FX_BOOL CFX_PSRenderer::SetDIBits(const CFX_DIBSource* pSource,
-                                  FX_DWORD color,
+                                  uint32_t color,
                                   int left,
                                   int top,
                                   int alpha_flag,
@@ -335,12 +335,12 @@
   return DrawDIBits(pSource, color, &matrix, 0, alpha_flag, pIccTransform);
 }
 FX_BOOL CFX_PSRenderer::StretchDIBits(const CFX_DIBSource* pSource,
-                                      FX_DWORD color,
+                                      uint32_t color,
                                       int dest_left,
                                       int dest_top,
                                       int dest_width,
                                       int dest_height,
-                                      FX_DWORD flags,
+                                      uint32_t flags,
                                       int alpha_flag,
                                       void* pIccTransform) {
   StartRendering();
@@ -350,9 +350,9 @@
   return DrawDIBits(pSource, color, &matrix, flags, alpha_flag, pIccTransform);
 }
 FX_BOOL CFX_PSRenderer::DrawDIBits(const CFX_DIBSource* pSource,
-                                   FX_DWORD color,
+                                   uint32_t color,
                                    const CFX_Matrix* pMatrix,
-                                   FX_DWORD flags,
+                                   uint32_t flags,
                                    int alpha_flag,
                                    void* pIccTransform) {
   StartRendering();
@@ -377,14 +377,14 @@
   buf << width << " " << height;
   if (pSource->GetBPP() == 1 && !pSource->GetPalette()) {
     int pitch = (width + 7) / 8;
-    FX_DWORD src_size = height * pitch;
+    uint32_t src_size = height * pitch;
     uint8_t* src_buf = FX_Alloc(uint8_t, src_size);
     for (int row = 0; row < height; row++) {
       const uint8_t* src_scan = pSource->GetScanline(row);
       FXSYS_memcpy(src_buf + row * pitch, src_scan, pitch);
     }
     uint8_t* output_buf;
-    FX_DWORD output_size;
+    uint32_t output_size;
     FaxCompressData(src_buf, width, height, output_buf, output_size);
     if (pSource->IsAlphaMask()) {
       SetColor(color, alpha_flag, pIccTransform);
@@ -469,7 +469,7 @@
         }
       }
       uint8_t* compressed_buf;
-      FX_DWORD compressed_size;
+      uint32_t compressed_size;
       PSCompressData(m_PSLevel, output_buf, output_size, compressed_buf,
                      compressed_size, filter);
       if (output_buf != compressed_buf) {
@@ -497,7 +497,7 @@
   OUTPUT_PS("\nQ\n");
   return TRUE;
 }
-void CFX_PSRenderer::SetColor(FX_DWORD color,
+void CFX_PSRenderer::SetColor(uint32_t color,
                               int alpha_flag,
                               void* pIccTransform) {
   if (!CFX_GEModule::Get()->GetCodecModule() ||
@@ -646,7 +646,7 @@
                                  CFX_FontCache* pCache,
                                  const CFX_Matrix* pObject2Device,
                                  FX_FLOAT font_size,
-                                 FX_DWORD color,
+                                 uint32_t color,
                                  int alpha_flag,
                                  void* pIccTransform) {
   StartRendering();
@@ -688,7 +688,7 @@
 }
 void CFX_PSRenderer::WritePSBinary(const uint8_t* data, int len) {
   uint8_t* dest_buf;
-  FX_DWORD dest_size;
+  uint32_t dest_size;
   CCodec_ModuleMgr* pEncoders = CFX_GEModule::Get()->GetCodecModule();
   if (pEncoders &&
       pEncoders->GetBasicModule()->A85Encode(data, len, dest_buf, dest_size)) {
diff --git a/core/fxge/ge/fx_ge_text.cpp b/core/fxge/ge/fx_ge_text.cpp
index bcc630c..10c769a 100644
--- a/core/fxge/ge/fx_ge_text.cpp
+++ b/core/fxge/ge/fx_ge_text.cpp
@@ -138,7 +138,7 @@
 #define ADJUST_ALPHA(background, foreground, src_alpha, text_flags, a) \
   src_alpha = g_TextGammaAdjust[(uint8_t)src_alpha];
 void _Color2Argb(FX_ARGB& argb,
-                 FX_DWORD color,
+                 uint32_t color,
                  int alpha_flag,
                  void* pIccTransform) {
   if (!pIccTransform && !FXGETFLAG_COLORTYPE(alpha_flag)) {
@@ -177,8 +177,8 @@
                                          CFX_FontCache* pCache,
                                          FX_FLOAT font_size,
                                          const CFX_Matrix* pText2Device,
-                                         FX_DWORD fill_color,
-                                         FX_DWORD text_flags,
+                                         uint32_t fill_color,
+                                         uint32_t text_flags,
                                          int alpha_flag,
                                          void* pIccTransform) {
   int nativetext_flags = text_flags;
@@ -1114,7 +1114,7 @@
                                        const CFX_Matrix* pText2User,
                                        const CFX_Matrix* pUser2Device,
                                        const CFX_GraphStateData* pGraphState,
-                                       FX_DWORD fill_color,
+                                       uint32_t fill_color,
                                        FX_ARGB stroke_color,
                                        CFX_PathData* pClippingPath,
                                        int nFlag,
@@ -1256,7 +1256,7 @@
     CFX_Font* pFont,
     const CFX_Matrix* pMatrix,
     CFX_ByteStringC& FaceGlyphsKey,
-    FX_DWORD glyph_index,
+    uint32_t glyph_index,
     FX_BOOL bFontStyle,
     int dest_width,
     int anti_alias) {
@@ -1281,13 +1281,13 @@
   return pGlyphBitmap;
 }
 const CFX_GlyphBitmap* CFX_FaceCache::LoadGlyphBitmap(CFX_Font* pFont,
-                                                      FX_DWORD glyph_index,
+                                                      uint32_t glyph_index,
                                                       FX_BOOL bFontStyle,
                                                       const CFX_Matrix* pMatrix,
                                                       int dest_width,
                                                       int anti_alias,
                                                       int& text_flags) {
-  if (glyph_index == (FX_DWORD)-1) {
+  if (glyph_index == (uint32_t)-1) {
     return NULL;
   }
   _CFX_UniqueKeyGen keygen;
@@ -1512,7 +1512,7 @@
   }
 }
 CFX_GlyphBitmap* CFX_FaceCache::RenderGlyph(CFX_Font* pFont,
-                                            FX_DWORD glyph_index,
+                                            uint32_t glyph_index,
                                             FX_BOOL bFontStyle,
                                             const CFX_Matrix* pMatrix,
                                             int dest_width,
@@ -1647,12 +1647,12 @@
   return pGlyphBitmap;
 }
 const CFX_PathData* CFX_FaceCache::LoadGlyphPath(CFX_Font* pFont,
-                                                 FX_DWORD glyph_index,
+                                                 uint32_t glyph_index,
                                                  int dest_width) {
-  if (!m_Face || glyph_index == (FX_DWORD)-1)
+  if (!m_Face || glyph_index == (uint32_t)-1)
     return nullptr;
 
-  FX_DWORD key = glyph_index;
+  uint32_t key = glyph_index;
   if (pFont->GetSubstFont()) {
     key += (((pFont->GetSubstFont()->m_Weight / 16) << 15) +
             ((pFont->GetSubstFont()->m_ItalicAngle / 2) << 21) +
@@ -1792,7 +1792,7 @@
   return 0;
 }
 };
-CFX_PathData* CFX_Font::LoadGlyphPath(FX_DWORD glyph_index, int dest_width) {
+CFX_PathData* CFX_Font::LoadGlyphPath(uint32_t glyph_index, int dest_width) {
   if (!m_Face) {
     return NULL;
   }
@@ -1868,8 +1868,8 @@
   va_start(argList, count);
   for (int i = 0; i < count; i++) {
     int p = va_arg(argList, int);
-    ((FX_DWORD*)m_Key)[i] = p;
+    ((uint32_t*)m_Key)[i] = p;
   }
   va_end(argList);
-  m_KeyLen = count * sizeof(FX_DWORD);
+  m_KeyLen = count * sizeof(uint32_t);
 }
diff --git a/core/fxge/ge/fx_text_int.h b/core/fxge/ge/fx_text_int.h
index d88b2a7..04587c3 100644
--- a/core/fxge/ge/fx_text_int.h
+++ b/core/fxge/ge/fx_text_int.h
@@ -21,7 +21,7 @@
  public:
   CFX_SizeGlyphCache() {}
   ~CFX_SizeGlyphCache();
-  std::map<FX_DWORD, CFX_GlyphBitmap*> m_GlyphMap;
+  std::map<uint32_t, CFX_GlyphBitmap*> m_GlyphMap;
 };
 class CTTFontDesc {
  public:
@@ -62,8 +62,8 @@
   CFX_FontFaceInfo(CFX_ByteString filePath,
                    CFX_ByteString faceName,
                    CFX_ByteString fontTables,
-                   FX_DWORD fontOffset,
-                   FX_DWORD fileSize)
+                   uint32_t fontOffset,
+                   uint32_t fileSize)
       : m_FilePath(filePath),
         m_FaceName(faceName),
         m_FontTables(fontTables),
@@ -75,10 +75,10 @@
   const CFX_ByteString m_FilePath;
   const CFX_ByteString m_FaceName;
   const CFX_ByteString m_FontTables;
-  const FX_DWORD m_FontOffset;
-  const FX_DWORD m_FileSize;
-  FX_DWORD m_Styles;
-  FX_DWORD m_Charsets;
+  const uint32_t m_FontOffset;
+  const uint32_t m_FileSize;
+  uint32_t m_Styles;
+  uint32_t m_Charsets;
 };
 
 #endif  // CORE_FXGE_GE_FX_TEXT_INT_H_
diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp
index ed6ff82..745c9b5 100644
--- a/core/fxge/skia/fx_skia_device.cpp
+++ b/core/fxge/skia/fx_skia_device.cpp
@@ -317,7 +317,7 @@
                                              CFX_FontCache* pCache,
                                              const CFX_Matrix* pObject2Device,
                                              FX_FLOAT font_size,
-                                             FX_DWORD color,
+                                             uint32_t color,
                                              int alpha_flag,
                                              void* pIccTransform) {
   SkAutoTUnref<SkTypeface> typeface(SkTypeface::CreateFromStream(
@@ -430,8 +430,8 @@
     const CFX_PathData* pPathData,          // path info
     const CFX_Matrix* pObject2Device,       // optional transformation
     const CFX_GraphStateData* pGraphState,  // graphic state, for pen attributes
-    FX_DWORD fill_color,                    // fill color
-    FX_DWORD stroke_color,                  // stroke color
+    uint32_t fill_color,                    // fill color
+    uint32_t stroke_color,                  // stroke color
     int fill_mode,  // fill mode, WINDING or ALTERNATE. 0 for not filled
     int alpha_flag,
     void* pIccTransform,
@@ -483,7 +483,7 @@
 }
 
 FX_BOOL CFX_SkiaDeviceDriver::FillRect(const FX_RECT* pRect,
-                                       FX_DWORD fill_color,
+                                       uint32_t fill_color,
                                        int alpha_flag,
                                        void* pIccTransform,
                                        int blend_type) {
@@ -583,7 +583,7 @@
 }
 
 FX_BOOL CFX_SkiaDeviceDriver::SetDIBits(const CFX_DIBSource* pBitmap,
-                                        FX_DWORD argb,
+                                        uint32_t argb,
                                         const FX_RECT* pSrcRect,
                                         int left,
                                         int top,
@@ -596,13 +596,13 @@
 }
 
 FX_BOOL CFX_SkiaDeviceDriver::StretchDIBits(const CFX_DIBSource* pSource,
-                                            FX_DWORD argb,
+                                            uint32_t argb,
                                             int dest_left,
                                             int dest_top,
                                             int dest_width,
                                             int dest_height,
                                             const FX_RECT* pClipRect,
-                                            FX_DWORD flags,
+                                            uint32_t flags,
                                             int alpha_flag,
                                             void* pIccTransform,
                                             int blend_type) {
@@ -614,9 +614,9 @@
 
 FX_BOOL CFX_SkiaDeviceDriver::StartDIBits(const CFX_DIBSource* pSource,
                                           int bitmap_alpha,
-                                          FX_DWORD argb,
+                                          uint32_t argb,
                                           const CFX_Matrix* pMatrix,
-                                          FX_DWORD render_flags,
+                                          uint32_t render_flags,
                                           void*& handle,
                                           int alpha_flag,
                                           void* pIccTransform,
diff --git a/core/fxge/skia/fx_skia_device.h b/core/fxge/skia/fx_skia_device.h
index 8ce7c6c..afc505d 100644
--- a/core/fxge/skia/fx_skia_device.h
+++ b/core/fxge/skia/fx_skia_device.h
@@ -50,15 +50,15 @@
   FX_BOOL DrawPath(const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_color,
-                   FX_DWORD stroke_color,
+                   uint32_t fill_color,
+                   uint32_t stroke_color,
                    int fill_mode,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL,
                    int blend_type = FXDIB_BLEND_NORMAL) override;
 
   FX_BOOL FillRect(const FX_RECT* pRect,
-                   FX_DWORD fill_color,
+                   uint32_t fill_color,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL,
                    int blend_type = FXDIB_BLEND_NORMAL) override;
@@ -68,7 +68,7 @@
                            FX_FLOAT y1,
                            FX_FLOAT x2,
                            FX_FLOAT y2,
-                           FX_DWORD color,
+                           uint32_t color,
                            int alpha_flag = 0,
                            void* pIccTransform = NULL,
                            int blend_type = FXDIB_BLEND_NORMAL) override {
@@ -87,7 +87,7 @@
   CFX_DIBitmap* GetBackDrop() override { return m_pAggDriver->GetBackDrop(); }
 
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                    FX_DWORD color,
+                    uint32_t color,
                     const FX_RECT* pSrcRect,
                     int dest_left,
                     int dest_top,
@@ -95,22 +95,22 @@
                     int alpha_flag = 0,
                     void* pIccTransform = NULL) override;
   FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                        FX_DWORD color,
+                        uint32_t color,
                         int dest_left,
                         int dest_top,
                         int dest_width,
                         int dest_height,
                         const FX_RECT* pClipRect,
-                        FX_DWORD flags,
+                        uint32_t flags,
                         int alpha_flag = 0,
                         void* pIccTransform = NULL,
                         int blend_type = FXDIB_BLEND_NORMAL) override;
 
   FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                       int bitmap_alpha,
-                      FX_DWORD color,
+                      uint32_t color,
                       const CFX_Matrix* pMatrix,
-                      FX_DWORD flags,
+                      uint32_t flags,
                       void*& handle,
                       int alpha_flag = 0,
                       void* pIccTransform = NULL,
@@ -124,7 +124,7 @@
                          CFX_FontCache* pCache,
                          const CFX_Matrix* pObject2Device,
                          FX_FLOAT font_size,
-                         FX_DWORD color,
+                         uint32_t color,
                          int alpha_flag = 0,
                          void* pIccTransform = NULL) override;
 
diff --git a/core/fxge/win32/dwrite_int.h b/core/fxge/win32/dwrite_int.h
index 62672b2..60cc981 100644
--- a/core/fxge/win32/dwrite_int.h
+++ b/core/fxge/win32/dwrite_int.h
@@ -37,7 +37,7 @@
   FX_BOOL IsAvailable() { return m_pDWriteFactory != NULL; }
 
   void* DwCreateFontFaceFromStream(uint8_t* pData,
-                                   FX_DWORD size,
+                                   uint32_t size,
                                    int simulation_style);
   FX_BOOL DwCreateRenderingTarget(CFX_DIBitmap* pSrc, void** renderTarget);
   void DwDeleteRenderingTarget(void* renderTarget);
diff --git a/core/fxge/win32/fx_win32_device.cpp b/core/fxge/win32/fx_win32_device.cpp
index 9b43fae..cb3f331 100644
--- a/core/fxge/win32/fx_win32_device.cpp
+++ b/core/fxge/win32/fx_win32_device.cpp
@@ -43,17 +43,17 @@
                 const FX_CHAR* face,
                 int& iExact) override;
   void* GetFont(const FX_CHAR* face) override { return NULL; }
-  FX_DWORD GetFontData(void* hFont,
-                       FX_DWORD table,
+  uint32_t GetFontData(void* hFont,
+                       uint32_t table,
                        uint8_t* buffer,
-                       FX_DWORD size) override;
+                       uint32_t size) override;
   FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override;
   FX_BOOL GetFontCharset(void* hFont, int& charset) override;
   void DeleteFont(void* hFont) override;
 
   FX_BOOL IsOpenTypeFromDiv(const LOGFONTA* plf);
   FX_BOOL IsSupportFontFormDiv(const LOGFONTA* plf);
-  void AddInstalledFont(const LOGFONTA* plf, FX_DWORD FontType);
+  void AddInstalledFont(const LOGFONTA* plf, uint32_t FontType);
   void GetGBPreference(CFX_ByteString& face, int weight, int picth_family);
   void GetJapanesePreference(CFX_ByteString& face,
                              int weight,
@@ -76,18 +76,18 @@
   delete this;
 }
 #define TT_MAKE_TAG(x1, x2, x3, x4)                                    \
-  (((FX_DWORD)x1 << 24) | ((FX_DWORD)x2 << 16) | ((FX_DWORD)x3 << 8) | \
-   (FX_DWORD)x4)
+  (((uint32_t)x1 << 24) | ((uint32_t)x2 << 16) | ((uint32_t)x3 << 8) | \
+   (uint32_t)x4)
 FX_BOOL CFX_Win32FontInfo::IsOpenTypeFromDiv(const LOGFONTA* plf) {
   HFONT hFont = CreateFontIndirectA(plf);
   FX_BOOL ret = FALSE;
-  FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
-  if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
-    FX_DWORD lVersion = 0;
-    GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD));
-    lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) |
-               ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 |
-               ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 |
+  uint32_t font_size = GetFontData(hFont, 0, NULL, 0);
+  if (font_size != GDI_ERROR && font_size >= sizeof(uint32_t)) {
+    uint32_t lVersion = 0;
+    GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(uint32_t));
+    lVersion = (((uint32_t)(uint8_t)(lVersion)) << 24) |
+               ((uint32_t)((uint8_t)(lVersion >> 8))) << 16 |
+               ((uint32_t)((uint8_t)(lVersion >> 16))) << 8 |
                ((uint8_t)(lVersion >> 24));
     if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') || lVersion == 0x00010000 ||
         lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
@@ -101,13 +101,13 @@
 FX_BOOL CFX_Win32FontInfo::IsSupportFontFormDiv(const LOGFONTA* plf) {
   HFONT hFont = CreateFontIndirectA(plf);
   FX_BOOL ret = FALSE;
-  FX_DWORD font_size = GetFontData(hFont, 0, NULL, 0);
-  if (font_size != GDI_ERROR && font_size >= sizeof(FX_DWORD)) {
-    FX_DWORD lVersion = 0;
-    GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(FX_DWORD));
-    lVersion = (((FX_DWORD)(uint8_t)(lVersion)) << 24) |
-               ((FX_DWORD)((uint8_t)(lVersion >> 8))) << 16 |
-               ((FX_DWORD)((uint8_t)(lVersion >> 16))) << 8 |
+  uint32_t font_size = GetFontData(hFont, 0, NULL, 0);
+  if (font_size != GDI_ERROR && font_size >= sizeof(uint32_t)) {
+    uint32_t lVersion = 0;
+    GetFontData(hFont, 0, (uint8_t*)(&lVersion), sizeof(uint32_t));
+    lVersion = (((uint32_t)(uint8_t)(lVersion)) << 24) |
+               ((uint32_t)((uint8_t)(lVersion >> 8))) << 16 |
+               ((uint32_t)((uint8_t)(lVersion >> 16))) << 8 |
                ((uint8_t)(lVersion >> 24));
     if (lVersion == TT_MAKE_TAG('O', 'T', 'T', 'O') || lVersion == 0x00010000 ||
         lVersion == TT_MAKE_TAG('t', 't', 'c', 'f') ||
@@ -122,7 +122,7 @@
   return ret;
 }
 void CFX_Win32FontInfo::AddInstalledFont(const LOGFONTA* plf,
-                                         FX_DWORD FontType) {
+                                         uint32_t FontType) {
   CFX_ByteString name(plf->lfFaceName);
   if (name[0] == '@') {
     return;
@@ -144,7 +144,7 @@
 }
 static int CALLBACK FontEnumProc(const LOGFONTA* plf,
                                  const TEXTMETRICA* lpntme,
-                                 FX_DWORD FontType,
+                                 uint32_t FontType,
                                  LPARAM lParam) {
   CFX_Win32FontInfo* pFontInfo = (CFX_Win32FontInfo*)lParam;
   if (pFontInfo->m_pMapper->GetFontEnumerator()) {
@@ -406,10 +406,10 @@
 void CFX_Win32FontInfo::DeleteFont(void* hFont) {
   ::DeleteObject(hFont);
 }
-FX_DWORD CFX_Win32FontInfo::GetFontData(void* hFont,
-                                        FX_DWORD table,
+uint32_t CFX_Win32FontInfo::GetFontData(void* hFont,
+                                        uint32_t table,
                                         uint8_t* buffer,
-                                        FX_DWORD size) {
+                                        uint32_t size) {
   HFONT hOldFont = (HFONT)::SelectObject(m_hDC, (HFONT)hFont);
   table = FXDWORD_GET_MSBFIRST(reinterpret_cast<uint8_t*>(&table));
   size = ::GetFontData(m_hDC, table, 0, buffer, size);
@@ -581,7 +581,7 @@
                                             int dest_top,
                                             int dest_width,
                                             int dest_height,
-                                            FX_DWORD flags,
+                                            uint32_t flags,
                                             void* pIccTransform) {
   CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
   if (!pBitmap || dest_width == 0 || dest_height == 0) {
@@ -624,8 +624,8 @@
                                              int dest_top,
                                              int dest_width,
                                              int dest_height,
-                                             FX_DWORD bitmap_color,
-                                             FX_DWORD flags,
+                                             uint32_t bitmap_color,
+                                             uint32_t flags,
                                              int alpha_flag,
                                              void* pIccTransform) {
   CFX_DIBitmap* pBitmap = (CFX_DIBitmap*)pBitmap1;
@@ -637,7 +637,7 @@
   int width = pBitmap->GetWidth(), height = pBitmap->GetHeight();
   struct {
     BITMAPINFOHEADER bmiHeader;
-    FX_DWORD bmiColors[2];
+    uint32_t bmiColors[2];
   } bmi;
   FXSYS_memset(&bmi.bmiHeader, 0, sizeof(BITMAPINFOHEADER));
   bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
@@ -691,7 +691,7 @@
 }
 static HPEN _CreatePen(const CFX_GraphStateData* pGraphState,
                        const CFX_Matrix* pMatrix,
-                       FX_DWORD argb) {
+                       uint32_t argb) {
   FX_FLOAT width;
   FX_FLOAT scale = 1.f;
   if (pMatrix)
@@ -703,7 +703,7 @@
   } else {
     width = 1.0f;
   }
-  FX_DWORD PenStyle = PS_GEOMETRIC;
+  uint32_t PenStyle = PS_GEOMETRIC;
   if (width < 1) {
     width = 1;
   }
@@ -741,9 +741,9 @@
   lb.lbColor = rgb;
   lb.lbStyle = BS_SOLID;
   lb.lbHatch = 0;
-  FX_DWORD* pDash = NULL;
+  uint32_t* pDash = NULL;
   if (pGraphState->m_DashCount) {
-    pDash = FX_Alloc(FX_DWORD, pGraphState->m_DashCount);
+    pDash = FX_Alloc(uint32_t, pGraphState->m_DashCount);
     for (int i = 0; i < pGraphState->m_DashCount; i++) {
       pDash[i] = FXSYS_round(
           pMatrix ? pMatrix->TransformDistance(pGraphState->m_DashArray[i])
@@ -758,7 +758,7 @@
   FX_Free(pDash);
   return hPen;
 }
-static HBRUSH _CreateBrush(FX_DWORD argb) {
+static HBRUSH _CreateBrush(uint32_t argb) {
   int a;
   FX_COLORREF rgb;
   ArgbDecode(argb, a, rgb);
@@ -851,8 +851,8 @@
 FX_BOOL CGdiDeviceDriver::DrawPath(const CFX_PathData* pPathData,
                                    const CFX_Matrix* pMatrix,
                                    const CFX_GraphStateData* pGraphState,
-                                   FX_DWORD fill_color,
-                                   FX_DWORD stroke_color,
+                                   uint32_t fill_color,
+                                   uint32_t stroke_color,
                                    int fill_mode,
                                    int alpha_flag,
                                    void* pIccTransform,
@@ -961,7 +961,7 @@
   return TRUE;
 }
 FX_BOOL CGdiDeviceDriver::FillRect(const FX_RECT* pRect,
-                                   FX_DWORD fill_color,
+                                   uint32_t fill_color,
                                    int alpha_flag,
                                    void* pIccTransform,
                                    int blend_type) {
@@ -1017,7 +1017,7 @@
                                            FX_FLOAT y1,
                                            FX_FLOAT x2,
                                            FX_FLOAT y2,
-                                           FX_DWORD color,
+                                           uint32_t color,
                                            int alpha_flag,
                                            void* pIccTransform,
                                            int blend_type) {
@@ -1098,7 +1098,7 @@
   return ret;
 }
 FX_BOOL CGdiDisplayDriver::SetDIBits(const CFX_DIBSource* pSource,
-                                     FX_DWORD color,
+                                     uint32_t color,
                                      const FX_RECT* pSrcRect,
                                      int left,
                                      int top,
@@ -1152,7 +1152,7 @@
   return FALSE;
 }
 FX_BOOL CGdiDisplayDriver::UseFoxitStretchEngine(const CFX_DIBSource* pSource,
-                                                 FX_DWORD color,
+                                                 uint32_t color,
                                                  int dest_left,
                                                  int dest_top,
                                                  int dest_width,
@@ -1183,13 +1183,13 @@
   return ret;
 }
 FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource,
-                                         FX_DWORD color,
+                                         uint32_t color,
                                          int dest_left,
                                          int dest_top,
                                          int dest_width,
                                          int dest_height,
                                          const FX_RECT* pClipRect,
-                                         FX_DWORD flags,
+                                         uint32_t flags,
                                          int alpha_flag,
                                          void* pIccTransform,
                                          int blend_type) {
@@ -1265,7 +1265,7 @@
   if (device_type != DT_RASPRINTER) {
     return 0;
   }
-  FX_DWORD esc = GET_PS_FEATURESETTING;
+  uint32_t esc = GET_PS_FEATURESETTING;
   if (ExtEscape(hDC, QUERYESCSUPPORT, sizeof esc, (char*)&esc, 0, NULL)) {
     int param = FEATURESETTING_PSLEVEL;
     if (ExtEscape(hDC, GET_PS_FEATURESETTING, sizeof(int), (char*)&param,
@@ -1282,7 +1282,7 @@
     return 0;
   }
   esc = PSIDENT_GDICENTRIC;
-  if (ExtEscape(hDC, POSTSCRIPT_IDENTIFY, sizeof(FX_DWORD), (char*)&esc, 0,
+  if (ExtEscape(hDC, POSTSCRIPT_IDENTIFY, sizeof(uint32_t), (char*)&esc, 0,
                 NULL) <= 0) {
     return 2;
   }
diff --git a/core/fxge/win32/fx_win32_dib.cpp b/core/fxge/win32/fx_win32_dib.cpp
index cd48d07..cc627db 100644
--- a/core/fxge/win32/fx_win32_dib.cpp
+++ b/core/fxge/win32/fx_win32_dib.cpp
@@ -27,7 +27,7 @@
   pbmih->biPlanes = 1;
   pbmih->biWidth = pBitmap->GetWidth();
   if (pBitmap->GetBPP() == 8) {
-    FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1);
+    uint32_t* pPalette = (uint32_t*)(pbmih + 1);
     if (pBitmap->GetPalette()) {
       for (int i = 0; i < 256; i++) {
         pPalette[i] = pBitmap->GetPalette()[i];
@@ -39,7 +39,7 @@
     }
   }
   if (pBitmap->GetBPP() == 1) {
-    FX_DWORD* pPalette = (FX_DWORD*)(pbmih + 1);
+    uint32_t* pPalette = (uint32_t*)(pbmih + 1);
     if (pBitmap->GetPalette()) {
       pPalette[0] = pBitmap->GetPalette()[0];
       pPalette[1] = pBitmap->GetPalette()[1];
@@ -88,11 +88,11 @@
   }
   if (pbmi->bmiHeader.biBitCount == 1) {
     for (int i = 0; i < 2; i++) {
-      pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000);
+      pBitmap->SetPaletteEntry(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000);
     }
   } else if (pbmi->bmiHeader.biBitCount == 8) {
     for (int i = 0; i < 256; i++) {
-      pBitmap->SetPaletteEntry(i, ((FX_DWORD*)pbmi->bmiColors)[i] | 0xff000000);
+      pBitmap->SetPaletteEntry(i, ((uint32_t*)pbmi->bmiColors)[i] | 0xff000000);
     }
   }
   return pBitmap;
@@ -182,8 +182,8 @@
 }
 CFX_DIBitmap* CFX_WindowsDIB::LoadFromDDB(HDC hDC,
                                           HBITMAP hBitmap,
-                                          FX_DWORD* pPalette,
-                                          FX_DWORD palsize) {
+                                          uint32_t* pPalette,
+                                          uint32_t palsize) {
   FX_BOOL bCreatedDC = !hDC;
   if (bCreatedDC) {
     hDC = CreateCompatibleDC(NULL);
@@ -201,7 +201,7 @@
   if (bmih.biBitCount == 1 || bmih.biBitCount == 8) {
     int size = sizeof(BITMAPINFOHEADER) + 8;
     if (bmih.biBitCount == 8) {
-      size += sizeof(FX_DWORD) * 254;
+      size += sizeof(uint32_t) * 254;
     }
     BITMAPINFO* pbmih = (BITMAPINFO*)FX_Alloc(uint8_t, size);
     pbmih->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
diff --git a/core/fxge/win32/fx_win32_dwrite.cpp b/core/fxge/win32/fx_win32_dwrite.cpp
index 972295c..f95b5eb 100644
--- a/core/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/fxge/win32/fx_win32_dwrite.cpp
@@ -127,7 +127,7 @@
   Unload();
 }
 LPVOID CDWriteExt::DwCreateFontFaceFromStream(uint8_t* pData,
-                                              FX_DWORD size,
+                                              uint32_t size,
                                               int simulation_style) {
   IDWriteFactory* pDwFactory = (IDWriteFactory*)m_pDWriteFactory;
   IDWriteFontFile* pDwFontFile = NULL;
diff --git a/core/fxge/win32/fx_win32_gdipext.cpp b/core/fxge/win32/fx_win32_gdipext.cpp
index 2fdfa3a..b9c2190 100644
--- a/core/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/fxge/win32/fx_win32_gdipext.cpp
@@ -437,9 +437,9 @@
                                                             DWORD* pcFonts);
 typedef BOOL(__stdcall* FuncType_GdiRemoveFontMemResourceEx)(HANDLE handle);
 void* CGdiplusExt::GdiAddFontMemResourceEx(void* pFontdata,
-                                           FX_DWORD size,
+                                           uint32_t size,
                                            void* pdv,
-                                           FX_DWORD* num_face) {
+                                           uint32_t* num_face) {
   if (m_pGdiAddFontMemResourceEx) {
     return ((FuncType_GdiAddFontMemResourceEx)m_pGdiAddFontMemResourceEx)(
         (PVOID)pFontdata, (DWORD)size, (PVOID)pdv, (DWORD*)num_face);
@@ -711,7 +711,7 @@
       GetProcAddress(m_GdiModule, "RemoveFontMemResourceEx");
 }
 CGdiplusExt::~CGdiplusExt() {}
-LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, FX_DWORD size) {
+LPVOID CGdiplusExt::LoadMemFont(LPBYTE pData, uint32_t size) {
   GpFontCollection* pCollection = NULL;
   CGdiplusExt& GdiplusExt =
       ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
@@ -809,7 +809,7 @@
   CallFunc(GdipSetTextRenderingHint)((GpGraphics*)graphics,
                                      (TextRenderingHint)mode);
 }
-void CGdiplusExt::GdipSetPageUnit(void* graphics, FX_DWORD unit) {
+void CGdiplusExt::GdipSetPageUnit(void* graphics, uint32_t unit) {
   CGdiplusExt& GdiplusExt =
       ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
   CallFunc(GdipSetPageUnit)((GpGraphics*)graphics, (GpUnit)unit);
@@ -833,7 +833,7 @@
   }
   return FALSE;
 }
-void CGdiplusExt::GdipCreateBrush(FX_DWORD fill_argb, void** pBrush) {
+void CGdiplusExt::GdipCreateBrush(uint32_t fill_argb, void** pBrush) {
   CGdiplusExt& GdiplusExt =
       ((CWin32Platform*)CFX_GEModule::Get()->GetPlatformData())->m_GdiplusExt;
   CallFunc(GdipCreateSolidFill)((ARGB)fill_argb, (GpSolidFill**)pBrush);
@@ -916,7 +916,7 @@
                                     int dest_top,
                                     int dest_width,
                                     int dest_height,
-                                    FX_DWORD argb,
+                                    uint32_t argb,
                                     const FX_RECT* pClipRect,
                                     int flags) {
   ASSERT(pBitmap->GetBPP() == 1);
@@ -1100,8 +1100,8 @@
                               const CFX_PathData* pPathData,
                               const CFX_Matrix* pObject2Device,
                               const CFX_GraphStateData* pGraphState,
-                              FX_DWORD fill_argb,
-                              FX_DWORD stroke_argb,
+                              uint32_t fill_argb,
+                              uint32_t stroke_argb,
                               int fill_mode) {
   int nPoints = pPathData->GetPointCount();
   if (nPoints == 0) {
diff --git a/core/fxge/win32/fx_win32_print.cpp b/core/fxge/win32/fx_win32_print.cpp
index f7a1bb6..cb5ce77 100644
--- a/core/fxge/win32/fx_win32_print.cpp
+++ b/core/fxge/win32/fx_win32_print.cpp
@@ -34,7 +34,7 @@
   return CGdiDeviceDriver::GetDeviceCaps(caps_id);
 }
 FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource,
-                                     FX_DWORD color,
+                                     uint32_t color,
                                      const FX_RECT* pSrcRect,
                                      int left,
                                      int top,
@@ -62,13 +62,13 @@
   return GDI_SetDIBits(pBitmap, pSrcRect, left, top, pIccTransform);
 }
 FX_BOOL CGdiPrinterDriver::StretchDIBits(const CFX_DIBSource* pSource,
-                                         FX_DWORD color,
+                                         uint32_t color,
                                          int dest_left,
                                          int dest_top,
                                          int dest_width,
                                          int dest_height,
                                          const FX_RECT* pClipRect,
-                                         FX_DWORD flags,
+                                         uint32_t flags,
                                          int alpha_flag,
                                          void* pIccTransform,
                                          int blend_type) {
@@ -147,7 +147,7 @@
   }
   int src_width = pSrcBitmap->GetWidth(), src_height = pSrcBitmap->GetHeight();
   uint8_t* src_buf = pSrcBitmap->GetBuffer();
-  FX_DWORD src_pitch = pSrcBitmap->GetPitch();
+  uint32_t src_pitch = pSrcBitmap->GetPitch();
   FX_FLOAT dest_area = pDestMatrix->GetUnitArea();
   FX_FLOAT area_scale = ((FX_FLOAT)(src_width * src_height)) / dest_area;
   FX_FLOAT size_scale = FXSYS_sqrt(area_scale);
@@ -222,9 +222,9 @@
 }
 FX_BOOL CGdiPrinterDriver::StartDIBits(const CFX_DIBSource* pSource,
                                        int bitmap_alpha,
-                                       FX_DWORD color,
+                                       uint32_t color,
                                        const CFX_Matrix* pMatrix,
-                                       FX_DWORD render_flags,
+                                       uint32_t render_flags,
                                        void*& handle,
                                        int alpha_flag,
                                        void* pIccTransform,
@@ -330,7 +330,7 @@
       if (ret) {
         CFX_PathData path;
         path.AllocPointCount(pData->rdh.nCount * 5);
-        for (FX_DWORD i = 0; i < pData->rdh.nCount; i++) {
+        for (uint32_t i = 0; i < pData->rdh.nCount; i++) {
           RECT* pRect = (RECT*)(pData->Buffer + pData->rdh.nRgnSize * i);
           path.AppendRect((FX_FLOAT)pRect->left, (FX_FLOAT)pRect->bottom,
                           (FX_FLOAT)pRect->right, (FX_FLOAT)pRect->top);
@@ -408,7 +408,7 @@
   return TRUE;
 }
 FX_BOOL CPSPrinterDriver::SetDIBits(const CFX_DIBSource* pBitmap,
-                                    FX_DWORD color,
+                                    uint32_t color,
                                     const FX_RECT* pSrcRect,
                                     int left,
                                     int top,
@@ -422,13 +422,13 @@
                                 pIccTransform);
 }
 FX_BOOL CPSPrinterDriver::StretchDIBits(const CFX_DIBSource* pBitmap,
-                                        FX_DWORD color,
+                                        uint32_t color,
                                         int dest_left,
                                         int dest_top,
                                         int dest_width,
                                         int dest_height,
                                         const FX_RECT* pClipRect,
-                                        FX_DWORD flags,
+                                        uint32_t flags,
                                         int alpha_flag,
                                         void* pIccTransform,
                                         int blend_type) {
@@ -441,9 +441,9 @@
 }
 FX_BOOL CPSPrinterDriver::StartDIBits(const CFX_DIBSource* pBitmap,
                                       int bitmap_alpha,
-                                      FX_DWORD color,
+                                      uint32_t color,
                                       const CFX_Matrix* pMatrix,
-                                      FX_DWORD render_flags,
+                                      uint32_t render_flags,
                                       void*& handle,
                                       int alpha_flag,
                                       void* pIccTransform,
@@ -464,7 +464,7 @@
                                          CFX_FontCache* pCache,
                                          const CFX_Matrix* pObject2Device,
                                          FX_FLOAT font_size,
-                                         FX_DWORD color,
+                                         uint32_t color,
                                          int alpha_flag,
                                          void* pIccTransform) {
   return m_PSRenderer.DrawText(nChars, pCharPos, pFont, pCache, pObject2Device,
diff --git a/core/fxge/win32/win32_int.h b/core/fxge/win32/win32_int.h
index d903d3a..18996af 100644
--- a/core/fxge/win32/win32_int.h
+++ b/core/fxge/win32/win32_int.h
@@ -24,7 +24,7 @@
                          int dest_top,
                          int dest_width,
                          int dest_height,
-                         FX_DWORD argb,
+                         uint32_t argb,
                          const FX_RECT* pClipRect,
                          int flags);
   FX_BOOL StretchDIBits(HDC hDC,
@@ -39,16 +39,16 @@
                    const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_argb,
-                   FX_DWORD stroke_argb,
+                   uint32_t fill_argb,
+                   uint32_t stroke_argb,
                    int fill_mode);
 
-  void* LoadMemFont(uint8_t* pData, FX_DWORD size);
+  void* LoadMemFont(uint8_t* pData, uint32_t size);
   void DeleteMemFont(void* pFontCollection);
   FX_BOOL GdipCreateFromImage(void* bitmap, void** graphics);
   void GdipDeleteGraphics(void* graphics);
   void GdipSetTextRenderingHint(void* graphics, int mode);
-  void GdipSetPageUnit(void* graphics, FX_DWORD unit);
+  void GdipSetPageUnit(void* graphics, uint32_t unit);
   void GdipSetWorldTransform(void* graphics, void* pMatrix);
   FX_BOOL GdipDrawDriverString(void* graphics,
                                unsigned short* text,
@@ -58,7 +58,7 @@
                                void* positions,
                                int flags,
                                const void* matrix);
-  void GdipCreateBrush(FX_DWORD fill_argb, void** pBrush);
+  void GdipCreateBrush(uint32_t fill_argb, void** pBrush);
   void GdipDeleteBrush(void* pBrush);
   void GdipCreateMatrix(FX_FLOAT a,
                         FX_FLOAT b,
@@ -85,9 +85,9 @@
   void GdipDisposeImage(void* bitmap);
   void GdipGetFontSize(void* pFont, FX_FLOAT* size);
   void* GdiAddFontMemResourceEx(void* pFontdata,
-                                FX_DWORD size,
+                                uint32_t size,
                                 void* pdv,
-                                FX_DWORD* num_face);
+                                uint32_t* num_face);
   FX_BOOL GdiRemoveFontMemResourceEx(void* handle);
   void* m_Functions[100];
   void* m_pGdiAddFontMemResourceEx;
@@ -125,14 +125,14 @@
   FX_BOOL DrawPath(const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_color,
-                   FX_DWORD stroke_color,
+                   uint32_t fill_color,
+                   uint32_t stroke_color,
                    int fill_mode,
                    int alpha_flag,
                    void* pIccTransform,
                    int blend_type) override;
   FX_BOOL FillRect(const FX_RECT* pRect,
-                   FX_DWORD fill_color,
+                   uint32_t fill_color,
                    int alpha_flag,
                    void* pIccTransform,
                    int blend_type) override;
@@ -140,7 +140,7 @@
                            FX_FLOAT y1,
                            FX_FLOAT x2,
                            FX_FLOAT y2,
-                           FX_DWORD color,
+                           uint32_t color,
                            int alpha_flag,
                            void* pIccTransform,
                            int blend_type) override;
@@ -162,15 +162,15 @@
                             int dest_top,
                             int dest_width,
                             int dest_height,
-                            FX_DWORD flags,
+                            uint32_t flags,
                             void* pIccTransform);
   FX_BOOL GDI_StretchBitMask(const CFX_DIBitmap* pBitmap,
                              int dest_left,
                              int dest_top,
                              int dest_width,
                              int dest_height,
-                             FX_DWORD bitmap_color,
-                             FX_DWORD flags,
+                             uint32_t bitmap_color,
+                             uint32_t flags,
                              int alpha_flag,
                              void* pIccTransform);
   HDC m_hDC;
@@ -191,7 +191,7 @@
                     void* pIccTransform = NULL,
                     FX_BOOL bDEdge = FALSE) override;
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                    FX_DWORD color,
+                    uint32_t color,
                     const FX_RECT* pSrcRect,
                     int left,
                     int top,
@@ -199,21 +199,21 @@
                     int alpha_flag,
                     void* pIccTransform) override;
   FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                        FX_DWORD color,
+                        uint32_t color,
                         int dest_left,
                         int dest_top,
                         int dest_width,
                         int dest_height,
                         const FX_RECT* pClipRect,
-                        FX_DWORD flags,
+                        uint32_t flags,
                         int alpha_flag,
                         void* pIccTransform,
                         int blend_type) override;
   FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                       int bitmap_alpha,
-                      FX_DWORD color,
+                      uint32_t color,
                       const CFX_Matrix* pMatrix,
-                      FX_DWORD render_flags,
+                      uint32_t render_flags,
                       void*& handle,
                       int alpha_flag,
                       void* pIccTransform,
@@ -221,7 +221,7 @@
     return FALSE;
   }
   FX_BOOL UseFoxitStretchEngine(const CFX_DIBSource* pSource,
-                                FX_DWORD color,
+                                uint32_t color,
                                 int dest_left,
                                 int dest_top,
                                 int dest_width,
@@ -239,7 +239,7 @@
  protected:
   int GetDeviceCaps(int caps_id) override;
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                    FX_DWORD color,
+                    uint32_t color,
                     const FX_RECT* pSrcRect,
                     int left,
                     int top,
@@ -247,21 +247,21 @@
                     int alpha_flag,
                     void* pIccTransform) override;
   FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                        FX_DWORD color,
+                        uint32_t color,
                         int dest_left,
                         int dest_top,
                         int dest_width,
                         int dest_height,
                         const FX_RECT* pClipRect,
-                        FX_DWORD flags,
+                        uint32_t flags,
                         int alpha_flag,
                         void* pIccTransform,
                         int blend_type) override;
   FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                       int bitmap_alpha,
-                      FX_DWORD color,
+                      uint32_t color,
                       const CFX_Matrix* pMatrix,
-                      FX_DWORD render_flags,
+                      uint32_t render_flags,
                       void*& handle,
                       int alpha_flag,
                       void* pIccTransform,
@@ -308,15 +308,15 @@
   FX_BOOL DrawPath(const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_color,
-                   FX_DWORD stroke_color,
+                   uint32_t fill_color,
+                   uint32_t stroke_color,
                    int fill_mode,
                    int alpha_flag,
                    void* pIccTransform,
                    int blend_type) override;
   FX_BOOL GetClipBox(FX_RECT* pRect) override;
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                    FX_DWORD color,
+                    uint32_t color,
                     const FX_RECT* pSrcRect,
                     int left,
                     int top,
@@ -324,21 +324,21 @@
                     int alpha_flag,
                     void* pIccTransform) override;
   FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                        FX_DWORD color,
+                        uint32_t color,
                         int dest_left,
                         int dest_top,
                         int dest_width,
                         int dest_height,
                         const FX_RECT* pClipRect,
-                        FX_DWORD flags,
+                        uint32_t flags,
                         int alpha_flag,
                         void* pIccTransform,
                         int blend_type) override;
   FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                       int bitmap_alpha,
-                      FX_DWORD color,
+                      uint32_t color,
                       const CFX_Matrix* pMatrix,
-                      FX_DWORD render_flags,
+                      uint32_t render_flags,
                       void*& handle,
                       int alpha_flag,
                       void* pIccTransform,
@@ -349,7 +349,7 @@
                          CFX_FontCache* pCache,
                          const CFX_Matrix* pObject2Device,
                          FX_FLOAT font_size,
-                         FX_DWORD color,
+                         uint32_t color,
                          int alpha_flag,
                          void* pIccTransform) override;
   void* GetPlatformSurface() const override { return (void*)m_hDC; }
@@ -362,7 +362,7 @@
   CFX_PSRenderer m_PSRenderer;
 };
 void _Color2Argb(FX_ARGB& argb,
-                 FX_DWORD color,
+                 uint32_t color,
                  int alpha_flag,
                  void* pIccTransform);
 
diff --git a/core/include/fpdfdoc/fpdf_doc.h b/core/include/fpdfdoc/fpdf_doc.h
index 28d62ef..87d1662 100644
--- a/core/include/fpdfdoc/fpdf_doc.h
+++ b/core/include/fpdfdoc/fpdf_doc.h
@@ -85,8 +85,8 @@
   explicit CPDF_Bookmark(CPDF_Dictionary* pDict) : m_pDict(pDict) {}
 
   CPDF_Dictionary* GetDict() const { return m_pDict; }
-  FX_DWORD GetColorRef() const;
-  FX_DWORD GetFontStyle() const;
+  uint32_t GetColorRef() const;
+  uint32_t GetFontStyle() const;
   CFX_WideString GetTitle() const;
   CPDF_Dest GetDest(CPDF_Document* pDocument) const;
   CPDF_Action GetAction() const;
@@ -111,7 +111,7 @@
   CPDF_Object* GetObject() const { return m_pObj; }
   CFX_ByteString GetRemoteName();
   int GetPageIndex(CPDF_Document* pDoc);
-  FX_DWORD GetPageObjNum();
+  uint32_t GetPageObjNum();
   int GetZoomMode();
   FX_FLOAT GetParam(int index);
 
@@ -154,9 +154,9 @@
  public:
   explicit CPDF_ActionFields(const CPDF_Action* pAction) : m_pAction(pAction) {}
 
-  FX_DWORD GetFieldsCount() const;
+  uint32_t GetFieldsCount() const;
   std::vector<CPDF_Object*> GetAllFields() const;
-  CPDF_Object* GetField(FX_DWORD iIndex) const;
+  CPDF_Object* GetField(uint32_t iIndex) const;
 
  protected:
   const CPDF_Action* const m_pAction;
@@ -204,7 +204,7 @@
   FX_BOOL GetMouseMap() const { return m_pDict->GetBooleanBy("IsMap"); }
   FX_BOOL GetHideStatus() const { return m_pDict->GetBooleanBy("H", TRUE); }
   CFX_ByteString GetNamedAction() const { return m_pDict->GetStringBy("N"); }
-  FX_DWORD GetFlags() const { return m_pDict->GetIntegerBy("Flags"); }
+  uint32_t GetFlags() const { return m_pDict->GetIntegerBy("Flags"); }
   CFX_WideString GetJavaScript() const;
   CPDF_Dictionary* GetAnnot() const;
   int32_t GetOperationType() const;
@@ -213,8 +213,8 @@
   FX_BOOL IsSynchronous() const { return m_pDict->GetBooleanBy("Synchronous"); }
   FX_BOOL IsRepeat() const { return m_pDict->GetBooleanBy("Repeat"); }
   FX_BOOL IsMixPlay() const { return m_pDict->GetBooleanBy("Mix"); }
-  FX_DWORD GetSubActionsCount() const;
-  CPDF_Action GetSubAction(FX_DWORD iIndex) const;
+  uint32_t GetSubActionsCount() const;
+  CPDF_Action GetSubAction(uint32_t iIndex) const;
 
  protected:
   CPDF_Dictionary* const m_pDict;
@@ -306,7 +306,7 @@
   const std::vector<CPDF_Dictionary*>* GetPageLinks(CPDF_Page* pPage);
   void LoadPageLinks(CPDF_Page* pPage, std::vector<CPDF_Dictionary*>* pList);
 
-  std::map<FX_DWORD, std::vector<CPDF_Dictionary*>> m_PageMap;
+  std::map<uint32_t, std::vector<CPDF_Dictionary*>> m_PageMap;
 };
 
 class CPDF_Link {
@@ -342,7 +342,7 @@
   ~CPDF_Annot();
 
   CFX_ByteString GetSubType() const;
-  FX_DWORD GetFlags() const;
+  uint32_t GetFlags() const;
   void GetRect(CFX_FloatRect& rect) const;
   const CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict; }
   CPDF_Dictionary* GetAnnotDict() { return m_pAnnotDict; }
@@ -388,7 +388,7 @@
                      CPDF_RenderContext* pContext,
                      FX_BOOL bPrinting,
                      CFX_Matrix* pMatrix,
-                     FX_DWORD dwAnnotFlags,
+                     uint32_t dwAnnotFlags,
                      CPDF_RenderOptions* pOptions,
                      FX_RECT* pClipRect);
   size_t Count() const { return m_AnnotList.size(); }
@@ -487,9 +487,9 @@
   FX_BOOL ValidateFieldName(const CPDF_FormControl* pControl,
                             CFX_WideString& csNewFieldName);
 
-  FX_DWORD CountFields(const CFX_WideString& csFieldName = L"");
+  uint32_t CountFields(const CFX_WideString& csFieldName = L"");
 
-  CPDF_FormField* GetField(FX_DWORD index,
+  CPDF_FormField* GetField(uint32_t index,
                            const CFX_WideString& csFieldName = L"");
 
   CPDF_FormField* GetFieldByDict(CPDF_Dictionary* pFieldDict) const;
@@ -515,9 +515,9 @@
 
   int FindFieldInCalculationOrder(const CPDF_FormField* pField);
 
-  FX_DWORD CountFormFonts();
+  uint32_t CountFormFonts();
 
-  CPDF_Font* GetFormFont(FX_DWORD index, CFX_ByteString& csNameTag);
+  CPDF_Font* GetFormFont(uint32_t index, CFX_ByteString& csNameTag);
 
   CPDF_Font* GetFormFont(CFX_ByteString csNameTag);
 
@@ -663,7 +663,7 @@
   CFX_WideString GetFullName();
 
   Type GetType() const { return m_Type; }
-  FX_DWORD GetFlags() const { return m_Flags; }
+  uint32_t GetFlags() const { return m_Flags; }
 
   CPDF_Dictionary* GetFieldDict() const { return m_pDict; }
   void SetFieldDict(CPDF_Dictionary* pDict) { m_pDict = pDict; }
@@ -684,7 +684,7 @@
 
   CFX_WideString GetMappingName();
 
-  FX_DWORD GetFieldFlags();
+  uint32_t GetFieldFlags();
 
   CFX_ByteString GetDefaultStyle();
 
@@ -781,7 +781,7 @@
                         FX_BOOL bNotify);
 
   CPDF_FormField::Type m_Type;
-  FX_DWORD m_Flags;
+  uint32_t m_Flags;
   CPDF_InterForm* m_pForm;
   CPDF_Dictionary* m_pDict;
   CFX_ArrayTemplate<CPDF_FormControl*> m_ControlList;
diff --git a/core/include/fpdfdoc/fpdf_tagged.h b/core/include/fpdfdoc/fpdf_tagged.h
index 28fe84b..d17b724 100644
--- a/core/include/fpdfdoc/fpdf_tagged.h
+++ b/core/include/fpdfdoc/fpdf_tagged.h
@@ -37,21 +37,21 @@
       CPDF_Dictionary* m_pDict;
     } m_Element;
     struct {
-      FX_DWORD m_PageObjNum;
+      uint32_t m_PageObjNum;
 
-      FX_DWORD m_ContentId;
+      uint32_t m_ContentId;
     } m_PageContent;
     struct {
-      FX_DWORD m_PageObjNum;
+      uint32_t m_PageObjNum;
 
-      FX_DWORD m_ContentId;
+      uint32_t m_ContentId;
 
-      FX_DWORD m_RefObjNum;
+      uint32_t m_RefObjNum;
     } m_StreamContent;
     struct {
-      FX_DWORD m_PageObjNum;
+      uint32_t m_PageObjNum;
 
-      FX_DWORD m_RefObjNum;
+      uint32_t m_RefObjNum;
     } m_Object;
   };
 };
diff --git a/core/include/fxcodec/fx_codec.h b/core/include/fxcodec/fx_codec.h
index 99d4dbd..a674eb7 100644
--- a/core/include/fxcodec/fx_codec.h
+++ b/core/include/fxcodec/fx_codec.h
@@ -51,10 +51,10 @@
   uint8_t m_strTime[20];
   int32_t m_nGifLeft;
   int32_t m_nGifTop;
-  FX_DWORD* m_pGifLocalPalette;
-  FX_DWORD m_nGifLocalPalNum;
+  uint32_t* m_pGifLocalPalette;
+  uint32_t m_nGifLocalPalNum;
   int32_t m_nBmpCompressType;
-  std::map<FX_DWORD, void*> m_Exif;
+  std::map<uint32_t, void*> m_Exif;
 };
 #endif  // PDF_ENABLE_XFA
 
@@ -97,15 +97,15 @@
  public:
   virtual ~ICodec_BasicModule() {}
   virtual FX_BOOL RunLengthEncode(const uint8_t* src_buf,
-                                  FX_DWORD src_size,
+                                  uint32_t src_size,
                                   uint8_t*& dest_buf,
-                                  FX_DWORD& dest_size) = 0;
+                                  uint32_t& dest_size) = 0;
   virtual FX_BOOL A85Encode(const uint8_t* src_buf,
-                            FX_DWORD src_size,
+                            uint32_t src_size,
                             uint8_t*& dest_buf,
-                            FX_DWORD& dest_size) = 0;
+                            uint32_t& dest_size) = 0;
   virtual ICodec_ScanlineDecoder* CreateRunLengthDecoder(const uint8_t* src_buf,
-                                                         FX_DWORD src_size,
+                                                         uint32_t src_size,
                                                          int width,
                                                          int height,
                                                          int nComps,
@@ -116,7 +116,7 @@
  public:
   virtual ~ICodec_ScanlineDecoder() {}
 
-  virtual FX_DWORD GetSrcOffset() = 0;
+  virtual uint32_t GetSrcOffset() = 0;
 
   virtual void DownScale(int dest_width, int dest_height) = 0;
 
@@ -141,7 +141,7 @@
  public:
   virtual ~ICodec_FlateModule() {}
   virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf,
-                                                FX_DWORD src_size,
+                                                uint32_t src_size,
                                                 int width,
                                                 int height,
                                                 int nComps,
@@ -150,36 +150,36 @@
                                                 int Colors,
                                                 int BitsPerComponent,
                                                 int Columns) = 0;
-  virtual FX_DWORD FlateOrLZWDecode(FX_BOOL bLZW,
+  virtual uint32_t FlateOrLZWDecode(FX_BOOL bLZW,
                                     const uint8_t* src_buf,
-                                    FX_DWORD src_size,
+                                    uint32_t src_size,
                                     FX_BOOL bEarlyChange,
                                     int predictor,
                                     int Colors,
                                     int BitsPerComponent,
                                     int Columns,
-                                    FX_DWORD estimated_size,
+                                    uint32_t estimated_size,
                                     uint8_t*& dest_buf,
-                                    FX_DWORD& dest_size) = 0;
+                                    uint32_t& dest_size) = 0;
   virtual FX_BOOL Encode(const uint8_t* src_buf,
-                         FX_DWORD src_size,
+                         uint32_t src_size,
                          int predictor,
                          int Colors,
                          int BitsPerComponent,
                          int Columns,
                          uint8_t*& dest_buf,
-                         FX_DWORD& dest_size) = 0;
+                         uint32_t& dest_size) = 0;
   virtual FX_BOOL Encode(const uint8_t* src_buf,
-                         FX_DWORD src_size,
+                         uint32_t src_size,
                          uint8_t*& dest_buf,
-                         FX_DWORD& dest_size) = 0;
+                         uint32_t& dest_size) = 0;
 };
 class ICodec_FaxModule {
  public:
   virtual ~ICodec_FaxModule() {}
 
   virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf,
-                                                FX_DWORD src_size,
+                                                uint32_t src_size,
                                                 int width,
                                                 int height,
                                                 int K,
@@ -194,35 +194,35 @@
                          int height,
                          int pitch,
                          uint8_t*& dest_buf,
-                         FX_DWORD& dest_size) = 0;
+                         uint32_t& dest_size) = 0;
 };
 class ICodec_JpegModule {
  public:
   virtual ~ICodec_JpegModule() {}
 
   virtual ICodec_ScanlineDecoder* CreateDecoder(const uint8_t* src_buf,
-                                                FX_DWORD src_size,
+                                                uint32_t src_size,
                                                 int width,
                                                 int height,
                                                 int nComps,
                                                 FX_BOOL ColorTransform) = 0;
 
   virtual FX_BOOL LoadInfo(const uint8_t* src_buf,
-                           FX_DWORD src_size,
+                           uint32_t src_size,
                            int& width,
                            int& height,
                            int& num_components,
                            int& bits_per_components,
                            FX_BOOL& color_transform,
                            uint8_t** icc_buf_ptr = NULL,
-                           FX_DWORD* icc_length = NULL) = 0;
+                           uint32_t* icc_length = NULL) = 0;
 
   virtual FX_BOOL Encode(const class CFX_DIBSource* pSource,
                          uint8_t*& dest_buf,
                          FX_STRSIZE& dest_size,
                          int quality = 75,
                          const uint8_t* icc_buf = NULL,
-                         FX_DWORD icc_length = 0) = 0;
+                         uint32_t icc_length = 0) = 0;
 
   virtual void* Start() = 0;
 
@@ -230,7 +230,7 @@
 
   virtual void Input(void* pContext,
                      const uint8_t* src_buf,
-                     FX_DWORD src_size) = 0;
+                     uint32_t src_size) = 0;
 
 #ifdef PDF_ENABLE_XFA
   virtual int ReadHeader(void* pContext,
@@ -249,7 +249,7 @@
 
   virtual FX_BOOL ReadScanline(void* pContext, uint8_t* dest_buf) = 0;
 
-  virtual FX_DWORD GetAvailInput(void* pContext,
+  virtual uint32_t GetAvailInput(void* pContext,
                                  uint8_t** avail_buf_ptr = NULL) = 0;
 };
 
@@ -258,13 +258,13 @@
   virtual ~ICodec_JpxModule() {}
 
   virtual CJPX_Decoder* CreateDecoder(const uint8_t* src_buf,
-                                      FX_DWORD src_size,
+                                      uint32_t src_size,
                                       CPDF_ColorSpace* cs) = 0;
 
   virtual void GetImageInfo(CJPX_Decoder* pDecoder,
-                            FX_DWORD* width,
-                            FX_DWORD* height,
-                            FX_DWORD* components) = 0;
+                            uint32_t* width,
+                            uint32_t* height,
+                            uint32_t* components) = 0;
 
   virtual bool Decode(CJPX_Decoder* pDecoder,
                       uint8_t* dest_data,
@@ -284,7 +284,7 @@
 
   virtual FX_BOOL Input(void* pContext,
                         const uint8_t* src_buf,
-                        FX_DWORD src_size,
+                        uint32_t src_size,
                         CFX_DIBAttribute* pAttribute) = 0;
 
   FX_BOOL (*ReadHeaderCallback)(void* pModule,
@@ -307,12 +307,12 @@
 
   virtual void Finish(void* pContext) = 0;
 
-  virtual FX_DWORD GetAvailInput(void* pContext,
+  virtual uint32_t GetAvailInput(void* pContext,
                                  uint8_t** avail_buf_ptr = NULL) = 0;
 
   virtual void Input(void* pContext,
                      const uint8_t* src_buf,
-                     FX_DWORD src_size) = 0;
+                     uint32_t src_size) = 0;
 
   virtual int32_t ReadHeader(void* pContext,
                              int* width,
@@ -324,7 +324,7 @@
 
   virtual int32_t LoadFrameInfo(void* pContext, int* frame_num) = 0;
 
-  void (*RecordCurrentPositionCallback)(void* pModule, FX_DWORD& cur_pos);
+  void (*RecordCurrentPositionCallback)(void* pModule, uint32_t& cur_pos);
 
   uint8_t* (*AskLocalPaletteBufCallback)(void* pModule,
                                          int32_t frame_num,
@@ -335,7 +335,7 @@
                             CFX_DIBAttribute* pAttribute) = 0;
 
   FX_BOOL (*InputRecordPositionBufCallback)(void* pModule,
-                                            FX_DWORD rcd_pos,
+                                            uint32_t rcd_pos,
                                             const FX_RECT& img_rc,
                                             int32_t pal_num,
                                             void* pal_ptr,
@@ -357,12 +357,12 @@
 
   virtual void Finish(void* pContext) = 0;
 
-  virtual FX_DWORD GetAvailInput(void* pContext,
+  virtual uint32_t GetAvailInput(void* pContext,
                                  uint8_t** avail_buf_ptr = NULL) = 0;
 
   virtual void Input(void* pContext,
                      const uint8_t* src_buf,
-                     FX_DWORD src_size) = 0;
+                     uint32_t src_size) = 0;
 
   virtual int32_t ReadHeader(void* pContext,
                              int32_t* width,
@@ -370,12 +370,12 @@
                              FX_BOOL* tb_flag,
                              int32_t* components,
                              int* pal_num,
-                             FX_DWORD** pal_pp,
+                             uint32_t** pal_pp,
                              CFX_DIBAttribute* pAttribute) = 0;
 
   virtual int32_t LoadImage(void* pContext) = 0;
 
-  FX_BOOL (*InputImagePositionBufCallback)(void* pModule, FX_DWORD rcd_pos);
+  FX_BOOL (*InputImagePositionBufCallback)(void* pModule, uint32_t rcd_pos);
 
   void (*ReadScanlineCallback)(void* pModule,
                                int32_t row_num,
@@ -391,10 +391,10 @@
 
   virtual FX_BOOL LoadFrameInfo(void* ctx,
                                 int32_t frame,
-                                FX_DWORD& width,
-                                FX_DWORD& height,
-                                FX_DWORD& comps,
-                                FX_DWORD& bpc,
+                                uint32_t& width,
+                                uint32_t& height,
+                                uint32_t& comps,
+                                uint32_t& bpc,
                                 CFX_DIBAttribute* pAttribute) = 0;
 
   virtual FX_BOOL Decode(void* ctx, class CFX_DIBitmap* pDIBitmap) = 0;
@@ -411,12 +411,12 @@
 
   virtual FXCODEC_STATUS StartDecode(void* pJbig2Context,
                                      CFX_PrivateData* pPrivateData,
-                                     FX_DWORD width,
-                                     FX_DWORD height,
+                                     uint32_t width,
+                                     uint32_t height,
                                      CPDF_StreamAcc* src_stream,
                                      CPDF_StreamAcc* global_stream,
                                      uint8_t* dest_buf,
-                                     FX_DWORD dest_pitch,
+                                     uint32_t dest_pitch,
                                      IFX_Pause* pPause) = 0;
 
   virtual FXCODEC_STATUS ContinueDecode(void* pJbig2Content,
@@ -477,12 +477,12 @@
   };
 
   struct IccParam {
-    FX_DWORD Version;
+    uint32_t Version;
     IccCS ColorSpace;
-    FX_DWORD dwProfileType;
-    FX_DWORD dwFormat;
+    uint32_t dwProfileType;
+    uint32_t dwFormat;
     uint8_t* pProfileData;
-    FX_DWORD dwProfileSize;
+    uint32_t dwProfileSize;
     double Gamma;
   };
 
@@ -497,27 +497,27 @@
       ICodec_IccModule::IccParam* pInputParam,
       ICodec_IccModule::IccParam* pOutputParam,
       ICodec_IccModule::IccParam* pProofParam = NULL,
-      FX_DWORD dwIntent = Icc_INTENT_PERCEPTUAL,
-      FX_DWORD dwFlag = Icc_FLAGS_DEFAULT,
-      FX_DWORD dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
-      FX_DWORD dwPrfFlag = Icc_FLAGS_SOFTPROOFING) = 0;
+      uint32_t dwIntent = Icc_INTENT_PERCEPTUAL,
+      uint32_t dwFlag = Icc_FLAGS_DEFAULT,
+      uint32_t dwPrfIntent = Icc_INTENT_ABSOLUTE_COLORIMETRIC,
+      uint32_t dwPrfFlag = Icc_FLAGS_SOFTPROOFING) = 0;
 
   virtual void* CreateTransform_sRGB(
       const uint8_t* pProfileData,
-      FX_DWORD dwProfileSize,
-      FX_DWORD& nComponents,
+      uint32_t dwProfileSize,
+      uint32_t& nComponents,
       int32_t intent = 0,
-      FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT) = 0;
+      uint32_t dwSrcFormat = Icc_FORMAT_DEFAULT) = 0;
 
   virtual void* CreateTransform_CMYK(
       const uint8_t* pSrcProfileData,
-      FX_DWORD dwSrcProfileSize,
-      FX_DWORD& nSrcComponents,
+      uint32_t dwSrcProfileSize,
+      uint32_t& nSrcComponents,
       const uint8_t* pDstProfileData,
-      FX_DWORD dwDstProfileSize,
+      uint32_t dwDstProfileSize,
       int32_t intent = 0,
-      FX_DWORD dwSrcFormat = Icc_FORMAT_DEFAULT,
-      FX_DWORD dwDstFormat = Icc_FORMAT_DEFAULT) = 0;
+      uint32_t dwSrcFormat = Icc_FORMAT_DEFAULT,
+      uint32_t dwDstFormat = Icc_FORMAT_DEFAULT) = 0;
 
   virtual void DestroyTransform(void* pTransform) = 0;
 
@@ -529,7 +529,7 @@
                                  uint8_t* pDest,
                                  const uint8_t* pSrc,
                                  int pixels) = 0;
-  virtual void SetComponents(FX_DWORD nComponents) = 0;
+  virtual void SetComponents(uint32_t nComponents) = 0;
 };
 
 void ReverseRGB(uint8_t* pDestBuf, const uint8_t* pSrcBuf, int pixels);
@@ -554,9 +554,9 @@
                         uint8_t& R,
                         uint8_t& G,
                         uint8_t& B);
-FX_BOOL MD5ComputeID(const void* buf, FX_DWORD dwSize, uint8_t ID[16]);
+FX_BOOL MD5ComputeID(const void* buf, uint32_t dwSize, uint8_t ID[16]);
 void FaxG4Decode(const uint8_t* src_buf,
-                 FX_DWORD src_size,
+                 uint32_t src_size,
                  int* pbitpos,
                  uint8_t* dest_buf,
                  int width,
diff --git a/core/include/fxge/fpf.h b/core/include/fxge/fpf.h
index 6e59678..bc42a2d 100644
--- a/core/include/fxge/fpf.h
+++ b/core/include/fxge/fpf.h
@@ -31,7 +31,7 @@
   virtual FPF_HFONT GetHandle() = 0;
   virtual CFX_ByteString GetFamilyName() = 0;
   virtual CFX_WideString GetPsName() = 0;
-  virtual FX_DWORD GetFontStyle() const = 0;
+  virtual uint32_t GetFontStyle() const = 0;
   virtual uint8_t GetCharset() const = 0;
 
   virtual int32_t GetGlyphIndex(FX_WCHAR wUnicode) = 0;
@@ -45,9 +45,9 @@
 
   virtual int32_t GetHeight() const = 0;
   virtual int32_t GetItalicAngle() const = 0;
-  virtual FX_DWORD GetFontData(FX_DWORD dwTable,
+  virtual uint32_t GetFontData(uint32_t dwTable,
                                uint8_t* pBuffer,
-                               FX_DWORD dwSize) = 0;
+                               uint32_t dwSize) = 0;
 
  protected:
   virtual ~IFPF_Font() {}
@@ -63,8 +63,8 @@
 
   virtual IFPF_Font* CreateFont(const CFX_ByteStringC& bsFamilyname,
                                 uint8_t charset,
-                                FX_DWORD dwStyle,
-                                FX_DWORD dwMatch = 0) = 0;
+                                uint32_t dwStyle,
+                                uint32_t dwMatch = 0) = 0;
 };
 
 #endif  // CORE_INCLUDE_FXGE_FPF_H_
diff --git a/core/include/fxge/fx_dib.h b/core/include/fxge/fx_dib.h
index bc89544..0908178 100644
--- a/core/include/fxge/fx_dib.h
+++ b/core/include/fxge/fx_dib.h
@@ -60,9 +60,9 @@
 #define FXDIB_BLEND_COLOR 23
 #define FXDIB_BLEND_LUMINOSITY 24
 #define FXDIB_BLEND_UNSUPPORTED -1
-typedef FX_DWORD FX_ARGB;
-typedef FX_DWORD FX_COLORREF;
-typedef FX_DWORD FX_CMYK;
+typedef uint32_t FX_ARGB;
+typedef uint32_t FX_COLORREF;
+typedef uint32_t FX_CMYK;
 class CFX_ClipRgn;
 class CFX_DIBSource;
 class CFX_DIBitmap;
@@ -93,7 +93,7 @@
 #define FXARGB_G(argb) ((uint8_t)((argb) >> 8))
 #define FXARGB_B(argb) ((uint8_t)(argb))
 #define FXARGB_MAKE(a, r, g, b) \
-  (((FX_DWORD)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
+  (((uint32_t)(a) << 24) | ((r) << 16) | ((g) << 8) | (b))
 #define FXARGB_MUL_ALPHA(argb, alpha) \
   (((((argb) >> 24) * (alpha) / 255) << 24) | ((argb)&0xffffff))
 #define FXRGB2GRAY(r, g, b) (((b)*11 + (g)*59 + (r)*30) / 100)
@@ -168,8 +168,8 @@
   FXDIB_Format GetFormat() const {
     return (FXDIB_Format)(m_AlphaFlag * 0x100 + m_bpp);
   }
-  FX_DWORD GetPitch() const { return m_Pitch; }
-  FX_DWORD* GetPalette() const { return m_pPalette; }
+  uint32_t GetPitch() const { return m_Pitch; }
+  uint32_t* GetPalette() const { return m_pPalette; }
 
   virtual uint8_t* GetBuffer() const;
   virtual const uint8_t* GetScanline(int line) const = 0;
@@ -197,15 +197,15 @@
     return IsAlphaMask() ? 0 : (m_bpp == 1 ? 2 : (m_bpp == 8 ? 256 : 0));
   }
 
-  FX_DWORD GetPaletteEntry(int index) const;
+  uint32_t GetPaletteEntry(int index) const;
 
-  void SetPaletteEntry(int index, FX_DWORD color);
-  FX_DWORD GetPaletteArgb(int index) const { return GetPaletteEntry(index); }
-  void SetPaletteArgb(int index, FX_DWORD color) {
+  void SetPaletteEntry(int index, uint32_t color);
+  uint32_t GetPaletteArgb(int index) const { return GetPaletteEntry(index); }
+  void SetPaletteArgb(int index, uint32_t color) {
     SetPaletteEntry(index, color);
   }
 
-  void CopyPalette(const FX_DWORD* pSrcPal, FX_DWORD size = 256);
+  void CopyPalette(const uint32_t* pSrcPal, uint32_t size = 256);
 
   CFX_DIBitmap* Clone(const FX_RECT* pClip = NULL) const;
   CFX_DIBitmap* CloneConvert(FXDIB_Format format,
@@ -214,12 +214,12 @@
 
   CFX_DIBitmap* StretchTo(int dest_width,
                           int dest_height,
-                          FX_DWORD flags = 0,
+                          uint32_t flags = 0,
                           const FX_RECT* pClip = NULL) const;
   CFX_DIBitmap* TransformTo(const CFX_Matrix* pMatrix,
                             int& left,
                             int& top,
-                            FX_DWORD flags = 0,
+                            uint32_t flags = 0,
                             const FX_RECT* pClip = NULL) const;
 
   CFX_DIBitmap* GetAlphaMask(const FX_RECT* pClip = NULL) const;
@@ -250,14 +250,14 @@
   int m_Width;
   int m_Height;
   int m_bpp;
-  FX_DWORD m_AlphaFlag;
-  FX_DWORD m_Pitch;
-  FX_DWORD* m_pPalette;
+  uint32_t m_AlphaFlag;
+  uint32_t m_Pitch;
+  uint32_t* m_pPalette;
 
   void BuildPalette();
   FX_BOOL BuildAlphaMask();
-  int FindPalette(FX_DWORD color) const;
-  void GetPalette(FX_DWORD* pal, int alpha) const;
+  int FindPalette(uint32_t color) const;
+  void GetPalette(uint32_t* pal, int alpha) const;
 };
 class CFX_DIBitmap : public CFX_DIBSource {
  public:
@@ -288,11 +288,11 @@
 
   FX_BOOL ConvertFormat(FXDIB_Format format, void* pIccTransform = NULL);
 
-  void Clear(FX_DWORD color);
+  void Clear(uint32_t color);
 
-  FX_DWORD GetPixel(int x, int y) const;
+  uint32_t GetPixel(int x, int y) const;
 
-  void SetPixel(int x, int y, FX_DWORD color);
+  void SetPixel(int x, int y, uint32_t color);
 
   FX_BOOL LoadChannel(FXDIB_Channel destChannel,
                       const CFX_DIBSource* pSrcBitmap,
@@ -330,7 +330,7 @@
                        int width,
                        int height,
                        const CFX_DIBSource* pMask,
-                       FX_DWORD color,
+                       uint32_t color,
                        int src_left,
                        int src_top,
                        int alpha_flag = 0,
@@ -341,7 +341,7 @@
                         int width,
                         int height,
                         const CFX_DIBSource* pMask,
-                        FX_DWORD color,
+                        uint32_t color,
                         int src_left,
                         int src_top,
                         int blend_type = FXDIB_BLEND_NORMAL,
@@ -354,13 +354,13 @@
                         int dest_top,
                         int width,
                         int height,
-                        FX_DWORD color,
+                        uint32_t color,
                         int alpha_flag = 0,
                         void* pIccTransform = NULL);
 
-  FX_BOOL ConvertColorScale(FX_DWORD forecolor, FX_DWORD backcolor);
+  FX_BOOL ConvertColorScale(uint32_t forecolor, uint32_t backcolor);
 
-  FX_BOOL DitherFS(const FX_DWORD* pPalette,
+  FX_BOOL DitherFS(const uint32_t* pPalette,
                    int pal_size,
                    const FX_RECT* pRect = NULL);
 
@@ -393,7 +393,7 @@
 
   virtual FXDIB_Format GetDestFormat() = 0;
 
-  virtual FX_DWORD* GetDestPalette() = 0;
+  virtual uint32_t* GetDestPalette() = 0;
 
   virtual void TranslateScanline(uint8_t* dest_buf,
                                  const uint8_t* src_buf) const = 0;
@@ -432,7 +432,7 @@
   virtual FX_BOOL SetInfo(int width,
                           int height,
                           FXDIB_Format src_format,
-                          FX_DWORD* pSrcPalette) = 0;
+                          uint32_t* pSrcPalette) = 0;
 };
 class CFX_ScanlineCompositor {
  public:
@@ -443,8 +443,8 @@
   FX_BOOL Init(FXDIB_Format dest_format,
                FXDIB_Format src_format,
                int32_t width,
-               FX_DWORD* pSrcPalette,
-               FX_DWORD mask_color,
+               uint32_t* pSrcPalette,
+               uint32_t mask_color,
                int blend_type,
                FX_BOOL bClip,
                FX_BOOL bRgbByteOrder = FALSE,
@@ -482,7 +482,7 @@
  protected:
   int m_Transparency;
   FXDIB_Format m_SrcFormat, m_DestFormat;
-  FX_DWORD* m_pSrcPalette;
+  uint32_t* m_pSrcPalette;
 
   int m_MaskAlpha, m_MaskRed, m_MaskGreen, m_MaskBlue, m_MaskBlack;
   int m_BlendType;
@@ -500,7 +500,7 @@
   void Compose(CFX_DIBitmap* pDest,
                const CFX_ClipRgn* pClipRgn,
                int bitmap_alpha,
-               FX_DWORD mask_color,
+               uint32_t mask_color,
                FX_RECT& dest_rect,
                FX_BOOL bVertical,
                FX_BOOL bFlipX,
@@ -514,7 +514,7 @@
   FX_BOOL SetInfo(int width,
                   int height,
                   FXDIB_Format src_format,
-                  FX_DWORD* pSrcPalette) override;
+                  uint32_t* pSrcPalette) override;
 
   void ComposeScanline(int line,
                        const uint8_t* scanline,
@@ -531,7 +531,7 @@
   const CFX_ClipRgn* m_pClipRgn;
   FXDIB_Format m_SrcFormat;
   int m_DestLeft, m_DestTop, m_DestWidth, m_DestHeight, m_BitmapAlpha;
-  FX_DWORD m_MaskColor;
+  uint32_t m_MaskColor;
   const CFX_DIBitmap* m_pClipMask;
   CFX_ScanlineCompositor m_Compositor;
   FX_BOOL m_bVertical, m_bFlipX, m_bFlipY;
@@ -561,7 +561,7 @@
   FX_BOOL SetInfo(int width,
                   int height,
                   FXDIB_Format src_format,
-                  FX_DWORD* pSrcPalette) override;
+                  uint32_t* pSrcPalette) override;
 
   CFX_DIBitmap* GetBitmap() { return m_pBitmap; }
 
@@ -583,7 +583,7 @@
                 int dest_width,
                 int dest_height,
                 const FX_RECT& bitmap_rect,
-                FX_DWORD flags);
+                uint32_t flags);
 
   FX_BOOL Continue(IFX_Pause* pPause);
   FX_BOOL StartQuickStretch();
@@ -594,7 +594,7 @@
   IFX_ScanlineComposer* m_pDest;
   const CFX_DIBSource* m_pSource;
   CStretchEngine* m_pStretchEngine;
-  FX_DWORD m_Flags;
+  uint32_t m_Flags;
   FX_BOOL m_bFlipX;
   FX_BOOL m_bFlipY;
   int m_DestWidth;
@@ -627,7 +627,7 @@
   CFX_Matrix m_dest2stretch;
   CFX_ImageStretcher m_Stretcher;
   CFX_BitmapStorer m_Storer;
-  FX_DWORD m_Flags;
+  uint32_t m_Flags;
   int m_Status;
 };
 class CFX_ImageRenderer {
@@ -639,9 +639,9 @@
                 const CFX_ClipRgn* pClipRgn,
                 const CFX_DIBSource* pSource,
                 int bitmap_alpha,
-                FX_DWORD mask_color,
+                uint32_t mask_color,
                 const CFX_Matrix* pMatrix,
-                FX_DWORD dib_flags,
+                uint32_t dib_flags,
                 FX_BOOL bRgbByteOrder = FALSE,
                 int alpha_flag = 0,
                 void* pIccTransform = NULL,
@@ -653,14 +653,14 @@
   CFX_DIBitmap* m_pDevice;
   const CFX_ClipRgn* m_pClipRgn;
   int m_BitmapAlpha;
-  FX_DWORD m_MaskColor;
+  uint32_t m_MaskColor;
   CFX_Matrix m_Matrix;
   CFX_ImageTransformer* m_pTransformer;
   CFX_ImageStretcher m_Stretcher;
   CFX_BitmapComposer m_Composer;
   int m_Status;
   FX_RECT m_ClipBox;
-  FX_DWORD m_Flags;
+  uint32_t m_Flags;
   int m_AlphaFlag;
   void* m_pIccTransform;
   FX_BOOL m_bRgbByteOrder;
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index 382a916..c52e614 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -66,12 +66,12 @@
 
   void LoadSubst(const CFX_ByteString& face_name,
                  FX_BOOL bTrueType,
-                 FX_DWORD flags,
+                 uint32_t flags,
                  int weight,
                  int italic_angle,
                  int CharsetCP,
                  FX_BOOL bVertical = FALSE);
-  FX_BOOL LoadEmbedded(const uint8_t* data, FX_DWORD size);
+  FX_BOOL LoadEmbedded(const uint8_t* data, uint32_t size);
   FXFT_Face GetFace() const { return m_Face; }
 
 #ifdef PDF_ENABLE_XFA
@@ -87,11 +87,11 @@
   const CFX_SubstFont* GetSubstFont() const { return m_pSubstFont; }
 #endif  // PDF_ENABLE_XFA
 
-  CFX_PathData* LoadGlyphPath(FX_DWORD glyph_index, int dest_width = 0);
-  int GetGlyphWidth(FX_DWORD glyph_index);
+  CFX_PathData* LoadGlyphPath(uint32_t glyph_index, int dest_width = 0);
+  int GetGlyphWidth(uint32_t glyph_index);
   int GetAscent() const;
   int GetDescent() const;
-  FX_BOOL GetGlyphBBox(FX_DWORD glyph_index, FX_RECT& bbox);
+  FX_BOOL GetGlyphBBox(uint32_t glyph_index, FX_RECT& bbox);
   FX_BOOL IsItalic() const;
   FX_BOOL IsBold() const;
   FX_BOOL IsFixedWidth() const;
@@ -111,7 +111,7 @@
   void* GetPlatformFont() const { return m_pPlatformFont; }
   void SetPlatformFont(void* font) { m_pPlatformFont = font; }
   uint8_t* GetFontData() const { return m_pFontData; }
-  FX_DWORD GetSize() const { return m_dwSize; }
+  uint32_t GetSize() const { return m_dwSize; }
   void AdjustMMParams(int glyph_index, int width, int weight);
 
  private:
@@ -123,7 +123,7 @@
   uint8_t* m_pFontDataAllocation;
   uint8_t* m_pFontData;
   uint8_t* m_pGsubData;
-  FX_DWORD m_dwSize;
+  uint32_t m_dwSize;
   CFX_BinaryBuf m_OtfFontData;
   void* m_hHandle;
   void* m_pPlatformFont;
@@ -147,8 +147,8 @@
 
 #ifdef PDF_ENABLE_XFA
 #define FXFM_ENC_TAG(a, b, c, d)                                          \
-  (((FX_DWORD)(a) << 24) | ((FX_DWORD)(b) << 16) | ((FX_DWORD)(c) << 8) | \
-   (FX_DWORD)(d))
+  (((uint32_t)(a) << 24) | ((uint32_t)(b) << 16) | ((uint32_t)(c) << 8) | \
+   (uint32_t)(d))
 #define FXFM_ENCODING_NONE FXFM_ENC_TAG(0, 0, 0, 0)
 #define FXFM_ENCODING_MS_SYMBOL FXFM_ENC_TAG('s', 'y', 'm', 'b')
 #define FXFM_ENCODING_UNICODE FXFM_ENC_TAG('u', 'n', 'i', 'c')
@@ -170,7 +170,7 @@
   explicit CFX_UnicodeEncoding(CFX_Font* pFont);
   virtual ~CFX_UnicodeEncoding();
 
-  virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode);
+  virtual uint32_t GlyphFromCharCode(uint32_t charcode);
 
  protected:
   // Unowned, not nullptr.
@@ -180,20 +180,20 @@
 #ifdef PDF_ENABLE_XFA
 class CFX_UnicodeEncodingEx : public CFX_UnicodeEncoding {
  public:
-  CFX_UnicodeEncodingEx(CFX_Font* pFont, FX_DWORD EncodingID);
+  CFX_UnicodeEncodingEx(CFX_Font* pFont, uint32_t EncodingID);
   ~CFX_UnicodeEncodingEx() override;
 
   // CFX_UnicodeEncoding:
-  FX_DWORD GlyphFromCharCode(FX_DWORD charcode) override;
+  uint32_t GlyphFromCharCode(uint32_t charcode) override;
 
-  FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const;
+  uint32_t CharCodeFromUnicode(FX_WCHAR Unicode) const;
 
  private:
-  FX_DWORD m_nEncodingID;
+  uint32_t m_nEncodingID;
 };
 CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(
     CFX_Font* pFont,
-    FX_DWORD nEncodingID = FXFM_ENCODING_NONE);
+    uint32_t nEncodingID = FXFM_ENCODING_NONE);
 #endif  // PDF_ENABLE_XFA
 
 #define FXFONT_SUBST_MM 0x01
@@ -214,7 +214,7 @@
 
   int m_Charset;
 
-  FX_DWORD m_SubstFlags;
+  uint32_t m_SubstFlags;
 
   int m_Weight;
 
@@ -249,29 +249,29 @@
                           int weight,
                           FX_BOOL bItalic,
                           uint8_t* pData,
-                          FX_DWORD size,
+                          uint32_t size,
                           int face_index);
   FXFT_Face GetCachedTTCFace(int ttc_size,
-                             FX_DWORD checksum,
+                             uint32_t checksum,
                              int font_offset,
                              uint8_t*& pFontData);
   FXFT_Face AddCachedTTCFace(int ttc_size,
-                             FX_DWORD checksum,
+                             uint32_t checksum,
                              uint8_t* pData,
-                             FX_DWORD size,
+                             uint32_t size,
                              int font_offset);
   FXFT_Face GetFileFace(const FX_CHAR* filename, int face_index);
-  FXFT_Face GetFixedFace(const uint8_t* pData, FX_DWORD size, int face_index);
+  FXFT_Face GetFixedFace(const uint8_t* pData, uint32_t size, int face_index);
   void ReleaseFace(FXFT_Face face);
   void SetSystemFontInfo(IFX_SystemFontInfo* pFontInfo);
   FXFT_Face FindSubstFont(const CFX_ByteString& face_name,
                           FX_BOOL bTrueType,
-                          FX_DWORD flags,
+                          uint32_t flags,
                           int weight,
                           int italic_angle,
                           int CharsetCP,
                           CFX_SubstFont* pSubstFont);
-  bool GetBuiltinFont(size_t index, const uint8_t** pFontData, FX_DWORD* size);
+  bool GetBuiltinFont(size_t index, const uint8_t** pFontData, uint32_t* size);
   CFX_FontMapper* GetBuiltinMapper() const { return m_pBuiltinMapper.get(); }
   FXFT_Library GetFTLibrary() const { return m_FTLibrary; }
 
@@ -316,14 +316,14 @@
   IFX_FontEnumerator* GetFontEnumerator() const { return m_pFontEnumerator; }
   FXFT_Face FindSubstFont(const CFX_ByteString& face_name,
                           FX_BOOL bTrueType,
-                          FX_DWORD flags,
+                          uint32_t flags,
                           int weight,
                           int italic_angle,
                           int CharsetCP,
                           CFX_SubstFont* pSubstFont);
 #ifdef PDF_ENABLE_XFA
-  FXFT_Face FindSubstFontByUnicode(FX_DWORD dwUnicode,
-                                   FX_DWORD flags,
+  FXFT_Face FindSubstFontByUnicode(uint32_t dwUnicode,
+                                   uint32_t flags,
                                    int weight,
                                    int italic_angle);
 #endif  // PDF_ENABLE_XFA
@@ -346,7 +346,7 @@
   FX_BOOL m_bListLoaded;
   FXFT_Face m_MMFaces[MM_FACE_COUNT];
   CFX_ByteString m_LastFamily;
-  CFX_ArrayTemplate<FX_DWORD> m_CharsetArray;
+  CFX_ArrayTemplate<uint32_t> m_CharsetArray;
   std::vector<CFX_ByteString> m_FaceArray;
   IFX_SystemFontInfo* m_pFontInfo;
   FXFT_Face m_FoxitFaces[FOXIT_FACE_COUNT];
@@ -368,17 +368,17 @@
                         int& iExact) = 0;
 
 #ifdef PDF_ENABLE_XFA
-  virtual void* MapFontByUnicode(FX_DWORD dwUnicode,
+  virtual void* MapFontByUnicode(uint32_t dwUnicode,
                                  int weight,
                                  FX_BOOL bItalic,
                                  int pitch_family);
 #endif  // PDF_ENABLE_XFA
 
   virtual void* GetFont(const FX_CHAR* face) = 0;
-  virtual FX_DWORD GetFontData(void* hFont,
-                               FX_DWORD table,
+  virtual uint32_t GetFontData(void* hFont,
+                               uint32_t table,
                                uint8_t* buffer,
-                               FX_DWORD size) = 0;
+                               uint32_t size) = 0;
   virtual FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) = 0;
   virtual FX_BOOL GetFontCharset(void* hFont, int& charset) = 0;
   virtual int GetFaceIndex(void* hFont);
@@ -405,16 +405,16 @@
                 const FX_CHAR* face,
                 int& bExact) override;
 #ifdef PDF_ENABLE_XFA
-  void* MapFontByUnicode(FX_DWORD dwUnicode,
+  void* MapFontByUnicode(uint32_t dwUnicode,
                          int weight,
                          FX_BOOL bItalic,
                          int pitch_family) override;
 #endif  // PDF_ENABLE_XFA
   void* GetFont(const FX_CHAR* face) override;
-  FX_DWORD GetFontData(void* hFont,
-                       FX_DWORD table,
+  uint32_t GetFontData(void* hFont,
+                       uint32_t table,
                        uint8_t* buffer,
-                       FX_DWORD size) override;
+                       uint32_t size) override;
   void DeleteFont(void* hFont) override;
   FX_BOOL GetFaceName(void* hFont, CFX_ByteString& name) override;
   FX_BOOL GetFontCharset(void* hFont, int& charset) override;
@@ -424,8 +424,8 @@
   void ScanFile(const CFX_ByteString& path);
   void ReportFace(const CFX_ByteString& path,
                   FXSYS_FILE* pFile,
-                  FX_DWORD filesize,
-                  FX_DWORD offset);
+                  uint32_t filesize,
+                  uint32_t offset);
   void* GetSubstFont(const CFX_ByteString& face);
   void* FindFont(int weight,
                  FX_BOOL bItalic,
@@ -442,7 +442,7 @@
 class CFX_CountedFaceCache {
  public:
   CFX_FaceCache* m_Obj;
-  FX_DWORD m_nCount;
+  uint32_t m_nCount;
 };
 
 class CFX_FontCache {
@@ -480,32 +480,32 @@
   explicit CFX_FaceCache(FXFT_Face face);
   ~CFX_FaceCache();
   const CFX_GlyphBitmap* LoadGlyphBitmap(CFX_Font* pFont,
-                                         FX_DWORD glyph_index,
+                                         uint32_t glyph_index,
                                          FX_BOOL bFontStyle,
                                          const CFX_Matrix* pMatrix,
                                          int dest_width,
                                          int anti_alias,
                                          int& text_flags);
   const CFX_PathData* LoadGlyphPath(CFX_Font* pFont,
-                                    FX_DWORD glyph_index,
+                                    uint32_t glyph_index,
                                     int dest_width);
 
  private:
   CFX_GlyphBitmap* RenderGlyph(CFX_Font* pFont,
-                               FX_DWORD glyph_index,
+                               uint32_t glyph_index,
                                FX_BOOL bFontStyle,
                                const CFX_Matrix* pMatrix,
                                int dest_width,
                                int anti_alias);
   CFX_GlyphBitmap* RenderGlyph_Nativetext(CFX_Font* pFont,
-                                          FX_DWORD glyph_index,
+                                          uint32_t glyph_index,
                                           const CFX_Matrix* pMatrix,
                                           int dest_width,
                                           int anti_alias);
   CFX_GlyphBitmap* LookUpGlyphBitmap(CFX_Font* pFont,
                                      const CFX_Matrix* pMatrix,
                                      CFX_ByteStringC& FaceGlyphsKey,
-                                     FX_DWORD glyph_index,
+                                     uint32_t glyph_index,
                                      FX_BOOL bFontStyle,
                                      int dest_width,
                                      int anti_alias);
@@ -514,7 +514,7 @@
 
   FXFT_Face const m_Face;
   std::map<CFX_ByteString, CFX_SizeGlyphCache*> m_SizeMap;
-  std::map<FX_DWORD, CFX_PathData*> m_PathMap;
+  std::map<uint32_t, CFX_PathData*> m_PathMap;
   CFX_DIBitmap* m_pBitmap;
 };
 
@@ -535,15 +535,15 @@
 class IFX_GSUBTable {
  public:
   static IFX_GSUBTable* Create(CFX_Font* pFont);
-  virtual FX_BOOL GetVerticalGlyph(FX_DWORD glyphnum, FX_DWORD* vglyphnum) = 0;
+  virtual FX_BOOL GetVerticalGlyph(uint32_t glyphnum, uint32_t* vglyphnum) = 0;
 
  protected:
   virtual ~IFX_GSUBTable() {}
 };
 
 CFX_ByteString GetNameFromTT(const uint8_t* name_table,
-                             FX_DWORD name_table_size,
-                             FX_DWORD name);
+                             uint32_t name_table_size,
+                             uint32_t name);
 
 int PDF_GetStandardFontName(CFX_ByteString* name);
 
diff --git a/core/include/fxge/fx_ge.h b/core/include/fxge/fx_ge.h
index d824d08..3eb9303 100644
--- a/core/include/fxge/fx_ge.h
+++ b/core/include/fxge/fx_ge.h
@@ -235,12 +235,12 @@
 #define FXTEXT_PRINTIMAGETEXT 0x10
 #define FXTEXT_NOSMOOTH 0x20
 typedef struct {
-  FX_DWORD m_GlyphIndex;
+  uint32_t m_GlyphIndex;
   FX_FLOAT m_OriginX, m_OriginY;
   int m_FontCharWidth;
   FX_BOOL m_bGlyphAdjust;
   FX_FLOAT m_AdjustMatrix[4];
-  FX_DWORD m_ExtGID;
+  uint32_t m_ExtGID;
   FX_BOOL m_bFontStyle;
 } FXTEXT_CHARPOS;
 
@@ -286,8 +286,8 @@
   FX_BOOL DrawPath(const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_color,
-                   FX_DWORD stroke_color,
+                   uint32_t fill_color,
+                   uint32_t stroke_color,
                    int fill_mode,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL,
@@ -295,12 +295,12 @@
 
   FX_BOOL SetPixel(int x,
                    int y,
-                   FX_DWORD color,
+                   uint32_t color,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL);
 
   FX_BOOL FillRect(const FX_RECT* pRect,
-                   FX_DWORD color,
+                   uint32_t color,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL,
                    int blend_type = FXDIB_BLEND_NORMAL);
@@ -309,7 +309,7 @@
                            FX_FLOAT y1,
                            FX_FLOAT x2,
                            FX_FLOAT y2,
-                           FX_DWORD color,
+                           uint32_t color,
                            int fill_mode = 0,
                            int alpha_flag = 0,
                            void* pIccTransform = NULL,
@@ -333,14 +333,14 @@
                         int top,
                         int dest_width,
                         int dest_height,
-                        FX_DWORD flags = 0,
+                        uint32_t flags = 0,
                         void* pIccTransform = NULL,
                         int blend_type = FXDIB_BLEND_NORMAL);
 
   FX_BOOL SetBitMask(const CFX_DIBSource* pBitmap,
                      int left,
                      int top,
-                     FX_DWORD color,
+                     uint32_t color,
                      int alpha_flag = 0,
                      void* pIccTransform = NULL);
 
@@ -349,16 +349,16 @@
                          int top,
                          int dest_width,
                          int dest_height,
-                         FX_DWORD color,
-                         FX_DWORD flags = 0,
+                         uint32_t color,
+                         uint32_t flags = 0,
                          int alpha_flag = 0,
                          void* pIccTransform = NULL);
 
   FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                       int bitmap_alpha,
-                      FX_DWORD color,
+                      uint32_t color,
                       const CFX_Matrix* pMatrix,
-                      FX_DWORD flags,
+                      uint32_t flags,
                       void*& handle,
                       int alpha_flag = 0,
                       void* pIccTransform = NULL,
@@ -374,8 +374,8 @@
                          CFX_FontCache* pCache,
                          FX_FLOAT font_size,
                          const CFX_Matrix* pText2Device,
-                         FX_DWORD fill_color,
-                         FX_DWORD text_flags,
+                         uint32_t fill_color,
+                         uint32_t text_flags,
                          int alpha_flag = 0,
                          void* pIccTransform = NULL);
 
@@ -387,8 +387,8 @@
                        const CFX_Matrix* pText2User,
                        const CFX_Matrix* pUser2Device,
                        const CFX_GraphStateData* pGraphState,
-                       FX_DWORD fill_color,
-                       FX_DWORD stroke_color,
+                       uint32_t fill_color,
+                       uint32_t stroke_color,
                        CFX_PathData* pClippingPath,
                        int nFlag = 0,
                        int alpha_flag = 0,
@@ -403,8 +403,8 @@
   FX_BOOL DrawFillStrokePath(const CFX_PathData* pPathData,
                              const CFX_Matrix* pObject2Device,
                              const CFX_GraphStateData* pGraphState,
-                             FX_DWORD fill_color,
-                             FX_DWORD stroke_color,
+                             uint32_t fill_color,
+                             uint32_t stroke_color,
                              int fill_mode,
                              int alpha_flag,
                              void* pIccTransform,
@@ -505,8 +505,8 @@
   virtual FX_BOOL DrawPath(const CFX_PathData* pPathData,
                            const CFX_Matrix* pObject2Device,
                            const CFX_GraphStateData* pGraphState,
-                           FX_DWORD fill_color,
-                           FX_DWORD stroke_color,
+                           uint32_t fill_color,
+                           uint32_t stroke_color,
                            int fill_mode,
                            int alpha_flag = 0,
                            void* pIccTransform = NULL,
@@ -514,14 +514,14 @@
 
   virtual FX_BOOL SetPixel(int x,
                            int y,
-                           FX_DWORD color,
+                           uint32_t color,
                            int alpha_flag = 0,
                            void* pIccTransform = NULL) {
     return FALSE;
   }
 
   virtual FX_BOOL FillRect(const FX_RECT* pRect,
-                           FX_DWORD fill_color,
+                           uint32_t fill_color,
                            int alpha_flag = 0,
                            void* pIccTransform = NULL,
                            int blend_type = FXDIB_BLEND_NORMAL) {
@@ -532,7 +532,7 @@
                                    FX_FLOAT y1,
                                    FX_FLOAT x2,
                                    FX_FLOAT y2,
-                                   FX_DWORD color,
+                                   uint32_t color,
                                    int alpha_flag = 0,
                                    void* pIccTransform = NULL,
                                    int blend_type = FXDIB_BLEND_NORMAL) {
@@ -551,7 +551,7 @@
   virtual CFX_DIBitmap* GetBackDrop() { return NULL; }
 
   virtual FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                            FX_DWORD color,
+                            uint32_t color,
                             const FX_RECT* pSrcRect,
                             int dest_left,
                             int dest_top,
@@ -560,22 +560,22 @@
                             void* pIccTransform = NULL) = 0;
 
   virtual FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                                FX_DWORD color,
+                                uint32_t color,
                                 int dest_left,
                                 int dest_top,
                                 int dest_width,
                                 int dest_height,
                                 const FX_RECT* pClipRect,
-                                FX_DWORD flags,
+                                uint32_t flags,
                                 int alpha_flag = 0,
                                 void* pIccTransform = NULL,
                                 int blend_type = FXDIB_BLEND_NORMAL) = 0;
 
   virtual FX_BOOL StartDIBits(const CFX_DIBSource* pBitmap,
                               int bitmap_alpha,
-                              FX_DWORD color,
+                              uint32_t color,
                               const CFX_Matrix* pMatrix,
-                              FX_DWORD flags,
+                              uint32_t flags,
                               void*& handle,
                               int alpha_flag = 0,
                               void* pIccTransform = NULL,
@@ -593,7 +593,7 @@
                                  CFX_FontCache* pCache,
                                  const CFX_Matrix* pObject2Device,
                                  FX_FLOAT font_size,
-                                 FX_DWORD color,
+                                 uint32_t color,
                                  int alpha_flag = 0,
                                  void* pIccTransform = NULL) {
     return FALSE;
@@ -652,33 +652,33 @@
   FX_BOOL DrawPath(const CFX_PathData* pPathData,
                    const CFX_Matrix* pObject2Device,
                    const CFX_GraphStateData* pGraphState,
-                   FX_DWORD fill_color,
-                   FX_DWORD stroke_color,
+                   uint32_t fill_color,
+                   uint32_t stroke_color,
                    int fill_mode,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL);
 
   FX_BOOL SetDIBits(const CFX_DIBSource* pBitmap,
-                    FX_DWORD color,
+                    uint32_t color,
                     int dest_left,
                     int dest_top,
                     int alpha_flag = 0,
                     void* pIccTransform = NULL);
 
   FX_BOOL StretchDIBits(const CFX_DIBSource* pBitmap,
-                        FX_DWORD color,
+                        uint32_t color,
                         int dest_left,
                         int dest_top,
                         int dest_width,
                         int dest_height,
-                        FX_DWORD flags,
+                        uint32_t flags,
                         int alpha_flag = 0,
                         void* pIccTransform = NULL);
 
   FX_BOOL DrawDIBits(const CFX_DIBSource* pBitmap,
-                     FX_DWORD color,
+                     uint32_t color,
                      const CFX_Matrix* pMatrix,
-                     FX_DWORD flags,
+                     uint32_t flags,
                      int alpha_flag = 0,
                      void* pIccTransform = NULL);
 
@@ -688,7 +688,7 @@
                    CFX_FontCache* pCache,
                    const CFX_Matrix* pObject2Device,
                    FX_FLOAT font_size,
-                   FX_DWORD color,
+                   uint32_t color,
                    int alpha_flag = 0,
                    void* pIccTransform = NULL);
 
@@ -705,7 +705,7 @@
 
   FX_BOOL m_bColorSet;
 
-  FX_DWORD m_LastColor;
+  uint32_t m_LastColor;
 
   FX_RECT m_ClipBox;
 
@@ -719,7 +719,7 @@
 
   void SetGraphState(const CFX_GraphStateData* pGraphState);
 
-  void SetColor(FX_DWORD color, int alpha_flag, void* pIccTransform);
+  void SetColor(uint32_t color, int alpha_flag, void* pIccTransform);
 
   void FindPSFontGlyph(CFX_FaceCache* pFaceCache,
                        CFX_Font* pFont,
diff --git a/core/include/fxge/fx_ge_win32.h b/core/include/fxge/fx_ge_win32.h
index 149c46d..f186459 100644
--- a/core/include/fxge/fx_ge_win32.h
+++ b/core/include/fxge/fx_ge_win32.h
@@ -32,8 +32,8 @@
 
   static CFX_DIBitmap* LoadFromDDB(HDC hDC,
                                    HBITMAP hBitmap,
-                                   FX_DWORD* pPalette = NULL,
-                                   FX_DWORD size = 256);
+                                   uint32_t* pPalette = NULL,
+                                   uint32_t size = 256);
 
   static CFX_DIBitmap* LoadFromFile(const FX_WCHAR* filename);