/*
* Mingw headers are incomplete, and so are the libraries. So we have to load
- * a whole lot of API functions dynamically. Since we have to do this anyway,
- * also load the couple of functions that *do* exist in mingw headers but not
- * on NT4. That way, we don't break on NT4.
+ * a whole lot of API functions dynamically.
*/
typedef BOOL (WINAPI * __CreateRestrictedToken) (HANDLE, DWORD, DWORD, PSID_AND_ATTRIBUTES, DWORD, PLUID_AND_ATTRIBUTES, DWORD, PSID_AND_ATTRIBUTES, PHANDLE);
typedef BOOL (WINAPI * __IsProcessInJob) (HANDLE, HANDLE, PBOOL);
*
* Returns 0 on success, non-zero on failure, same as CreateProcess().
*
- * On NT4, or any other system not containing the required functions, will
- * launch the process under the current token without doing any modifications.
- *
* NOTE! Job object will only work when running as a service, because it's
* automatically destroyed when pg_ctl exits.
*/
if (_CreateRestrictedToken == NULL)
{
- /*
- * NT4 doesn't have CreateRestrictedToken, so just call ordinary
- * CreateProcess
- */
- write_stderr(_("%s: WARNING: cannot create restricted tokens on this platform\n"), progname);
- if (Advapi32Handle != NULL)
- FreeLibrary(Advapi32Handle);
- return CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, processInfo);
+ /* Log error if we cannot get the function */
+ write_stderr(_("%s: could not locate object function to create restricted token: error code %lu\n"),
+ progname, (unsigned long) GetLastError());
+ return 0;
}
/* Open the current token to use as a base for the restricted one */
* Returns a description of the socket error by first trying
* to find it in the lookup table, and if that fails, tries
* to load any of the winsock dlls to find that message.
- * The DLL thing works from Nt4 (spX ?) up, but some special
- * versions of winsock might have this as well (seen on Win98 SE
- *
*/
const char *