The handle to the shared memory segment containing startup
parameters was sent as 32-bit even on 64-bit systems. Since
HANDLEs appear to be allocated sequentially this shouldn't
be a problem until we reach 2^32 open handles in the postmaster,
but a 64-bit value should be sent across as 64-bit, and not
zero out the top 32 bits.
Noted by Tom Lane.
}
/* Insert temp file name after --fork argument */
+#ifdef _WIN64
+ sprintf(paramHandleStr, "%llu", (LONG_PTR) paramHandle);
+#else
sprintf(paramHandleStr, "%lu", (DWORD) paramHandle);
+#endif
argv[2] = paramHandleStr;
/* Format the cmd line */
HANDLE paramHandle;
BackendParameters *paramp;
+#ifdef _WIN64
+ paramHandle = (HANDLE) _atoi64(id);
+#else
paramHandle = (HANDLE) atol(id);
+#endif
paramp = MapViewOfFile(paramHandle, FILE_MAP_READ, 0, 0, 0);
if (!paramp)
{