Commit bdc61326 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

d3d8: Allocate what Validate(Vertex|Pixel)Shader return with HeapAlloc.

Fixes: a70e3059 Fixes: 6db89702
parent ef34d813
...@@ -95,7 +95,7 @@ done: ...@@ -95,7 +95,7 @@ done:
if (!return_error) if (!return_error)
message = ""; message = "";
message_size = strlen(message) + 1; message_size = strlen(message) + 1;
if (errors && (*errors = malloc(message_size))) if (errors && (*errors = HeapAlloc(GetProcessHeap(), 0, message_size)))
memcpy(*errors, message, message_size); memcpy(*errors, message, message_size);
return hr; return hr;
...@@ -140,7 +140,7 @@ done: ...@@ -140,7 +140,7 @@ done:
if (!return_error) if (!return_error)
message = ""; message = "";
message_size = strlen(message) + 1; message_size = strlen(message) + 1;
if (errors && (*errors = malloc(message_size))) if (errors && (*errors = HeapAlloc(GetProcessHeap(), 0, message_size)))
memcpy(*errors, message, message_size); memcpy(*errors, message, message_size);
return hr; return hr;
......
...@@ -5051,11 +5051,11 @@ static void test_validate_vs(void) ...@@ -5051,11 +5051,11 @@ static void test_validate_vs(void)
hr = ValidateVertexShader(NULL, NULL, NULL, FALSE, &errors); hr = ValidateVertexShader(NULL, NULL, NULL, FALSE, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(!*errors, "Got unexpected string \"%s\".\n", errors); ok(!*errors, "Got unexpected string \"%s\".\n", errors);
free(errors); HeapFree(GetProcessHeap(), 0, errors);
hr = ValidateVertexShader(NULL, NULL, NULL, TRUE, &errors); hr = ValidateVertexShader(NULL, NULL, NULL, TRUE, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(!!*errors, "Got unexpected empty string.\n"); ok(!!*errors, "Got unexpected empty string.\n");
free(errors); HeapFree(GetProcessHeap(), 0, errors);
hr = ValidateVertexShader(vs_code, NULL, NULL, FALSE, NULL); hr = ValidateVertexShader(vs_code, NULL, NULL, FALSE, NULL);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
...@@ -5064,7 +5064,7 @@ static void test_validate_vs(void) ...@@ -5064,7 +5064,7 @@ static void test_validate_vs(void)
hr = ValidateVertexShader(vs_code, NULL, NULL, TRUE, &errors); hr = ValidateVertexShader(vs_code, NULL, NULL, TRUE, &errors);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!*errors, "Got unexpected string \"%s\".\n", errors); ok(!*errors, "Got unexpected string \"%s\".\n", errors);
free(errors); HeapFree(GetProcessHeap(), 0, errors);
hr = ValidateVertexShader(vs_code, declaration_valid1, NULL, FALSE, NULL); hr = ValidateVertexShader(vs_code, declaration_valid1, NULL, FALSE, NULL);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
...@@ -5101,11 +5101,11 @@ static void test_validate_vs(void) ...@@ -5101,11 +5101,11 @@ static void test_validate_vs(void)
hr = ValidateVertexShader(vs_code, NULL, NULL, FALSE, &errors); hr = ValidateVertexShader(vs_code, NULL, NULL, FALSE, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(!*errors, "Got unexpected string \"%s\".\n", errors); ok(!*errors, "Got unexpected string \"%s\".\n", errors);
free(errors); HeapFree(GetProcessHeap(), 0, errors);
hr = ValidateVertexShader(vs_code, NULL, NULL, TRUE, &errors); hr = ValidateVertexShader(vs_code, NULL, NULL, TRUE, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(!!*errors, "Got unexpected empty string.\n"); ok(!!*errors, "Got unexpected empty string.\n");
free(errors); HeapFree(GetProcessHeap(), 0, errors);
} }
static void test_validate_ps(void) static void test_validate_ps(void)
...@@ -5149,7 +5149,7 @@ static void test_validate_ps(void) ...@@ -5149,7 +5149,7 @@ static void test_validate_ps(void)
hr = ValidatePixelShader(ps_1_1_code, NULL, TRUE, &errors); hr = ValidatePixelShader(ps_1_1_code, NULL, TRUE, &errors);
ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr); ok(hr == S_OK, "Got unexpected hr %#lx.\n", hr);
ok(!*errors, "Got unexpected string \"%s\".\n", errors); ok(!*errors, "Got unexpected string \"%s\".\n", errors);
free(errors); HeapFree(GetProcessHeap(), 0, errors);
memset(&caps, 0, sizeof(caps)); memset(&caps, 0, sizeof(caps));
caps.PixelShaderVersion = D3DPS_VERSION(1, 1); caps.PixelShaderVersion = D3DPS_VERSION(1, 1);
...@@ -5179,11 +5179,11 @@ static void test_validate_ps(void) ...@@ -5179,11 +5179,11 @@ static void test_validate_ps(void)
hr = ValidatePixelShader(ps_1_1_code, NULL, FALSE, &errors); hr = ValidatePixelShader(ps_1_1_code, NULL, FALSE, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(!*errors, "Got unexpected string \"%s\".\n", errors); ok(!*errors, "Got unexpected string \"%s\".\n", errors);
free(errors); HeapFree(GetProcessHeap(), 0, errors);
hr = ValidatePixelShader(ps_1_1_code, NULL, TRUE, &errors); hr = ValidatePixelShader(ps_1_1_code, NULL, TRUE, &errors);
ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr); ok(hr == E_FAIL, "Got unexpected hr %#lx.\n", hr);
ok(!!*errors, "Got unexpected empty string.\n"); ok(!!*errors, "Got unexpected empty string.\n");
free(errors); HeapFree(GetProcessHeap(), 0, errors);
} }
static void test_volume_get_container(void) static void test_volume_get_container(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment